Always having to declare jsp:useBean
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Akuma_Devil
Posted On:   Monday, November 14, 2005 01:27 AM

page1 works. page2 doesn't work. page3 works. -------------------------------------------------- -------------------------------------------------- page1.jsp <% aaa.SomeMethod() ; %> -------------------------------------------------- page2.jsp <% aaa.SomeMethod(); %> -------------------------------------------------- page2.jsp <% aaa.SomeMethod(); %> --------------------------   More>>

page1 works. page2 doesn't work. page3 works.



--------------------------------------------------

--------------------------------------------------



page1.jsp











<%

aaa.SomeMethod() ;

%>



--------------------------------------------------



page2.jsp



<%

aaa.SomeMethod();

%>



--------------------------------------------------



page2.jsp







<%

aaa.SomeMethod();

%>



--------------------------------------------------

--------------------------------------------------



Is there a way so I don't have to keep re-entering the jsp:useBean on included pages? (that would allow page2 to work)



Cheers.    <<Less

Re: Always having to declare jsp:useBean

Posted By:   Anonymous  
Posted On:   Tuesday, November 22, 2005 12:10 PM

Please read up on the difference between Include and Import in the jsp world as well as Directive and Standard actions, there you will find exactly what you need.


In short (if memory serves me right) I believe you want to use the <%@ include %> directive instead of the standard action.


Admittedly this is not the easiest to learn/remember, but once you understand exactly what is happening in which phase (translation, compilation, etc.) things should start to make sense.

About | Sitemap | Contact