Problem dispatching in /content dir
So I have a jsp that needs to submit to another jsp. Both are in /content. When I use file-name.jsp I get 404. When I use file-name, I get the action that file-name.jsp submits to. Any ideas on how I can work around this? Jim C.
RE: Problem dispatching in /content dir
Jim, The normal process is to call the action e.g. Struts will then (eventually) call the actions execute () method. This returns a string that is mapped to the correct jsp page using a file like my-struts.xml. The mapping will look something like: - /content/EverythingOK.jsp /content/ErrorPage.jsp If you don't follow this paradigm then the framework will not be able to perform the actions processing work or make any data available to the JSP page. In other words you won't be using the framework. Of course you can link directly to an html page. However I don't see the reason to link to a jsp page unless it can pull some dynamic content out from the framework. Does this help? Kind Regards, Steve -Original Message- From: Jim Collings [mailto:jlistn...@gmail.com] Sent: 15 May 2009 12:16 To: Struts Users Mailing List Subject: Problem dispatching in /content dir So I have a jsp that needs to submit to another jsp. Both are in /content. When I use file-name.jsp I get 404. When I use file-name, I get the action that file-name.jsp submits to. Any ideas on how I can work around this? Jim C. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Problem dispatching in /content dir
Here's a bit of clarification: page-one.jsp which is in /content | \-page-two <--Have to use this to access page two because it, also is in "/content". This means calling an empty "execute()". | \-page-two.jsp | \page-two <--Page two action "page-two!dosomething" Now I could put in a dummy action that just forwards to "page-two.jsp" but why? It seems like there should be a better way. Jim C. On Fri, May 15, 2009 at 7:16 AM, Jim Collings wrote: > > So I have a jsp that needs to submit to another jsp. Both are in /content. > When I use file-name.jsp I get 404. When I use file-name, I get the action > that file-name.jsp submits to. > > Any ideas on how I can work around this? > > Jim C. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Problem dispatching in /content dir
There is. Create a simple action in your struts xml file and map it to the framework class ActionSupport (com.opensymphony.xwork2.ActionSupport). I haven't done this myself (although I have derived my actions from ActionSupport). But I believe it will do what you want. Cheers, Steve -Original Message- From: Jim Collings [mailto:jlistn...@gmail.com] Sent: 15 May 2009 12:41 To: Struts Users Mailing List Subject: Re: Problem dispatching in /content dir Here's a bit of clarification: page-one.jsp which is in /content | \-page-two <--Have to use this to access page two because it, also is in "/content". This means calling an empty "execute()". | \-page-two.jsp | \page-two <--Page two action "page-two!dosomething" Now I could put in a dummy action that just forwards to "page-two.jsp" but why? It seems like there should be a better way. Jim C. On Fri, May 15, 2009 at 7:16 AM, Jim Collings wrote: > > So I have a jsp that needs to submit to another jsp. Both are in /content. When I use file-name.jsp I get 404. When I use file-name, I get the action that file-name.jsp submits to. > > Any ideas on how I can work around this? > > Jim C. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Problem dispatching in /content dir
What I've done in this situation is put in the dummy action. Inevitably I find myself needing some kind of pre-processing before the JSP is loaded up -- even when I don't initially believe that I will -- and the dummy action is the right place for it. jk On Fri, May 15, 2009 at 7:40 AM, Jim Collings wrote: > Here's a bit of clarification: > > page-one.jsp which is in /content > | > \-page-two <--Have to use this to access page two because > it, also is in "/content". This means calling an empty "execute()". > | > \-page-two.jsp > | > \page-two <--Page two action "page-two!dosomething" > > Now I could put in a dummy action that just forwards to "page-two.jsp" > but why? It seems like there should be a better way. > > > Jim C. > > On Fri, May 15, 2009 at 7:16 AM, Jim Collings wrote: > > > > So I have a jsp that needs to submit to another jsp. Both are in > /content. When I use file-name.jsp I get 404. When I use file-name, I get > the action that file-name.jsp submits to. > > > > Any ideas on how I can work around this? > > > > Jim C. > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Jim Kiley Senior Technical Consultant | Summa [p] 412.258.3346 http://www.summa-tech.com
Re: Problem dispatching in /content dir
I take it back. I only thought I had it figured out. I'll use the dummy action. I find it distasteful but it seems the best way. Jim C. On Fri, May 15, 2009 at 9:07 AM, Jim Kiley wrote: > What I've done in this situation is put in the dummy action. Inevitably I > find myself needing some kind of pre-processing before the JSP is loaded up > -- even when I don't initially believe that I will -- and the dummy action > is the right place for it. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Problem dispatching in /content dir
If you're using annotation-based results, and you extend ActionSupport, the dummy action class is just a few lines -- it has no class body at all. jk On Fri, May 15, 2009 at 9:53 AM, Jim Collings wrote: > I take it back. I only thought I had it figured out. I'll use the > dummy action. I find it distasteful but it seems the best way. > > > Jim C. > > On Fri, May 15, 2009 at 9:07 AM, Jim Kiley wrote: > > What I've done in this situation is put in the dummy action. Inevitably > I > > find myself needing some kind of pre-processing before the JSP is loaded > up > > -- even when I don't initially believe that I will -- and the dummy > action > > is the right place for it. > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > -- Jim Kiley Senior Technical Consultant | Summa [p] 412.258.3346 http://www.summa-tech.com