Re: question related to action and tile

2004-09-26 Thread Craig McClanahan
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]



Re: question related to action and tile

2004-09-23 Thread Amit Gupta
Can any body guide me how to rewrite URL with JSP and tomcat as it is
possible with mode_rewrite with apache?

Take care
Amit Gupta
Mobile:9891062552
Email: [EMAIL PROTECTED]
- Original Message -
From: Vclavk 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]



RE: question related to action and tile

2004-09-22 Thread Vclavk Radek
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]
 


Re: question related to action and tile

2004-09-22 Thread Jeff Beal
Lijuan Jing wrote:
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 
Which method (GET or POST) are you using to submit the request?  If the 
request will be modifying data in a database, you should be using the 
POST method.  When issuing a reload using the POST method, browsers will 
display a message to the user warning that they are re-sending duplicate 
information.

If you want to be absolutely sure that your request is a new request, 
you will probably need to include some sort of token parameter in the 
request.  When you generate the original form, you generate a random 
number.  You store this number as a session attribute named 
expectedToken and send it to the user as the value of a hidden form 
field named token.  The user fills out the form and sends it back to 
you.  If the token parameter matches the expectedToken attribute, 
then you change (or delete) the expectedToken attribute and process 
the request.  If they do not match, you return a meaningful error to the 
user.

There is no way in standard HTTP / Servlets to distinguish between a 
refresh and an original request.

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