No configuration found for the specified action
I get the following message No configuration found for the specified action: 'doLogin.action' in namespace: ''. Form action defaulting to 'action' attribute's literal value.' when I try to submit login.jsp page containing username and password as input fields and submit button. login.jsp: %@ taglib prefix=s uri=/struts-tags % html head titleStruts 2 Login Application/title link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ /head body s:form action=doLogin.action tr td colspan=2Login/td /tr tr td colspan=2 s:actionerror / s:fielderror / /td /tr s:textfield name=username label=Login name/ s:password name=password label=Password/ s:submit value=Login align=center/ /s:form /body /html struts.xml:- ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts constant name=struts.enable.DynamicMethodInvocation value=false/ constant name=struts.devMode value=false/ package name=action extends=struts-default action name=doLogin.action class=com.tcs.infra.cmt.Login_dummy result name=input/login.jsp/result result name=error/login.jsp/result result/loginsuccess.jsp/result /action /package /struts web.xml :- ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_9 version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameSample Struts 2/display-name filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping welcome-file-list welcome-filelogin.jsp/welcome-file /welcome-file-list /web-app Login_dummy.java package com.tcs.infra.cmt; import com.opensymphony.xwork2.ActionSupport; public class Login_dummy extends ActionSupport { private String username; private String password; public String execute() { return SUCCESS; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } I have added all the required jars.Please help me !! -- View this message in context: http://old.nabble.com/No-configuration-found-for-the-specified-action-tp26508973p26508973.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: No configuration found for the specified action
I tried doing it butstill I am getting the same error -- View this message in context: http://old.nabble.com/No-configuration-found-for-the-specified-action-tp26508973p26509553.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: No configuration found for the specified action
Hi Lukasz, I tried the same without adding prefix. Still I am getting the same error. -- View this message in context: http://old.nabble.com/No-configuration-found-for-the-specified-action-tp26508973p26510057.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: no Action mapped for namespace / and action name doLogin.
hi raghuveer, I tried with ur suggestions but still I am getting the same error. Please help me!!! -- View this message in context: http://old.nabble.com/RE%3A-no-Action-mapped-for-namespace---and-action-name-doLogin.-tp26510748p26511382.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: no Action mapped for namespace / and action name doLogin.
Guyz Any suggestions Please -- View this message in context: http://old.nabble.com/RE%3A-no-Action-mapped-for-namespace---and-action-name-doLogin.-tp26510748p26512263.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2 + EJB 3.0 + Hibernate
Is It a good idea to build a project using the combination Struts2 + EJB 3.0 + Hibernate using MVC architecture. Guys please share ur opinion -- View this message in context: http://old.nabble.com/Struts2-%2B-EJB-3.0-%2B-Hibernate-tp26524749p26524749.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
no Action mapped for namespace / and action name doLogin.
Hi All, I am working in application using struts-EJB-hibernate But when I am running the this login application it is not able to find the action class. The Error Which I am getting is as follows:- There is no Action mapped for namespace / and action name doLogin. - [unknown location] at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) My jsp page contains an action doLogin and I am using struts 2.4 -- View this message in context: http://old.nabble.com/no-Action-mapped-for-namespace---and-action-name-doLogin.-tp26508228p26508228.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: no Action mapped for namespace / and action name doLogin.
No configuration found for the specified action under struts2.0.11 Hi all, I am using jboss v5.0 and my login.jsp is %@ taglib prefix=s uri=/struts-tags % html head titleStruts 2 Login Application/title link href=s:url value=/css/main.css/ rel=stylesheet type=text/css/ /head body s:form action=doLogin tr td colspan=2Login/td /tr tr td colspan=2 s:actionerror / s:fielderror / /td /tr s:textfield name=username label=Login name/ s:password name=password label=Password/ s:submit value=Login align=center/ /s:form /body /html and my struts.xml is ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts constant name=struts.enable.DynamicMethodInvocation value=false/ constant name=struts.devMode value=false/ package name=sample extends=struts-default namespace=/ action name=doLogin class=com.tcs.infra.cmt.Login result name=input/login.jsp/result result name=error/login.jsp/result result/loginsuccess.jsp/result /action /package /struts and my web.xml is like this ?xml version=1.0 encoding=UTF-8? web-app id=WebApp_9 version=2.4 xmlns=http://java.sun.com/xml/ns/j2ee; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd; display-nameSample Struts 2/display-name filter filter-namestruts2/filter-name filter-classorg.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter/filter-class /filter filter-mapping filter-namestruts2/filter-name url-pattern/*/url-pattern /filter-mapping welcome-file-list welcome-filelogin.jsp/welcome-file /welcome-file-list /web-app getting the following error There is no Action mapped for namespace / and action name doLogin. at com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:177) at org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) at org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) at com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) I am not able to understand while I am getting this error . Please help me out of
Re: Dynamic Message
Hi All, I am using struts2 for my application. However I am stuck at a place. Guys Please Help me out. I have three buttons in my jsp page and I have defined separate action for each button and using my struts.xml I have mapped these actions to respective methods. Now my question is that when I click any of these buttons then if I recieve success from my action class I should display a message of successful completion of that action on the same page where these three buttons are. Could anyone guide me that how could I do this? Do I need to add some script in action class? -- View this message in context: http://old.nabble.com/Dynamic-Message-tp26373865p26387171.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Dynamic Message
Thanks buddy It is working -- View this message in context: http://old.nabble.com/Dynamic-Message-tp26373865p26388558.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2 online sources/ ebooks
Hi Friends, I am currently learning struts 2 and have developed a small application using tutorials from http://www.vaannila.com and http://www.roseindia.net/struts/ . If you know any good links may be tutorials or ebooks Please share it so that I could learn from them Thanks in advance!!! -- View this message in context: http://old.nabble.com/Struts2-online-sources--ebooks-tp26402511p26402511.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Struts2 Multiple validation for single field
Hi all , I am doing server side validation using validate method inside my action class.I need to validate the textfield whether it is a null and if not it should be numeric. My jsp page is as follows:- %...@page contentType=text/html pageEncoding=UTF-8% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; %...@taglib uri=/struts-tags prefix=s % html head s:head / meta http-equiv=Content-Type content=text/html; charset=UTF-8 titleLogin Page/title /head body s:form action=Login s:textfield label=Load size=12 name=load/ s:textfield label=Duration size=12 name=time/ s:submit theme=simple action=start value=Start / s:submit theme=simple action=stop value=Stop / s:submit theme=simple action=change value=Change / /s:form /body /html and my action class is as follows import com.opensymphony.xwork2.ActionSupport; public class RemoteClientAction extends ActionSupport { public void validate() { if (getLoad().length() == 0) { addFieldError(load, Load is required); } if (getTime().length() == 0) { addFieldError(time, Duration is required); } } public String getLoad() { return load; } public void setLoad(String load) { this.load = load; } public String getTime() { return time; } public void setTime(String time) { this.time = time; } private String load; private String time; public String execute(){ return SUCCESS; } Here I am able to validate for not null fields. But I also want to validate it for the field if not null should be numeric. How Can I do this?? Please Suggest me possible solution in order to validate both things. -- View this message in context: http://old.nabble.com/Struts2-Multiple-validation-for-single-field-tp26373102p26373102.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Struts2 Multiple validation for single field
If I am declaring it as int how should I check for null. Can u explain me please? -- View this message in context: http://old.nabble.com/Struts2-Multiple-validation-for-single-field-tp26373102p26373588.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 Multiple validation for single field
Ya Now its working fine. I am running this application on jboss server. While the application is running I am getting lot of errors in the console such as follows:- Any suggestions Please in order Not to get such kind of errors 20:50:58,950 WARN [OgnlValueStack] Error setting value ognl.MethodFailedException: Method setLoad failed for object com.tcs.infra.workload.remoteclientact...@161ef9c [java.lang.NoSuchMethodException: setLoad([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:823) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:964) at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:75) at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:131) at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at com.opensymphony.xwork2.ognl.accessor.CompoundRootAccessor.setProperty(CompoundRootAccessor.java:50) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656) at ognl.ASTProperty.setValueBody(ASTProperty.java:101) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177) at ognl.SimpleNode.setValue(SimpleNode.java:246) at ognl.Ognl.setValue(Ognl.java:476) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:155) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:143) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:273) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:93) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:128) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(ProfilingActivationInterceptor.java:104) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:148) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:128) at
Dynamic Message
Hi ALL, In my Struts2/jsp form I have three buttons. When any of these buttons are clicked and once the action is successfull I want to dynamically show a message on the same page where these buttons are . Any Suggestions please in order to handle such case.And also the message should be different for each button. Thanks in advance -- View this message in context: http://old.nabble.com/Dynamic-Message-tp26373865p26373865.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
RE: Struts2 Multiple validation for single field
Thanks Niel For Your Help -- View this message in context: http://old.nabble.com/Struts2-Multiple-validation-for-single-field-tp26373102p26373908.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Dynamic Message
I already have defined three different actions for each button. The thing which I want is that when I click any of this button and the action class returns a success then there should be a dynamic message on the same page where the buttons are , that the action has been successfull. How can I do it ?? Please suggest me.. -- View this message in context: http://old.nabble.com/Dynamic-Message-tp26373865p26384268.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Trouble with struts2 validation
-- View this message in context: http://old.nabble.com/Trouble-with-struts2-validation-tp26316069p26316069.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Trouble with struts2 validation
Hi all, In my login application I want to validate whether the textfield for Usename and password is not null and also if some user enters some username say admin and password as admin it should get logged in. For this I am using postgresql database and I have already stored username and password as both as admin. Now the problem is my Login page is able to check whether the textfield for Usename is Null or not but not able to validate with database stored username and pasword. Initially I did not check for null textfield and I was able to validate the username and password directly from database.but When I applied validate method in my action class It began to validate for null fields but not for stored username and password. I am pasting my code.. My Action class :- package struts2demo.login.action; import com.opensymphony.xwork2.ActionSupport; import java.sql.*; import java.text.*; import java.io.*; public class Login extends ActionSupport { private String userid; private String pwd; Connection db; Statement sql; DatabaseMetaData dbmd; public Login() { } public void validate() { if (getUserid().length() == 0) { addFieldError(userid, User Name is required); } if (getPwd().length() == 0) { addFieldError(pwd,password isrequired); } } public String execute() throws ClassNotFoundException,SQLException { String database = LOGIN; String username =vikrant; String password =vikrant; System.out.println(inside action class); Class.forName(org.postgresql.Driver); db = DriverManager.getConnection(jdbc:postgresql:+database,username,password ); dbmd =db.getMetaData(); System.out.println(Connection to +dbmd.getDatabaseProductName()+ +dbmd.getDatabaseProductVersion()+ successful \n); System.out.println(Connected to the database); sql=db.createStatement(); System.out.println(Now executing the command : +select * from my_table); System.out.println(select * from my_table where usr = + '+userid+'+ and pass = +'+pwd+'); ResultSet results =sql.executeQuery(select * from my_table where usr = + '+userid+'+ and pass = +'+pwd+'); if (results != null) { return SUCCESS; } else return ERROR; } public String getUserid() { return userid; } public void setUserid(String userid) { this.userid = userid; } public String getPwd() { return pwd; } public void setPwd(String pwd) { this.pwd = pwd; } } And my struts.xml is as follows:- ?xml version=1.0 encoding=UTF-8 ? !DOCTYPE struts PUBLIC -//Apache Software Foundation//DTD Struts Configuration 2.0//EN http://struts.apache.org/dtds/struts-2.0.dtd; struts package name=struts2demo.login.action extends=struts-default action name=Login class=struts2demo.login.action.Login resultsuccess.jsp/result result name=input/login.jsp/result result name=errorerror.jsp/result /action /package /struts I am not able to understand that why the validation failed for database when I applied validation for textfield.? Could you please help me out of this..? -- View this message in context: http://old.nabble.com/Trouble-with-struts2-validation-tp26316586p26316586.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Alligning multiple buttons in a single row.
Hi All, I am new to struts programming and trying to learn struts from the tutorials provided online. First Let me descibe my application. I am using html inside a jsp page for the frontend. I have three buttons in this page. They are as START , STOP, and CHANGE. I have different actions for each buttons and I have mapped this actions to respective methods in the action class. My problem is that I am not able to design the page. I need these three buttons in the same row But I am not able to do so. I tried to put these buttons inside a tables but still All buttons are coming vertically and not horizontally. I will provide you my both html script. !) One without using tables %@ taglib prefix=s uri=/struts-tags % s:form action=Workload s:textfield label=Load name=load s:textfield label=Duration name=time s:submit action=start method=StartWorkload value=START/ s:submit action=stop method=StopWorkload value=STOP/ s:submit action=change method=ChangeWorkload value=CHANGE/ 2) One with using Tables %@ taglib prefix=s uri=/struts-tags % html titleStruts Application/title body style=background-color: #CBCE8A table frame=below align=center rules=rows tr s:form action=Workload table tr tds:textfield label=Load name=load/s:textfield/td /tr tr tds:textfield label=Duration name=time/s:textfield/td /tr tr tds:submit action=start method=StartWorkload value=START//td tds:submit action=stop method=StopWorkload value=STOP//td tds:submit action=change method=ChangeWorkload value=CHANGE//td /tr /table /s:form /tr /table /body /html By using both Scripts i am getting same result with all buttons vertically. I need these buttons to be in a single horizontal line. Please Help me out of this! Thanks in advance! -- View this message in context: http://old.nabble.com/Alligning-multiple-buttons-in-a-single-row.-tp26284283p26284283.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Alligning multiple buttons in a single row.
Hi, I am very much thankful to you. My problem is solved. But the buttons are not at equal distance from each other. They are spaced unequally. Any Suggestions Please. -- View this message in context: http://old.nabble.com/Alligning-multiple-buttons-in-a-single-row.-tp26284283p26284846.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: Alligning multiple buttons in a single row.
Hi , My problem is solved -- View this message in context: http://old.nabble.com/Alligning-multiple-buttons-in-a-single-row.-tp26284283p26284848.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org