Tutorial: Creating Struts application in Eclipse

      

Note: If you looking for tutorial “Create Struts2 Application in EclipseClick here.
In this tutorial we will create a hello world Struts application in Eclipse editor. First let us see what are the tools required to create our hello world Struts application.

  1. JDK 1.5 above (download)
  2. Tomcat 5.x above or any other container (Glassfish, JBoss, Websphere, Weblogic etc) (download)
  3. Eclipse 3.2.x above (download)
  4. Apache Struts JAR files:(download). Following are the list of JAR files required for this application.
    • struts.jar
    • common-logging.jar
    • common-beanutils.jar
    • common-collections.jar
    • common-digester.jar

We will implement a web application using Struts framework which will have a login screen. Once the user is authenticated, (s)he will be redirected to a welcome page.

Let us start with our first struts based web application.

Open Eclipse and goto File -> New -> Project and select Dynamic Web Project in the New Project wizard screen.

After selecting Dynamic Web Project, press Next.

Write the name of the project. For example StrutsHelloWorld. Once this is done, select the target runtime environment (e.g. Apache Tomcat v6.0). This is to run the project inside Eclipse environment. After this press Finish.

Once the project is created, you can see its structure in Project Explorer.

Now copy all the required JAR files in WebContent -> WEB-INF -> lib folder. Create this folder if it does not exists.

Next step is to create a servlet entry in web.xml which points to org.apache.struts.action.ActionServlet class of struts framework. Open web.xml file which is there under WEB-INF folder and copy paste following code.

<servlet>
		<servlet-name>action</servlet-name>
		<servlet-class>
			org.apache.struts.action.ActionServlet
		</servlet-class>
		<init-param>
			<param-name>config</param-name>
			<param-value>/WEB-INF/struts-config.xml</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
	<servlet-name>action</servlet-name>
	<url-pattern>*.do</url-pattern>
</servlet-mapping>

Here we have mapped url *.do with the ActionServlet, hence all the requests from *.do url will be routed to ActionServlet; which will handle the flow of Struts after that.

We will create package strutcures for your project source. Here we will create two packages, one for Action classes (net.viralpatel.struts.helloworld.action) and other for Form  beans(net.viralpatel.struts.helloworld.action).

Also create a class LoginForm in net.viralpatel.struts.helloworld.action with following content.

package net.viralpatel.struts.helloworld.form;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class LoginForm extends ActionForm {

	private String userName;
	private String password;

	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {

		ActionErrors actionErrors = new ActionErrors();

		if(userName == null || userName.trim().equals("")) {
			actionErrors.add("userName", new ActionMessage("error.username"));
		}
		try {
		if(password == null || password.trim().equals("")) {
			actionErrors.add("password", new ActionMessage("error.password"));
		}
		}catch(Exception e) {
			e.printStackTrace();
		}
		return actionErrors ;
	}

	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;
	}
}

LoginForm is a bean class which extends ActionForm class of struts framework. This class will have the string properties like userName and password and their getter and setter methods. This class will act as a bean and will help in carrying values too and fro from JSP to Action class.
Let us create an Action class that will handle the request and will process the authentication. Create a class named LoginAction in net.viralpatel.struts.helloworld.action package. Copy paste following code in LoginAction class.

package net.viralpatel.struts.helloworld.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import net.viralpatel.struts.helloworld.form.LoginForm;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

public class LoginAction extends Action {

	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		String target = null;
		LoginForm loginForm = (LoginForm)form; 

		if(loginForm.getUserName().equals("admin")
				&& loginForm.getPassword().equals("admin123")) {
			target = "success";
			request.setAttribute("message", loginForm.getPassword());
		}
		else {
			target = "failure";
		}

		return mapping.findForward(target);
	}
}

In action class, we have a method called execute() which will be called by struts framework when this action will gets called. The parameter passed to this method are ActionMapping, ActionForm, HttpServletRequest and HttpServletResponse. In execute() method we check if username equals admin and password is equal to admin123, user will be redirected to Welcome page. If username and password are not proper, then user will be redirected to login page again.

We will use the internationalization (i18n) support of struts to display text on our pages. Hence we will create a MessagesResources properties file which will contain all our text data. Create a folder resource under src (Right click on src and select New -> Source Folder). Now create a text file called MessageResource.properties under resources folder.

Copy the following content in your Upadate:struts-config.xml MessageResource.properties file.

label.username = Login Detail
label.password = Password
label.welcome = Welcome

error.username =Username is not entered.

Create two JSP files, index.jsp and welcome.jsp with the following content in your WebContent folder.

index.jsp

<%@taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Login page | Hello World Struts application in Eclipse</title>
	</head>
	<body>
	<h1>Login</h1>
	<html:form action="login">
		 <bean:message key="label.username" />
		 <html:text property="userName"></html:text>
		 <html:errors property="userName" />
		 <br/>
		 <bean:message key="label.password"/>
		<html:password property="password"></html:password>
		 <html:errors property="password"/>
		<html:submit/>
		<html:reset/>
	</html:form>
	</body>
