Hi, I tried all things and its again not working still action is getting called 2 times for each call to this Register Action i am attaching the Register.jsp,Struts.xml as well as the action class please have a look at it and point me where i am doing the mistake.
Thanks in Advance -aum On Fri, Aug 1, 2008 at 5:37 PM, Joachim Ansorg <[EMAIL PROTECTED]> wrote: > Hi, > you use the same action to render the welcome screen and Registrer.jsp. > > So this means that when you display the welcome screen execute() is called > and when you display the Registrer.jsp page. > > Either use two separate actions or just return null in execute and have > another action method (i.e. save()) which writes into the db. > In the page with the submit button link to the action's save method. So > execute is used for welcome and save for the registration. > > Hope that helps, > Joachim > >> Hi All, >> >> While developing an application in struts2 i am facing a strange problem >> with one of my action namely RegsitrationAction. >> i have a jsp page for user registration where there are certain fields for >> the user to be filled for the registration purpose. >> i have created a UserProfile bean class with the bean properties for all >> the >> user registration field. >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
package actionsfolder; import com.opensymphony.xwork2.ActionSupport; public class UserRegistrationAction extends ActionSupport{ /** * */ private static final long serialVersionUID = -4632666801257988218L; private String username=null; private String password=null; private String email=null; /** * @return the username */ public String getUsername() { return username; } /** * @param username the username to set */ public void setUsername(String username) { this.username = username; } /** * @return the password */ public String getPassword() { return password; } /** * @param password the password to set */ public void setPassword(String password) { this.password = password; } /** * @return the email */ public String getEmail() { return email; } /** * @param email the email to set */ public void setEmail(String email) { this.email = email; } public String execute() throws Exception{ System.out.println("**************in Action***********"); return SUCCESS; } }
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <package name="actionsfolder" extends="struts-default"> <action name="Login" class="actionsfolder.LoginAuthenticationAction"> <result name="success">/welcome/welcome.jsp</result> <result name="input">/index.jsp</result> </action> <action name="Logout" class="actionsfolder.LogoutAction"> <result name="success">/welcome/welcome.jsp</result> </action> <action name="ReLogin"> <result>/index.jsp</result> </action> <action name="RegisterNewUser" class="actionsfolder.UserRegistrationAction"> <result name="success">/index.jsp</result> </action> <action name="Registration"> <result>/registration/Registrer.jsp</result> </action> </package> </struts>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]