wood burning stoves 2.0*
The moose likes Struts and the fly likes Problem with JSP form Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem with JSP form" Watch "Problem with JSP form" New topic
Author

Problem with JSP form

swarupa patil
Ranch Hand

Joined: Feb 22, 2006
Posts: 62
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

Joined: Dec 28, 2005
Posts: 263
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

Joined: Feb 22, 2006
Posts: 62
<%
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

Joined: Jan 10, 2002
Posts: 60766
    
  65

Please post questions about Struts in the Struts forum. This has been moved there.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
What is the scope of the form in struts-config?
swarupa patil
Ranch Hand

Joined: Feb 22, 2006
Posts: 62
I used Session Scope for Form
Is any other problem then tell me
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 746
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


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with JSP form
 
Similar Threads
Refreshing jsp page
Problem with JSP form
Creating a registration form
Facing problem when I am mixing struts and AJAX
Uncehecking a checked property