You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by far4ever <fa...@gmail.com> on 2009/04/17 03:23:23 UTC

having the same form in many JSP pages

hi,

i need to have the same form in all my JSP pages (a search form). so in such
situation can i use the same same bean and the Action class being used for
all these JSP. 

if so how should i specify the 'input' for the 'action mapping' . 
or is there any other alternative way of doing it.

can any one help me.
thanks in advance.

-- 
View this message in context: http://www.nabble.com/having-the-same-form-in-many-JSP-pages-tp23089527p23089527.html
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: having the same form in many JSP pages

Posted by mitch gorman <mg...@shadowtv.com>.
far4ever wrote:
> hi,
>
> i need to have the same form in all my JSP pages (a search form). so in such
> situation can i use the same same bean and the Action class being used for
> all these JSP. 
>
> if so how should i specify the 'input' for the 'action mapping' . 
> or is there any other alternative way of doing it.
>
> can any one help me.
> thanks in advance.
>   

    on the jsp side, you'll want to do put your search form into its own
jsp, and then use <jsp:include...> to incorporate it into your various
pages.

    on the java side, what you want to do is write a base class that
handles your search functionality (e.g., has the actual search method,
has the member variable that holds the search term entered by the user,
has the accessor methods for that search-term variable, etc.), and then,
since the various pages of your application presumably have other work
they need to do, extend that base class for your other action code.  you
don't really want to have a single action class for all your jsps...
   
   

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org