You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Avinash <aa...@gmail.com> on 2012/07/03 10:34:25 UTC

Struts2

Dear sir, 
           I have design the login page in struts2 framework and i am using
tomcat7 in eclipse(indigo). The tomcat server perfectly run in the browser
but after execution my program , that will show 404 error. So sir please
guide me how to find the error and where it occured. 

--
View this message in context: http://struts.1045723.n5.nabble.com/Struts2-tp5710145.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2

Posted by "G.H.Vijayakumar" <gh...@gmail.com>.
It's better to share your code to find the bug that makes 404 error.



On Tue, Jul 3, 2012 at 2:04 PM, Avinash <aa...@gmail.com> wrote:

> Dear sir,
>            I have design the login page in struts2 framework and i am using
> tomcat7 in eclipse(indigo). The tomcat server perfectly run in the browser
> but after execution my program , that will show 404 error. So sir please
> guide me how to find the error and where it occured.
>
> --
> View this message in context:
> http://struts.1045723.n5.nabble.com/Struts2-tp5710145.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Struts2

Posted by Łukasz Lenart <lu...@gmail.com>.
2012/7/3 Avinash <aa...@gmail.com>:
> Dear sir,
>            I have design the login page in struts2 framework and i am using
> tomcat7 in eclipse(indigo). The tomcat server perfectly run in the browser
> but after execution my program , that will show 404 error. So sir please
> guide me how to find the error and where it occured.

Did you check with Tomcat Manager that your application was already deployed ?

-- 
Łukasz
mobile +48 606 323 122 http://www.lenart.org.pl/
Warszawa JUG conference - Confitura http://confitura.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2

Posted by Markus Demetz <ma...@demetz.eu>.
Hi,

you have no result named "success" for your "user" action defined in 
struts.xml, but you return "success" in your execute method.
also check the case sensitivity of "login.jsp" and "Login.jsp" defined 
as result.

Markus

Markus
Am 03.07.2012 20:31, schrieb Avinash:
> login.jsp
> --------
> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>      pageEncoding="ISO-8859-1"%>
> <%@taglib prefix="s" uri="/struts-tags"%>
> <!DOCTYPE html PUBLIC&quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
> &quot;http://www.w3.org/TR/html4/loose.dtd&quot;>
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
> <title>Insert title here</title>
> </head>
> <body>
> <s:form action="user">
> <s:textfield name="username" value="UserName"/>
> <s:textfield name="password" value="Password"/>
> <s:submit name="submit" value="submit"/>
> </s:form>
> </body>
> </html>
>
> web.xml
> --------
> <?xml version="1.0" encoding="UTF-8"?>
> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns="http://java.sun.com/xml/ns/javaee"
> xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
> http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"
> version="3.0">
>    <display-name>crs1</display-name>
>    <welcome-file-list>
>      <welcome-file>Login.jsp</welcome-file>
>
>    </welcome-file-list>
>    <filter>
>    		<filter-name>struts2</filter-name>
>    	
> <filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
>    </filter>
>    <filter-mapping>
>    		<filter-name>struts2</filter-name>
>    		<url-pattern>/*</url-pattern>
>    </filter-mapping>
> </web-app>
>
> LoginAction
> -----------
> package com.it.action;
>
> import com.opensymphony.xwork2.ActionSupport;
>
> public class LoginAction extends ActionSupport {
> 	private static final long serialVersionUID = 1L;
> 	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;
> 	}
>
> }
>
> struts.xml
> ----------
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE struts PUBLIC
> &quot;-//Apache Software Foundation//DTD Struts Configuration 2.0//EN&quot;
> &quot;http://struts.apache.org/dtds/struts-2.0.dtd&quot;>
> <struts>
> 	<package name="default" extends="struts-default">
> 	<action name="user" class="com.it.action.LoginAction">
> 	<result name="input">/Login.jsp</result>
> 	<result name="error">/Login.jsp</result>
> 	</action>
> 	</package>
> </struts>
>
> --
> View this message in context: http://struts.1045723.n5.nabble.com/Struts2-tp5710145p5710153.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2

Posted by Avinash <aa...@gmail.com>.
login.jsp
--------
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&quot;http://www.w3.org/TR/html4/loose.dtd&quot;>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<s:form action="user">
<s:textfield name="username" value="UserName"/>
<s:textfield name="password" value="Password"/>
<s:submit name="submit" value="submit"/>
</s:form>
</body>
</html>

web.xml
--------
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID"
version="3.0">
  <display-name>crs1</display-name>
  <welcome-file-list>
    <welcome-file>Login.jsp</welcome-file>
    
  </welcome-file-list>
  <filter>
  		<filter-name>struts2</filter-name>
  	
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
  </filter>
  <filter-mapping>
  		<filter-name>struts2</filter-name>
  		<url-pattern>/*</url-pattern>
  </filter-mapping>
</web-app>

LoginAction
-----------
package com.it.action;

import com.opensymphony.xwork2.ActionSupport;

public class LoginAction extends ActionSupport {
	private static final long serialVersionUID = 1L;
	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;
	}

}

struts.xml
----------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
&quot;-//Apache Software Foundation//DTD Struts Configuration 2.0//EN&quot;
&quot;http://struts.apache.org/dtds/struts-2.0.dtd&quot;>
<struts>
	<package name="default" extends="struts-default">
	    <action name="user" class="com.it.action.LoginAction">
	       <result name="input">/Login.jsp</result>
	       <result name="error">/Login.jsp</result>
	    </action>
	</package>
</struts>

--
View this message in context: http://struts.1045723.n5.nabble.com/Struts2-tp5710145p5710153.html
Sent from the Struts - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts2

Posted by Takanori Hayashi <th...@na.rim.or.jp>.
Hello Avinash,

Confirm context root configuration and URL.

Could you show us the URL and the context.xml?


Takanori
(2012/07/03 17:34), Avinash wrote:
> Dear sir,
>             I have design the login page in struts2 framework and i am using
> tomcat7 in eclipse(indigo). The tomcat server perfectly run in the browser
> but after execution my program , that will show 404 error. So sir please
> guide me how to find the error and where it occured.
>
> --
> View this message in context: http://struts.1045723.n5.nabble.com/Struts2-tp5710145.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
>





---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org