</html>

welcome.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Welcome page | Hello World Struts application in Eclipse</title>
	</head>
	<body>
	<%
		String message = (String)request.getAttribute("message");
	%>
		<h1>Welcome <%= message %></h1>

	</body>
</html>

Now create a file called struts-config.xml in WEB-INF folder. Also note that in web.xml file we have passed an argument with name config to ActionServlet class with value /WEB-INF/struts-config.xml.

Following will be the content of struts-config.xml file:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<!DOCTYPE struts-config PUBLIC
          "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN"
          "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd">

<struts-config>
	<form-beans>
		<form-bean name="LoginForm"
			type="net.viralpatel.struts.helloworld.form.LoginForm" />
	</form-beans>

	<global-exceptions>
	</global-exceptions>
	<global-forwards></global-forwards>

	<action-mappings>
		<action path="/login" name="LoginForm" validate="true" input="/index.jsp"
			type="net.viralpatel.struts.helloworld.action.LoginAction">
			<forward name="success" path="/welcome.jsp" />
			<forward name="failure" path="/index.jsp" />
		</action>
	</action-mappings>

	<message-resources parameter="resource.MessageResource"></message-resources>

</struts-config>


And, that’s it :) .. We are done with our application and now its turn to run it. I hope you have already configured Tomcat in eclipse. If not then:

Open Server view from Windows -> Show View -> Server. Right click in this view and select New -> Server and add your server details.
To run the project, right click on Project name from Project Explorer and select Run as -> Run on Server (Shortcut: Alt+Shift+X, R)

Login Page

Welcome Page

Related: Create Struts 2 Application in Eclipse


Facebook  Twitter      Stumbleupon  Delicious
  

