struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Jouravlev" <jmi...@gmail.com>
Subject Re: Redirect not working
Date Thu, 13 Jul 2006 16:02:16 GMT
If your action is a rendering action you do not need to redirect. If
your action is a submit action then you need to redirect to rendering
action that in turn forwards to JSP.

See some info here (work in progress):
http://wiki.apache.org/struts/StrutsManualActionClasses

On 7/13/06, Pankaj Gupta <pankaj.gupta@hsc.com> wrote:
> I understand that providing direct access to JSP's is not a good idea.
> But the problem that I am facing is that if we dont use redirect, the
> user of the application is confused by the way Browser's refresh and
> back/forward operations behave.
>
> Can you suggest some other way by which I can prevent the request from
> getting submitted again on Browser's refresh or forward/next operations?
>
> regards
> Pankaj
>
> Daoud Abdelmonem Faleh wrote:
> > Hi,
> >
> > Under Tomcat i would keep my jsp's under an accessible directory and
> > use the security-constraint in web.xml : (something like)
> > ...
> > <security-constraint>
> >     <web-resource-collection>
> >       <web-resource-name>protected jsp</web-resource-name>
> >       <url-pattern>/jsp/*.jsp</url-pattern>
> >    </web-resource-collection>
> > </security-constraint>
> >
> > to prevent direct access to my jsp's files then forward to them from
> > actions.
> > The added benefit is that we enforce the MVC model in that only the
> > controler can choose the next view.
> >
> > Hope this helps.
> > Daoud AbdelMonem Faleh.
> >
> >
> > On 7/13/06, James Woodward <james-struts-user@matoch.com> wrote:
> >> I may be wrong but if all the jsp pages are in the WEB-INF directory and
> >> you try to redirect to a .jsp file it's basically the same as loading it
> >> directly. I think you have to use a forward to access it. You could
> >> probably get around it if you created an action to specifically display
> >> the jsp file and use a redirect to that action.
> >>
> >> Keep in mind I'm no expert and could be completely wrong about this one.
> >>
> >> James
> >>
> >> Pankaj Gupta wrote:
> >> > Hi All,
> >> >
> >> > I have specified redirect="true" in my action forwards but tomcat
> >> > fails to find the jsp. I have kept all my jsp's in WEB-INF/jsp folder
> >> > so as to avoid direct jsp access. Please suggest how can I make
> >> > redirect to work.
> >> >
> >> > regards,
> >> > Pankaj
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> > For additional commands, e-mail: user-help@struts.apache.org
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Mime
View raw message