• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with JSP form

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys
I am using Struts and JSP genrated Registration form. It works fine
but when we requesr for the same registration form I got the page with
previous values entered in the form. Can anybody tell me where is the problem. Please Help.
[ June 01, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi swarupa patil
Can you please send the code of that registration page.. if so it is easy to find the problem.
 
swarupa patil
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<%
response.addHeader("Pragma","no-cache");
response.setHeader("Cache-Control","no-cache, no-store, must-revalidate");
response.addHeader("Cache-Control","pre-check=0, post-check=0");
response.setDateHeader("Expires", 0);
%>


<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html-el" %>

<%!



%>
<html:html xhtml="true">

<head>
<title><bean:message key="formpage.title"/></title>
<html:base/>
</head>
<script>
function showalert()
{
alert("Are you sure you dont want to receive email alerts");
}
</script>
<body background="images/blueAndWhiteBackground.gif">
<div align="center">
<br/><br/><br/>
<h2><bean:message key="formpage.title"/></h2>

<html:errors/>

<html:form action="/submitCustomerForm" focus="firstName" method="POST">

<table width="60%">
<tr>
<td align="right"><bean:message key="prompt.customer.firstname" />:</td>
<td align="left"><html:text property="firstName" size="16" maxlength="25"
tabindex="1"/>
</td>
</tr>

<tr>
<td align="right"><bean:message key="prompt.customer.lastname"/>:</td>
<td align="left"><html:text property="lastName" size="16" maxlength="25" tabindex="2"/></td>
</tr>

<tr>
<td align="right"><bean:message key="prompt.customer.email"/>:</td>
<td align="left"><html:text styleClass="mytxtbox" property="emailAddress" size="16" maxlength="30" tabindex="3"/></td>
</tr>

<tr>
<td align="right"><bean:message key="prompt.customer.mobile"/>:</td>
<td align="left"><html:text property="mobile" size="16" maxlength="30" tabindex="4"/></td>
</tr>

<tr>
<td align="right"><bean:message key="prompt.customer.username"/>:</td>
<td align="left"><html:text property="username" size="16" maxlength="25" tabindex="5"/></td>
</tr>

<tr>
<td align="right"><bean:message key="prompt.customer.password"/>:</td>
<td align="left"><html assword property="password" size="16" maxlength="25" tabindex="6"/></td>
</tr>
<tr>
<td align="right"><bean:message key="prompt.customer.reenter"/>:</td>
<td align="left"><html assword property="reenterpassword" size="16" maxlength="25" tabindex="7"/></td>
</tr>
 
Sheriff
Posts: 67745
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please post questions about Struts in the Struts forum. This has been moved there.
 
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the scope of the form in struts-config?
 
swarupa patil
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used Session Scope for Form
Is any other problem then tell me
 
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hmmm... maybe you should try putting something like this in your Action class, after you have made use of the information...


[code]
HttpSession session;

session = request.getSession()

session.invalidate(); //This would destroy all your session info including login info
[code]

or solution 2... Narrow down your scope to request scope
 
Sometimes you feel like a nut. Sometimes you feel like a tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic