• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The server does not support version 3.0 of the J2EE Web module specification

 
phooton misra
Ranch Hand
Posts: 52
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The server does not support version 3.0 of the J2EE Web module specification


The server does not support version 3.0 of the J2EE Web module specification

the above message is displaying when i tried to run the following application in struts?

index.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">
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<body>
<html:form action="/Login.do">
<html:errors/>
<bean:message key="label.common.name" />
<html:text property="txtNum1"></html:text>
<html:errors/>
<html:text property="txtNum2"></html:text>
<html:submit></html:submit>
</html:form>
</body>

</html>
-----------------------------------------------------------

Result.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">

<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<html>
<body>
<bean:write name="LoginBean" property="txtNum3"/>
</body>
</html>


-----------------------------------------------------------------
struts-config.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.3//EN"
"http://struts.apache.org/dtds/struts-config_1_3.dtd">

<struts-config>

<form-beans>
<form-bean name="LoginBean" type ="com.model.LoginModel"/>
</form-beans>

<global-forwards>
<forward name="Login" path="/Login.do" />
</global-forwards>

<action-mappings>

<action path="/Login" name="LoginBean" type="com.action.LoginAction" scope="session" input="/index.jsp" validate="true">
<forward name="success" path="/Result.jsp" />

</action>

</action-mappings>

<message-resources
parameter="com.properties.Common" />

</struts-config>

___________________________________________________________________________________
LoginAction

package com.action;

import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

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

import com.model.*;
/**
* Servlet implementation class LoginAction
*/
public class LoginAction extends Action implements Servlet {

/**
* @see Action#Action()
*/
public LoginAction() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init(ServletConfig config) throws ServletException {
// TODO Auto-generated method stub
}

/**
* @see Servlet#destroy()
*/
public void destroy() {
// TODO Auto-generated method stub
}

/**
* @see Servlet#getServletConfig()
*/
public ServletConfig getServletConfig() {
// TODO Auto-generated method stub
return null;
}

/**
* @see Servlet#getServletInfo()
*/
public String getServletInfo() {
// TODO Auto-generated method stub
return null;
}

/**
* @see Servlet#service(ServletRequest request, ServletResponse response)
*/
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}

@Override
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
// TODO Auto-generated method stub



LoginModel loginModel=(LoginModel)form;
loginModel.setTxtNum3((Integer.parseInt(loginModel.getTxtNum1())+Integer.parseInt(loginModel.getTxtNum2().toString()))+"");


return mapping.findForward("success");
}

}

_______________________________________________________________________________________________

Loginmodel

package com.model;

import java.io.IOException;
import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
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;

/**
* Servlet implementation class LoginModel
*/

public class LoginModel extends ActionForm implements Servlet {

/**
*
*/



String txtNum1,txtNum2,txtNum3;











public String getTxtNum1() {
return txtNum1;
}

public void setTxtNum1(String txtNum1) {
this.txtNum1 = txtNum1;
}

public String getTxtNum2() {
return txtNum2;
}

public void setTxtNum2(String txtNum2) {
this.txtNum2 = txtNum2;
}

public String getTxtNum3() {
return txtNum3;
}

public void setTxtNum3(String txtNum3) {
this.txtNum3 = txtNum3;
}

private static final long serialVersionUID = 1L;

/**
* @see ActionForm#ActionForm()
*/
public LoginModel() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see Servlet#init(ServletConfig)
*/
public void init(ServletConfig config) throws ServletException {
// TODO Auto-generated method stub
}

/**
* @see Servlet#destroy()
*/
public void destroy() {
// TODO Auto-generated method stub
}

/**
* @see Servlet#getServletConfig()
*/
public ServletConfig getServletConfig() {
// TODO Auto-generated method stub
return null;
}

/**
* @see Servlet#getServletInfo()
*/
public String getServletInfo() {
// TODO Auto-generated method stub
return null;
}

/**
* @see Servlet#service(ServletRequest request, ServletResponse response)
*/
public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
}

@Override
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub


ActionErrors errors=new ActionErrors();
if((getTxtNum1()==null)||"".equals(getTxtNum1()))
{
errors.add("common.name.err",new ActionMessage("error.common.name.required"));

}
else if((getTxtNum2()==null)||"".equals(getTxtNum2()))
{

errors.add("common.name.err",new ActionMessage("error.common.name.required"));
}


return errors;
}

}









 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which server?

You really need to give us some more information.

WP
 
phooton misra
Ranch Hand
Posts: 52
Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi William

i am using tomcat6.0.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic