This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes The server does not support version 3.0 of the J2EE Web module specification Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "The server does not support version 3.0 of the J2EE Web module specification" Watch "The server does not support version 3.0 of the J2EE Web module specification" New topic
Author

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

phooton misra
Ranch Hand

Joined: Jul 31, 2012
Posts: 40

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

Joined: Mar 28, 2012
Posts: 860

Which server?

You really need to give us some more information.

WP
phooton misra
Ranch Hand

Joined: Jul 31, 2012
Posts: 40

hi William

i am using tomcat6.0.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: The server does not support version 3.0 of the J2EE Web module specification
 
Similar Threads
unable to get the values in action class
Once more: javax.servlet.jsp.JspException: Cannot find bean
interceptor not working in struts 2
unable to get the values in action class ,passed in jsp page,which was stored in the bean ?
struts 2 validator problem