struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Newton <>
Subject Re: How to glue struts to JSPs
Date Thu, 05 Apr 2007 12:48:27 GMT
--- "Kraft, Daniel" wrote:
> I'm new to struts and just worked through the user's
> guide.  However, for me it was not clarified there
> how to connect the "View" component to a given JSP
> page or, in general, how to manage it to make a
> given JSP be displayed for the View-part of a
> struts-request.

Struts 1 or 2? Sounds like 1, but...

If S1:

In a nutshell, an Action class returns a forward which
defines the JSP page (or tile, etc.)

<action path="/displaySomething"
  <forward name="success" 

and in the Action class:

return mapping.findForward("success");

So you visit /, the Action sets up
stuff for the presentation (JSP in this case) and
returns the appropriate forward (you could forward to,
say, a different JSP on error).

If the page doesn't need anything set up then you can
just do:

<action path="/displaySomething"

(depending on which version of S2 you're using).

If it's S2 then it's totally different; someone else
or I will follow up if that's the case, but the S2
bootstrap tutorial pretty much sums it up.


We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message