95 Comments on “Tutorial: Creating Struts application in Eclipse”

  • Aditi wrote on 4 December, 2008, 19:14

    Thanks Viral,
    The explanation and information is very apt.
    Very useful.

  • Veera wrote on 4 December, 2008, 21:01

    Informative post.

    Here’s a similar tutorial, but for the latest version of struts 2 – Create Struts 2 – Hello World Application

  • Zviki wrote on 5 December, 2008, 2:14

    If you’re (still) doing Struts, you should check out Oracle Workshop for WebLogic. It is the best Struts tool by far, includes many examples and can do much much more than Eclipse WTP. It is not WebLogic specific. And, it’s free.

    Check out my post about it:
    http://blog.zvikico.com/2008/08/the-best-jspstrutsjsf-development-tool-is-now-free.html

  • Viral Patel wrote on 5 December, 2008, 11:45

    @Veera : Nice to see your Struts-2 tutorial. You will see more tutorials on similar line here on viralpatel.net

    @Zviki : Thanks for your comment. Will definitely check Oracle Workshop for WebLogic.

  • tabrez wrote on 9 December, 2008, 14:42

    Nice tutorial, good job :)

    @Zviki I suggest having a look at IntelliJ IDEA’s support for Struts 2, in my opinion it is one of the best. It’s not free, though.

  • chn wrote on 15 December, 2008, 21:38

    hi did anyone try this with WASCE server? iam doing in it and evrything looks fine except that when i clikc on submit it says that the resource/login is not found..

    any ideas pls help

  • kingshri wrote on 25 December, 2008, 13:54

    I am getting this exception while deploying this …. Can anyone help?

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:91)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:107)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:81)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • teena wrote on 30 December, 2008, 17:41

    its very useful for beginners

  • mayank wrote on 7 January, 2009, 18:14

    i am getting this exception ..

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 12

    9:
    10: Login
    11:
    12:
    13:
    14:
    15:

    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:524)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:417)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
    org.apache.jsp.index_jsp._jspx_meth_bean_005fmessage_005f0(index_jsp.java:174)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:118)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.14 logs.

    many thanks
    mayank

  • Vivek wrote on 19 January, 2009, 11:24

    Copy the following content in your struts-config.xml file.

    label.username = Login Detail
    label.password = Password
    label.welcome = Welcome
    error.username =Username is not entered.

    did u mean that paste the above content in MessageResource.properties file? or struts-config.xml file?

  • Viral wrote on 19 January, 2009, 12:05

    Thanks Vivek,
    I have updated the error in post.
    You need to copy this in MessageResource.properties file.

    Thanks again.

  • yogita wrote on 25 January, 2009, 19:37

    Hi
    I am getting following error please help…
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:712)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:500)
    at org.apache.jsp.index_jsp._jspx_meth_html_form_0(org.apache.jsp.index_jsp:132)
    at org.apache.jsp.index_jsp._jspx_meth_html_html_0(org.apache.jsp.index_jsp:108)
    at org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:75)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Unknown Source)

  • Jwalant wrote on 1 February, 2009, 12:27

    Hi,

    I am getting Error 404–Not Found From RFC 2068 Hypertext Transfer Protocol — HTTP/1.1:
    10.4.5 404 Not Found . I have double checked web.xml and struts-config.xml. I would appreicate, if anyone can help me.

  • gribo wrote on 5 February, 2009, 18:17

    You should have take the time to make this tutorial with the latest version of struts 1 : v1.3.10
    The version 1.2, on which is based this tutorial, has been released for more than 4 years ! The branch 1.3 which split struts.jar into multiple modules has been release in two years !

  • Sample wrote on 11 February, 2009, 4:58

    Excellent Material for the Beginners.
    Follow the steps carefully, it should definitely work.

    Thanks
    Sample

  • FrEE wrote on 17 February, 2009, 12:54

    Hi,

    There is anice tutorial on how to use Struts2, a basic example at

    http://www.interview-questions-tips-forum.net/index.php/Apache-Struts/Struts2-example-tutorial/My-First-example-using-Apache-Struts2

  • jimish wrote on 20 February, 2009, 16:17

    hai,,this ,,gr8,,,,help to intoduce the struts application

  • Jessiee wrote on 21 February, 2009, 19:17

    I m not able to find jar files u mentioned above.Can u provide me the exact path..

  • Karthic R Raghupathi wrote on 23 February, 2009, 19:43

    Greetings!

    I found your post very educating. This is the first sample struts application I created using eclipse.

    However, I kept getting the error saying the message was not found in the key bundle.

    I tried many things but I got the same error. Finally I modified the entry in the struts-config.xml to
    from what you mentioned. It did the trick.

    I’m using struts 1.3, jdk 6 and eclipse ganymede.. hope that helps.

  • Baran wrote on 2 March, 2009, 14:20

    Hello There,

    I am fairly new to Struts, I was wondering if anyone can post or preferably mail me some materila about how to handle database connectivity in Struts. I am working on JNDI but I guess this won\\\’t be helpful if I have a shared apache tomcat server as that won\\\’t let me access the server.xml file.

    my id is baran.khan @ gmail.com

  • Payal wrote on 19 March, 2009, 10:49

    I am preety new to struts. I want to know how to remove the error Missing message for key \"label.username\"? I have created a package name resource in src and created a file in it with the name MessageResource.properties. What changes i need to make in my struts-config.xml?

  • Viral Patel wrote on 19 March, 2009, 11:20

    Hi Payal,
    I am not sure if I got your problem. What I understand is that you want to remove the error messages generated from keys that are missing in your bundle MessageResource file. If this is the case then you can use null attribute in <message-resources> tag in struts-config.xml file.

    
    

    null attribute will control the messages, If true, references to non existing messages results in null and If false, references to non existing messages result in warning message like
    ???KeyName???
    Hope this will solve your query.

  • Davinchi wrote on 19 March, 2009, 11:31

    Hey thanks for this great tut!!

    But, I was having the same error “Missing message for key “label.username” and I moved the file MessageResource to the folder WEB-INF->classes->resource. That did the trick.

    Can you explain why tis happened? Thanks again mate!

  • Viral Patel wrote on 19 March, 2009, 12:36

    While providing the parameter attribute in <message-resource> tag we provide it as parameter=”resource.MessageResource”. Thus in this case, struts expects the MessageResource.properties file under resource folder. But if you have provided parameter=”MessageResource” then that means your MessageResource properties file is directly under classes folder.

  • grace wrote on 23 March, 2009, 8:20

    Could anyone help me to solve the following error? I have checked the struts-config and web.xml . But I cannot find the error.please…
    ,Grace

    The server encountered an internal error () that prevented it from fulfilling this request.

    javax.servlet.ServletException: Exception creating bean of class net.viralpatel.struts.helloworld.form.LoginForm: {1}
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:91)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

    javax.servlet.jsp.JspException: Exception creating bean of class net.viralpatel.struts.helloworld.form.LoginForm: {1}
    org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:563)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:520)
    org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:107)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:81)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

  • Geek wrote on 25 March, 2009, 12:45

    Hi..

    To make this tutorial work:

    1. also add servlet-api.jar.
    2. make sure struts-config.xml is in web-inf folder or the folder u have specified in web.xml
    3. make sure the messageresource file is in web-inf/classes folder.
    4. Change the following line in LoginAction.java from
    request.setAttribute(\"message\", loginForm.getPassword());
    To
    request.setAttribute(\"message\", loginForm.getUserName());

    Kiran

  • sachin wrote on 9 April, 2009, 21:25

    I have done everything as told here.I am using SDE 3.1 and I am getting this exception on runing the application.Can anyone help?

    SEVERE: Servlet.service() for servlet jsp threw exception
    org.apache.jasper.JasperException: The absolute uri: http://jakarta.apache.org/struts/tags-html cannot be resolved in either web.xml or the jar files deployed with this application
    at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
    at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
    at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:114)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:316)
    at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
    at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:423)
    at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
    at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1552)
    at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
    at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:211)
    at org.apache.jasper.compiler.ParserController.parse(ParserController.java:100)
    at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:155)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)

  • Sarwo Edi wrote on 7 May, 2009, 11:28

    help me,
    I am beginner programmer, I got exception in ur tutorial as this

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:13

    10: <body>
    11: <h1>Login</h1>
    12: <html:form action=\"login\">
    13: <bean:message key=\"label.username\" />
    14: <html:text property=\"userName\"></html:text>
    15: <html:errors property=\"userName\"/>
    16: <br/>

    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    root cause

    javax.servlet.ServletException: Missing message for key \"label.username\"
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:89)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    root cause

    javax.servlet.jsp.JspException: Missing message for key \"label.username\"
    org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
    org.apache.jsp.index_jsp._jspx_meth_bean_005fmessage_005f0(index_jsp.java:166)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:110)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:79)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.

    ——————————————————————————–

    Apache Tomcat/5.5.27

    please help me

  • Sarwo Edi wrote on 7 May, 2009, 11:40

    I already copy
    label.username = Login Detail
    label.password = Password
    label.welcome = Welcome
    error.username =Username is not entered.

    to the resource folder, but the exception still occured….

    please help me

  • Sarwo Edi wrote on 7 May, 2009, 16:16

    hey, thanks very much..
    finally I can solve it…

  • Viral Patel wrote on 7 May, 2009, 21:08

    @sarwo edi: nice to see that your problem got solved :) by the way. where was the problem exactly? I guess your properties file was not getting referred properly?

  • Sarwo Edi wrote on 11 May, 2009, 12:31

    yeah, in struts-config, I only type <message-resources parameter=\"MessageResource\" null=\"true\"/>, it make its true…

    btw, any another eclipse tutorial?
    I want to be a good java programmer as you do..

    txh

  • adm wrote on 28 May, 2009, 16:58

    <message-resources parameter=\"resource.MessageResource\"></message-resources>
    should be

    <message-resources parameter=\"MessageResource\"></message-resources>

  • noufendar wrote on 29 May, 2009, 14:43

    Muchas gracias!!! a Viral por el tutorial y también a Davinchi porque dió la solución al mismo problema que tenía yo!!!!

    Davinchi wrote on 19 March, 2009, 11:31
    Hey thanks for this great tut!!

    But, I was having the same error “Missing message for key “label.username” and I moved the file MessageResource to the folder WEB-INF->classes->resource. That did the trick.

    Can you explain why tis happened? Thanks again mate!

  • Pankaj wrote on 5 June, 2009, 10:40

    I have followed ur tutorial

    i am getting error

    VERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    at org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:115)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:88)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Unknown Source)
    Jun 5, 2009 10:43:41 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    at org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:115)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:88)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:212)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:818)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:624)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
    at java.lang.Thread.run(Unknown Source)

    can you tell me what can be cause of this.

  • StrutsNewbie wrote on 8 June, 2009, 8:02

    Hi~

    I have modified the line
    <message-resources parameter=\\\"resource.MessageResource\\\"></message-resources>
    to
    <message-resources parameter=\\\"MessageResource\\\"></message-resources>

    And I have followed all the instructions, I am now using Struts 1.3.10, but I got \"HTTP Status 404\" error,

    \"The requested resource (/StrutsHelloWorld/) is not available.\"

    Anyone may help? Thx!

  • StrutsNewbie wrote on 8 June, 2009, 8:07

    More description abt my problem,

    In Eclipse I got the following URI underlined in red!

    \\&quot;&lt;%@taglib uri=\\&quot;http://jakarta.apache.org/struts/tags-html\\&quot; prefix=\\&quot;html\\&quot;%&gt;
    &lt;%@taglib uri=\\&quot;http://jakarta.apache.org/struts/tags-bean\\&quot; prefix=\\&quot;bean\\&quot; %&gt; \\&quot;

    Eclipse says \\&quot;cannot find tag library descriptor\\&quot;

    How should I modify the \\&quot;uri\\&quot;? Thx so much!

  • Sandhya wrote on 12 June, 2009, 10:47

    Can any one help me…..

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Exception creating bean of class com.jamesholmes.minihr.SearchForm under form name searchForm
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    root cause

    javax.servlet.ServletException: Exception creating bean of class com.jamesholmes.minihr.SearchForm under form name searchForm
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:841)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
    org.apache.jsp.search_jsp._jspService(search_jsp.java:230)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    root cause

    javax.servlet.jsp.JspException: Exception creating bean of class com.jamesholmes.minihr.SearchForm under form name searchForm
    org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:536)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:503)
    org.apache.jsp.search_jsp._jspx_meth_html_005fform_005f0(search_jsp.java:263)
    org.apache.jsp.search_jsp._jspService(search_jsp.java:101)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.27 logs.

  • sushma wrote on 18 June, 2009, 23:22

    can anyone help, i got the following exception while executing

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Module ‘null’ not found.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:460)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

    root cause

    java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:743)
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:723)
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:742)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:417)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:105)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:79)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

  • Prince wrote on 13 July, 2009, 2:57

    Can you help on this error, it’s related to the tag libs which I’m still struggling to understand. the URI cannot be resolved.
    Also eclipse shows warning “unknown tags” for entire index.jsp page

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: The absolute uri: http://jakarta.apache.org/struts/tags-html cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:429)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:492)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1439)
    org.apache.jasper.compiler.Parser.parse(Parser.java:137)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:170)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

  • Manoj wrote on 18 July, 2009, 17:22

    Hi.

    To make this tutorial work then follow these steps:

    1. also inlcude servlet-api.jar in lib folder.
    2. make sure struts-config.xml is in web-inf folder or the folder u have specified in web.xml
    3. make sure the MessageResource.properties file is in web-inf/classes/resource folder.
    4. Change the following line in LoginAction.java from
    request.setAttribute("message", loginForm.getPassword());
    To
    request.setAttribute("message", loginForm.getUserName());
    Change the following line in struts-config.xml
    from
    <message-resources parameter="resource.MessageResource"></message-resources>
    To
    <message-resources parameter="resource.MessageResource" null="true"></message-resources>

    i have make these changes and example working successfully.

  • Salma wrote on 21 July, 2009, 16:20

    Hello EveryBody ,
    i tried to follow this tutorial but in My index.jsp my taglibs (bean and html) are unknown :(.
    could you help?
    thanx

  • Viral Patel wrote on 21 July, 2009, 17:11

    Hi Salma,
    The error you are getting is due to the difference in the struts jar file. Check which version of jar you using and add the appropriate taglib paths in your jsp. For example try following URIs in the path of taglib.
    http://struts.apache.org/tags-html
    http://struts.apache.org/tags-bean

  • Manoj wrote on 24 July, 2009, 19:14

    Hi Viral,
    I need help ,Regarding Connection with Struts-1.3.8 with MySql i am stuck to compile my struts test application .in Struts-Config.xml tag not recognized. when i put block of code like exactly this

    A red circle is appear in eclipe id.
    Can you tell me what config. need
    antlr-2.7.2.jar,commons-beanutils-1.7.0.jar,commons-chain-1.1.jar,commons-dbcp-1.2.2.jar
    commons-digester-1.8.jar,commons-logging-1.0.4.jar,commons-pool-1.4.jar,commons-resources.jar,commons-validator-1.3.1.jar,jdbc2_0-stdext.jar,mysql-connector-java-5.0.8-bin.jar,oro-2.0.8.jar,servlet-api.jar,struts-core-1.3.8.jar,struts-taglib-1.3.8.jar,struts-tiles-1.3.8.jar,tools.jar in my lib folder.

  • robert wrote on 24 July, 2009, 19:52

    Gracias por el manual muy bueno
    Encontre la solucion al problema:

    1. create packge: net.viralpatel.struts.helloworld.form.Util
    2. dentro package poner el archivo MessageResource.properties
    3. Change the following line in struts-config.xml
    from
    <message-resources parameter=\"resource.MessageResource\"></message-resources>
    To
    <message-resources parameter=\"net.viralpatel.struts.helloworld.form.Util.MessageResource\"></message-resources>

  • Dev wrote on 30 July, 2009, 13:59

    Hi All,

    I’m getting the following error report. KINDLY HELP!!

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:118)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:91)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

    ——————————————————————————–

    Apache Tomcat/6.0.20

  • Kirthika wrote on 29 August, 2009, 3:18

    hai viral
    i am getting a struts 500 error please help me to decode this error

  • Ritesh wrote on 31 August, 2009, 11:05

    Hey Viral

    Was a nice and short guide, very helpful

    Thanks a lot !!!

  • Venkat wrote on 2 September, 2009, 10:15

    Hi Virpal,

    Am getting a diffrent kind of error :Several ports (8005, 8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop the other process or change the port number(s).

    I have stopped all the services and only one port num is using at a time..

    Can you please help me in this regard.

  • Amit Chaudhary wrote on 18 September, 2009, 5:12

    Hi I do all the same procedure. I am using struts2.1.6. When I ran the application I successfully see the index.jsp page. But when I enter admin as username and admin123 as password I got error.
    HTTP Status 404 – /StrutsHelloWorld/Welcome.jsp

    ——————————————————————————–

    type Status report

    message /StrutsHelloWorld/Welcome.jsp

    description The requested resource (/StrutsHelloWorld/Welcome.jsp) is not available.

    ——————————————————————————–

    Apache Tomcat/6.0.20

    Please help me.

  • Amit Chaudhary wrote on 18 September, 2009, 5:33

    Hi All
    HTTP Status 404 – /StrutsHelloWorld/Welcome.jsp has been resolved.

    In the struts.config file please change this line

    to

    We have made welcome.jsp instead of Welcome.jsp.

    Thanks
    Viral for the nice basic application.

  • Marie wrote on 20 September, 2009, 7:35

    Hi, I did this tutorial with:
    - Eclipse Galileo
    - struts-2.1.6
    - Tomcat 6.0
    and I getting a error in index.jsp in tablib declarations

    Error:
    Can not find tag library descriptor for “http:://jakarta.apache.org/struts/tags-html”

    Please help me

  • mortsahl wrote on 29 September, 2009, 20:28

    Struts 2 is very different from Struts 1. You must use a version of Struts 1.2.x for the tutorial to work (no, 1.3.x won’t work either). Also, make sure you change Welcome.jsp to welcome.jsp in strut-config.xml once you get it working with Struts 1.2.x or else you’ll get a 404 error.

  • Srinivas wrote on 6 October, 2009, 17:06

    Thank you very much, your way of approach is very good, i didn’t find anywhere like this.
    The given screen are very useful. Since 15days i am searching this type of tutorial. Luckly today I find this and executed successfuly.

  • Yesho wrote on 12 October, 2009, 15:32

    Very helpful!!!

  • sue wrote on 22 October, 2009, 3:10

    i have the same problem with Venkat.
    How can i solve this? Help us please

  • Viral Patel wrote on 22 October, 2009, 16:50

    Hi Sue, It may be possible that an instance of Tomcat is already running when you are trying to run it from Eclipse. Try to change few port numbers in server.xml file and see if the problem gets resolved.
    To know which ports to change see this article: Running multiple tomcat instances

  • sue wrote on 22 October, 2009, 22:50

    Hİ Viral!
    i examined your link,but at my machine only one tomcat is set now, fistly i used a different tomcat version,but i uninstalled it, what must i do about it? help please..thankss..

  • Kumar wrote on 28 October, 2009, 14:21

    I have found the solution for below error ,

    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    at org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:798)
    at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:506)
    at org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:115)
    at org.apache.jsp.index_jsp._jspService(index_jsp.java:88)

    solution:Add commons-digester.jar to WEB-INF/ lib folder

  • Stephen Hathorne wrote on 1 November, 2009, 1:51

    Hello-

    I got the following exception stack trace:
    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:113)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

    ——————————————————————————–

    Apache Tomcat/6.0.20

    I have made the adjustment to the struts-config.xml file in WEB-INF:

    Please Help.

    Stephen

  • Namrata wrote on 9 November, 2009, 11:56

    Hi,
    Initially I encountered the same problem as many i.e my taglibs were not getting identified in the index.jsp file. I was using the struts2 jar files. I removed them and used the 1.2.7 version jar files and now the error message is different. It still gives a red-mark for the taglib uri in index.jsp but the error is like

    exception

    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
    org.apache.jsp.index_jsp._jspx_meth_bean_005fmessage_005f0(index_jsp.java:174)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:118)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    I am guessing all this has got to do with the taglib. The url u mentioned http://jakarta.apache.org/tags-html doesnot exist. Even when I use it on d browser, it says not found. Kindly help!!!

  • Namrata wrote on 9 November, 2009, 15:55

    Hey,
    I changed the path of the jar files and made it point to .tld files which solved the earlier problem. But, a new error has come.

    org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 12

    9:
    10: Login
    11:
    12:
    13:
    14:
    15:

    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:102)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    root cause

    javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
    org.apache.jsp.index_jsp._jspx_meth_bean_005fmessage_005f0(index_jsp.java:180)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:124)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:92)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

    The bean:message thing is causing the error. I am lost here. Kindly help!

  • Viral Patel wrote on 9 November, 2009, 16:30

    @Namrata, I can see the stacktrace is complaining about Missing message for key “label.username”. Can you check if your message properties file is included properly and it contains label.username key?

  • T. Santana wrote on 13 November, 2009, 1:25

    Hello,

    Pretty good article. I have followed it thru step by step but am getting the same error as Stephen Hathorne and Dev:

    exception

    org.apache.jasper.JasperException: java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:416)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    java.lang.NullPointerException: Module ‘null’ not found.
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:755)
    org.apache.struts.taglib.TagUtils.getModuleConfig(TagUtils.java:735)
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:818)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:488)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:113)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    @Viral,

    Will you help us out?

    Thanks much,
    TS

  • yan wrote on 26 November, 2009, 12:50

    i have try this tutorial, but still found this exception
    i’m using struts 2.1.8 and i’m newbie in struts

    thank’s for your help…

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:233)
    org.apache.jsp.index_jsp._jspx_meth_bean_005fmessage_005f0(index_jsp.java:175)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:118)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.18 logs.

    ——————————————————————————–

    Apache Tomcat/6.0.18

  • deepthi wrote on 2 December, 2009, 18:34

    nice tutorial
    but i am getting same error as amit
    index.jsp is not available.
    can any one give me a solution.

  • Viral Patel wrote on 3 December, 2009, 16:14

    @deepti, @amit: There was a small error in struts-config.xml file. I have changed the Welcome.jsp to welcome.jsp. Thanks for pointing out the error.

  • manikam wrote on 14 December, 2009, 16:05

    I canot set up the envirnment.After starting the server i got the exception like below mentioned.

    Dec 14, 2009 4:25:20 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
    WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ’source’ to ‘org.eclipse.jst.jee.server:StrutsHelloWorld’ did not find a matching property.
    Dec 14, 2009 4:25:20 PM org.apache.catalina.core.AprLifecycleListener init
    INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre1.5.0_07\bin;.;C:\WINDOWS\system32;C:\WINDOWS;C:/Program Files/Java/jre1.5.0_07/bin/client;C:/Program Files/Java/jre1.5.0_07/bin;C:\Program Files\Java\jre1.5.0_07\bin;D:\oracle\product\10.1.0\db_1\bin;D:\oracle\product\10.1.0\db_1\jre\1.4.2\bin\client;C:\Program Files\Ant\apache-ant\bin;
    Dec 14, 2009 4:25:20 PM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8090
    Dec 14, 2009 4:25:20 PM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 1371 ms
    Dec 14, 2009 4:25:20 PM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Dec 14, 2009 4:25:20 PM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/6.0.20
    Dec 14, 2009 4:25:21 PM org.apache.struts.util.PropertyMessageResources
    INFO: Initializing, config=’org.apache.struts.util.LocalStrings’, returnNull=true
    Dec 14, 2009 4:25:21 PM org.apache.struts.util.PropertyMessageResources
    INFO: Initializing, config=’org.apache.struts.action.ActionResources’, returnNull=true
    Dec 14, 2009 4:25:24 PM org.apache.struts.util.PropertyMessageResources
    INFO: Initializing, config=’resource.MessageResource’, returnNull=true
    Dec 14, 2009 4:25:24 PM org.apache.coyote.http11.Http11Protocol start
    INFO: Starting Coyote HTTP/1.1 on http-8090
    Dec 14, 2009 4:25:25 PM org.apache.jk.common.ChannelSocket init
    INFO: JK: ajp13 listening on /0.0.0.0:8010
    Dec 14, 2009 4:25:25 PM org.apache.jk.server.JkMain start
    INFO: Jk running ID=0 time=0/96 config=null
    Dec 14, 2009 4:25:25 PM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4734 ms

  • manikam wrote on 14 December, 2009, 16:06

    Plz help me to resolve this issue.Thanks

  • Abhishek wrote on 15 December, 2009, 22:18

    I am getting the error mentioned below.No class file is getting generated for the JSP.Please ressolve

    org.apache.jasper.JasperException: Unable to compile class for JSP

    No Java compiler was found to compile the generated source for the JSP.
    This can usually be solved by copying manually $JAVA_HOME/lib/tools.jar from the JDK
    to the common/lib directory of the Tomcat server, followed by a Tomcat restart.
    If using an alternate Java compiler, please check its installation and access path.

    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
    org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • gimelit wrote on 16 December, 2009, 13:41

    Excellent tutorial for total beginners like me. Thanks!

  • Abhishek wrote on 16 December, 2009, 22:08

    “Now this EXCEPTION is coming”

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: The absolute uri: http://jakarta.apache.org/struts/tags-html cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:94)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:404)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:154)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:359)
    org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:190)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:458)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:523)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1577)
    org.apache.jasper.compiler.Parser.parse(Parser.java:171)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:258)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:139)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:237)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:456)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

  • Abhishek wrote on 16 December, 2009, 22:17

    I changed the properties of struts-config as

    even its not working:(

  • Bala wrote on 6 January, 2010, 13:39

    thanks !!Very good informative tutorial

  • manasa wrote on 28 January, 2010, 14:55

    hi
    i found all ur articles very easy and simple to understand
    its tooo good
    thank u:-)

  • rama wrote on 1 February, 2010, 15:26

    Hi,this tutorial is very helpul 4 me
    Thanks

  • Anna wrote on 13 February, 2010, 2:18

    Hey
    I am getting error o jsp pages for taglibs
    I am tottally new to struts and am trying to learn . Is that url http://jakarta.apache.org/struts/tags-html valid? 404 not found is coming.

    Can somebody please explain. I am stuck at this.

  • Pavel Vinogradov wrote on 19 February, 2010, 13:12

    @Anna: Change taglib definitions to:

    This work fine for me.

  • vass wrote on 23 February, 2010, 14:39

    hi i have problem in index.jsp at line plz any help me..

  • vass wrote on 23 February, 2010, 14:40

    at line here..

  • Bun wrote on 28 February, 2010, 8:57

    Solved this issue ‘Missing message for key “label.username”

    in Struts-config.xml
    use this one ”
    instead of ”

  • Manasa wrote on 3 March, 2010, 6:01

    @Bun: How did u solve the issue “Missing message for key “label.username”… If anyone else knows plz do let me know…

    Thanks in advance…

  • Sandip wrote on 4 March, 2010, 12:51

    i am computer engineering student.
    I know about struts,but i can’t work in struts.
    In my final sem. project i will use struts framework,
    so, please ,give me link or tutorial & any thing related to struts in my mailid.
    Thank you.

  • Anil wrote on 4 March, 2010, 16:53

    getting following error

    org.apache.jasper.JasperException: javax.servlet.ServletException: javax.servlet.jsp.JspException: Missing message for key “label.username”
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:522)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)

  • lokesh wrote on 5 March, 2010, 16:24

    I am getting HTTP Status 500 –
    type Exception report
    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:91)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    root cause

    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:747)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
    org.apache.jsp.index_jsp._jspx_meth_html_form_0(index_jsp.java:106)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:81)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

    somebody help me .

  • Beginner wrote on 7 March, 2010, 22:08

    exception

    org.apache.jasper.JasperException: The absolute uri: http://jakarta.apache.org/struts/tags-html cannot be resolved in either web.xml or the jar files deployed with this application
    org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
    org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
    org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
    org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:315)
    org.apache.jasper.compiler.TagLibraryInfoImpl.(TagLibraryInfoImpl.java:148)
    org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:382)
    org.apache.jasper.compiler.Parser.parseDirective(Parser.java:445)
    org.apache.jasper.compiler.Parser.parseElements(Parser.java:1392)
    org.apache.jasper.compiler.Parser.parse(Parser.java:130)
    org.apache.jasper.compiler.ParserController.doParse(ParserController.java:255)
    org.apache.jasper.compiler.ParserController.parse(ParserController.java:103)
    org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:170)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:332)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.24 logs.

    PLEASE HELP. How to solve this problem?

  • karthik wrote on 10 March, 2010, 10:06

    HTTP Status 500 –

    ——————————————————————————–

    type Exception report

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

    root cause

    javax.servlet.ServletException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:858)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:203)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

    root cause

    javax.servlet.jsp.JspException: Cannot find ActionMappings or ActionFormBeans collection
    org.apache.struts.taglib.html.FormTag.lookup(FormTag.java:747)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:443)
    org.apache.jsp.index_jsp._jspx_meth_c_form_0(index_jsp.java:220)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:159)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:368)

    note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

    please help me i am recieving this when i am using structs i cross checked structs.config file many times

  • Eugene wrote on 10 March, 2010, 10:11

    In the LoginAction.java the statement should be as followed:

    package net.vitalpatel.struts.helloworld.form;

    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import net.vitalpatel.struts.helloworld.action.LoginForm;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;

    continued by the rest of the code.

  • Eugene wrote on 10 March, 2010, 10:20

    I am getting the following error:

    message

    description The server encountered an internal error () that prevented it from fulfilling this request.

    exception

    org.apache.jasper.JasperException: An exception occurred processing JSP page /index.jsp at line 11

    8:
    9:
    10: Login
    11:
    12:
    13:
    14:

    Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:505)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:398)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    javax.servlet.ServletException: javax.servlet.jsp.JspException: Exception creating bean of class net.vitalpatel.struts.helloworld.form.LoginForm: {1}
    org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:862)
    org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:791)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:96)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    root cause

    javax.servlet.jsp.JspException: Exception creating bean of class net.vitalpatel.struts.helloworld.form.LoginForm: {1}
    org.apache.struts.taglib.html.FormTag.initFormBean(FormTag.java:487)
    org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:457)
    org.apache.jsp.index_jsp._jspx_meth_html_005fform_005f0(index_jsp.java:113)
    org.apache.jsp.index_jsp._jspService(index_jsp.java:86)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.20 logs.

  • Anshul wrote on 12 March, 2010, 23:14

    Hi! could u tell me hw can i validate values in the fields wid the database and if not matched appropriate error message must b displayed in conjunction wid the struts validation franework?

Trackbacks

  1. Struts Tiles plugin example in Eclipse | viralpatel.net
  2. Tutorial:Struts Spring framework example in Eclipse | viralpatel.net
  3. Struts File Upload | Struts File Upload Tutorial | Example | File Upload Struts | viralpatel.net
  4. Struts Dispatch Action tutorial,Struts DispatchAction example, DispatchAction tutorial
  5. Struts Validation Framework tutorial & example.Form Validator struts tutorial.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!

Copyright © 2010 ViralPatel.net. All rights reserved.