How to call jsp method from another jsp page

Hi ALL,

I have two jsp files

jsp1 and jsp2

in jsp2 i have method name sample

<%

sample()

{

:

:

:

}

%>

i want this method to be called from jsp1 inside a if loop

jsp1

<%

int flag=1

if(flag==1)

{

I want the sample method of jsp2 to be called within if loop returns true

}

%>

Help me

[425 byte] By [visavva] at [2007-11-26 18:17:15]
# 1
Actually you cannot do this in a platform independent way.But why would you want to do this? This is not sane design. You better move the method to a class, instantiate the class and call the method.
beradriana at 2007-7-9 5:50:50 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...