Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with JSP form

 
swarupa patil
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • 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 ]
 
Aravind Prasad
Ranch Hand
Posts: 265
  • Mark post as helpful
  • send pies
  • 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
  • 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>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64833
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please post questions about Struts in the Struts forum. This has been moved there.
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
I used Session Scope for Form
Is any other problem then tell me
 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic