On Thu, 23 Sep 2004 15:16:18 -0700, Amit Gupta
<[EMAIL PROTECTED]> wrote:
> Can any body guide me how to rewrite URL with JSP and tomcat as it is
> possible with mode_rewrite with apache?

Doing "rewriting" within the scope of a web application is possible
with a Filter (Servlet 2.3 or later) that analyzes the incoming
request properties, and does a RequestDispatcher.forward() to the
desired path (instead of calling chain.doFilter() to execute the
originally requested servlet).

Doing such rewriting across web applications (i.e. from one context
path to another) requires either running behind Apache or some other
web server, or some other container-specific thing (ike writing a
Valve for Tomcat, which is sort of a server-level equivalent to a
servlet filter).

> 
> Take care
> Amit Gupta
> Mobile:9891062552
> Email: [EMAIL PROTECTED]
> 

Craig


> 
> ----- Original Message -----
> From: "Václavík Radek" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
> Sent: Wednesday, September 22, 2004 5:13 AM
> Subject: RE: question related to action and tile
> 
> > You may want to try adding this to the header of your jsp:
> >
> > <meta http-equiv="expires" content="1" />
> > <meta http-equiv="pragma" content="no-cache" />
> >
> > When the reload button is clicked, the browser should ask the user whether
> > he/she wants to resend the entered information. It does not solve you
> > problem completely (if the user chooses to resend the information, it is
> > processed by the action again. But, on the other hand, you should take
> care
> > of this e.g. in you validate method - maybe checking for existing name,
> id,
> > etc.), but at least alerts the user, that he/she is doing someting
> > repeatedly.
> >
> > Radek
> >
> > > -----Original Message-----
> > > From: Lijuan Jing [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, September 22, 2004 9:53 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: question related to action and tile
> > >
> > >
> > > This is a question related to action and tile.
> > >
> > > <action path="someURL"
> > >         name="submitForm"
> > >         type="someActionClass">
> > >  <forward
> > >   name="success"
> > >   path=".pages.tileDef1"/>
> > > </action>
> > > -------------------------------
> > > tile definition:
> > >   <definition
> > >     name=".pages.Base"
> > >     path="/pages/common/layouts/baseLayout.jsp">
> > >     <put name="footer"
> > >          value="/pages/common/header.jsp" />
> > >     <put name="content"
> > >          value="/pages/content/home_content.jsp" />
> > >     <put name="footer"
> > >          value="/pages/common/footer.jsp" />
> > >   </definition>
> > >
> > >   <definition
> > >     name=".pages.tileDef1" extends=".pages.Base">
> > >     <put name="content"
> > >          value="/pages/content/real_content.jsp" />
> > >   </definition>
> > >
> > > After someActionClass executed successfully, it
> > > displays page .pages.tileDef1, but the URL on
> > > browser still shows someURL. If user clicks
> > > browser's refresh button, the 'submitForm' will
> > > be submitted again and 'someActionClass' will be
> > > executed again which end up processing the
> > > 'submitForm' multiple times depends
> > > on how many time user clicks refresh. It becomes worse
> > > if the content of the form will be written to
> > > database.
> > >
> > > How do I know (while I am in action code) if it comes
> > > from the real button click or the refresh button
> > > click?
> > >
> > > Or I could show a different URL after the form is
> > > processed, then a dummy action has to be added. Not a
> > > clean way to do.
> > >
> > > <action path="someURL"
> > >         name="submitForm"
> > >         type="someActionClass">
> > >  <forward
> > >   name="success"
> > >   path="/do/dummy"/>
> > > </action>
> > >
> > > <action path="/dummy"
> > >         name="dummyForm"
> > >         type="dummyActionClass">
> > >  <forward
> > >   name="success"
> > >   path=".pages.tileDef1"/>
> > > </action>
> > >
> > > Thanks,
> > > Lijuan
> > >
> > >
> > >
> > >
> > >
> > > __________________________________
> > > Do you Yahoo!?
> > > New and Improved Yahoo! Mail - Send 10MB messages!
> > > http://promotions.yahoo.com/new_mail
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> >
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.768 / Virus Database: 515 - Release Date: 9/22/2004
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to