I am having some issues running a Struts web app since few days. I tried several solutions from StackOverflow relating to my problem but none of them works.
web.xml:
<display-name>Struts2 Application</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>
struts.xml:
<struts>
<constant name="struts.enable.DynamicMethodInvocation"
value="false" />
<constant name="struts.devMode" value="false" />
<constant name="struts.custom.i18n.resources"
value="ApplicationResources" />
<package name="default" extends="struts-default" namespace="/">
<action name="login"
class="net.viralpatel.struts2.LoginAction">
<result name="success">Welcome.jsp</result>
<result name="error">Login.jsp</result>
</action>
</package>
</struts>
Login.jsp:
<%# page contentType="text/html; charset=UTF-8"%>
<%# taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<title>Struts 2 - Login Application | ViralPatel.net</title>
</head>
<body>
<h2>Struts 2 - Login Application</h2>
<s:actionerror />
<s:form action="login.action" method="post">
<s:textfield name="username" key="label.username" size="20" />
<s:password name="password" key="label.password" size="20" />
<s:submit method="execute" key="label.login" align="center" />
</s:form>
</body>
</html>
LoginAction.java:
package net.viralpatel.struts2;
public class LoginAction {
private String username;
private String password;
public String execute() {
if (this.username.equals("admin")
&& this.password.equals("admin123")) {
return "success";
} else {
return "error";
}
}
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;
}
}
Libs I have added:
commons-logging-1.1.3.jar
freemarker-2.3.19.jar
ognl-3.0.6.jar
struts2-core-2.3.15.1.jar
xwork-core-2.3.15.1.jar
Error accessing URL:
http://localhost:8080/StrutsHelloWorld/
HTTP Status 404 - /StrutsHelloWorld/
type Status report
message /StrutsHelloWorld/
description The requested resource is not available.
Apache Tomcat/7.0.42
I tried this tutorial.
There are no errors on my console, problem view.
The error 404 means that resource you have requested is not available, the same referred to the action that is didn't map to the request URL.
FilterDispatcher is deprecated and may not work with the current Struts version, use StrutsPrepareAndExcecuteFilter instead.
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
in the struts.xml add the following
<package name="default" extends="struts-default" namespace="/">
<action name=""><result>/Login.jsp</result></acton>
this will forward you to the login page. Also consider to use absolute paths to the JSP resources.
In the JSP use the form that needs to rewrite to
<s:form namespace="/" action="login" method="post">
<s:textfield name="username" key="label.username" size="20" />
<s:password name="password" key="label.password" size="20" />
<s:submit key="label.login" align="center" />
</s:form>
In the action attribute use the action name and provide namespace as you did in the package configuration.
Using method="execute" is useless in the s:submit tag, the method execute used by default, and it will not work because you have turned off DMI in the Struts configuration.
Adding libraries over the old libraries in the WEB-INF/lib doesn't help so much and your application probably would not work, until you remove and replace all lower version libraries with higher version and add new libraries needed by the current version of Struts framework.
for me it's I didn't add "lang3" to library, after adding it everything goes well
Related
This question already has answers here:
There is no Action mapped for namespace [/] and action name [login] associated with context path [/Struts2Test]
(4 answers)
Closed 2 years ago.
Currently migrating an app from Struts1 to Struts2.
When I click my "submit" button, it gives me an error saying "There is no Action mapped for action name requestInput". What is wrong with my code that is the cause of this error?
web.xml
<web-app>
<display-name>My Project</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!-- The Usual Welcome File List -->
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
struts.xml
<struts>
<include file="struts-default.xml" />
<constant name="struts.custom.i18n.resources" value="global" />
<package name="default" namespace="/" extends="struts-default">
<interceptors>
<interceptor-stack name="uploadFile">
<interceptor-ref name="fileUpload" />
<interceptor-ref name="uploadForm" />
<interceptor-ref name="modelDriven" />
<interceptor-ref name="basicStack" />
</interceptor-stack>
</interceptors>
<action name="requestInput" class="com.class.action.FileAddAction" method="execute">
<result>/result.jsp</result>
</action>
</package>
</struts>
FileAdd.jsp
<s:form method="POST" action="requestInput" enctype="multipart/form-data">
...
<s:submit property="submit" style="background:#dccaa0" value="Submit" theme="simple"/>
...
</s:form>
FileAddAction.jsp
public final class FileAddAction extends ActionSupport implements SessionAware, ServletRequestAware {
...
public String execute() throws Exception{
...
}
}
And, my struts.xml is in the Java src folder and in the WEB-INF folder.
What else can I do to fix this? Thanks..
Two issues, otherwise looks good.
First issue:
action name="requestInput" class="com.class.action.FileAddAction"
method="execute"
You can't name your package with the identifier class, it is not a valid Java identifier
Second issue:
interceptor-ref name="uploadForm"
What is "uploadForm"? It's definitely not provided by Struts 2, see the list.
By naming the package differently, and removing interceptor-ref uploadForm, i am able to click the FileAdd.jsp Submit button without any issue and it is redirecting me successfully to result.jsp. I used v2.3.37.
Note:
struts.xml should be in the src/main/resources folder (struts.xml must be on the web application’s root class path). Check this out.
web.xml is to be under src/main/webapp/WEB-INF folder. Check this out.
I am developing a simple Struts2 application having AJAX call. I am trying to check each field of a form, while it is being filled up, using AJAX call. I want to get the response from a servlet. To call the servlet, I have used 'exclude url' in struts.xml file and included the ajax call pattern in web.xml file. But my application is unable to find out the servlet. Below are the code snippets:
empForm.jsp:
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<script src="util.js" type="text/javascript"></script>
<script src="validate.js" type="text/javascript"></script>
<title>Employee Registration Form</title>
</head>
<body>
<h1 align="center">Employee Registration Form</h1>
<h2 align="left">Please provide your details in the appropriate fields. Fields marked with * are mandatory. </h2><br><br>
<s:form action="register">
<s:textfield id="username" name="username" label="Username*" />
<s:textfield name="fullname" label="Full Name*" />
<s:textfield name="emailid" label="Email*" />
validate.js:
window.onload = initPage;
alert("validate.js page");
function initPage() {
document.getElementById("username").onblur = checkUsername;
//document.getElementById("register").disabled = true;
alert("in initPage();");
}
function checkUsername() {
request=createRequest();
if(request==null)
alert("Unable to create request!");
else{
var theName = document.getElementById("username").value;
var username = escape(theName);
var url = "http://localhost:8080/PeopleManagement/checkName.do?username=" + username;
//var url = "checkName.do?username=" + username;
request.onreadystatechange = showUsernameStatus;
request.open("GET",url,true);
request.send(null);
alert("url:" + url);
}
alert("in checkUsername();");
}
function showUsernameStatus(){
if(request.readyState == 4){
if(request.status == 200){
alert("Status:" + request.statusText);
alert("Response:" + request.responseText);
if(request.statusText == "okay"){
alert("allowed");
}
else
alert("denied");
}
}
}
struts.xml:
<package name="admin" extends="struts-default">
<action name="Welcome">
<result>/welcome.jsp</result>
</action>
<action name="Admin" class="com.admin.AdminUser" method="execute">
<result name="input">/adminLogin.jsp</result>
<result name="SUCCESS">/adminMenu.jsp</result>
</action>
</package>
<package name="registration" extends="struts-default">
<action name="register" class="com.emp.Employee" method="execute">
<result name="input">empForm.jsp</result>
<result name="error">/registrationError.jsp</result>
<result name="SUCCESS">/registrationSuccess.jsp</result>
</action>
<action name="viewemp" class="com.emp.ViewEMP" method="execute">
<result name="error">/viewError.jsp</result>
<result name="SUCCESS">/list.jsp</result>
</action>
</package>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>PeopleManagement</display-name>
<welcome-file-list>
<welcome-file>welcome.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>UserValidator</servlet-name>
<servlet-class>com.validation.ValidateUser</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UserValidator</servlet-name>
<url-pattern>/checkName.do*</url-pattern>
</servlet-mapping>
</web-app>
please help me out.
You need to map your Servlet correctly in web.xml
<servlet-mapping>
<servlet-name>UserValidator</servlet-name>
<url-pattern>/PeopleManagement/checkName.do</url-pattern>
</servlet-mapping>
.........
[EDIT]
You will also have to edit /* to / for the struts interceptor servlet. The difference is explained here - Difference between / and /* in servlet mapping url pattern
I am reworking my forms so that they will work without javascript enabled but also work well with javascript by using jquery and AJAX. I am using struts which has proven to be both helpful and a pain. The form processing without javascript was handled with basic struts functionality by validating and executing the action and dispatching back to the page the user was on but with the result (actionMessage or actionError) set in the forms html. I had a hidden input with the url of the page which would be set in the form bean, and that is the dispatch location in the struts.xml
My problem is that I need to be able to have this functionality underneath some enhanced functionality such as JSON serialization and AJAX requests, and I can't figure out a way to have both. Below are my configurations and code for the no-script form which works fine.
The struts.xml file
<struts>
<package name="default" extends="struts-default,json-default">
<action name="contact" class="org.deadmandungeons.website.action.ContactAction" method="execute">
<result name="success">%{currentPage}</result>
<result name="input">%{currentPage}</result>
<result name="error">%{currentPage}</result>
</action>
</package>
</struts>
The No-script JSP
<%# tag language="java" pageEncoding="UTF-8"%>
<%# taglib uri='http://java.sun.com/jsp/jstl/core' prefix='c'%>
<%# taglib prefix="t" tagdir="/WEB-INF/tags"%>
<%# taglib prefix="s" uri="/struts-tags" %>
<%# taglib prefix="sj" uri="/struts-jquery-tags"%>
<s:form id="contact_form" action="contact" method="post" cssClass="clearfix">
<label for="contact_user">Username / In-game name:</label>
<input type="text" id="contact_user" name="contactBean.username"
class="field" data-enter-click="sendbutton" maxlength="16"
size="16" />
<label for="contact_email">Email:</label>
<input type="text" id="contact_email" name="contactBean.email" class="field" data-enter-click="sendbutton" />
<label for="contact_message">Message:</label>
<textarea id="contact_message" name="contactBean.message" rows="5" cols="35"></textarea>
<input id="no_script" name="contactBean.currentPage" type="hidden" value="${pageContext.request.requestURL}" />
<div id="contact_response" class="response">
<s:if test="hasActionErrors()">
<s:actionerror id="contact_fail" cssClass="fail" />
</s:if>
<s:if test="hasActionMessages()">
<s:actionmessage id="contact_success" cssClass="success" />
</s:if>
</div>
<s:submit type="submit" id="sendbutton" value="Send" />
</s:form>
The contactAction class is just a basic action class holding a ContactBean for the necessary fields, and adding ActionErrors when it doesnt validate or ActionMessages on success.
Now for the jquery AJAX approach on top of this, I have tried a couple things. I have the struts2 jquery plugin installed which is a great plugin, and I am able to get ajax working fin on forms with it, but not with the way my struts configuration is in the example above. For the dispatch location for the result in struts.xml, I had it set to a jsp page that looks like this:
<%# taglib prefix="s" uri="/struts-tags"%>
<s:property value="response" escapeHtml="false"/>
and I added a field called response to the action class which was just set with the actionError or actionMessage strings. The jquery plugin was able to take the result from that jsp, and append it to the target locations fine. But that means that if I do the same with javascript turned of, once the form is submited, the user would be dispatched to that jsp which only displays the result string rather than dispatching them to the same page and setting the message in the form.
I have also tried to use the struts2 json plugin (which is also great), but this also only works well with jquery ajax, and not when there is no javascript.
Any ideas on how to get a form to work in both settings?
Thanks!
I figured it out with the help of struts interceptors. I made a custom interceptor that would check the stack parameters if a 'noScript' parameter existed, and if it did, It would return a result of 'noScript'. The noScript result is of type 'chain' and would then forward to the action that handles the form response when there is no javascript. The noScript parameter is set through a hidden field in the form that has the url of the current page. when the page loads, jquery will remove this input anywhere on the page. So if javascript is disabled, the noScript input will not be removed. Here is my new struts.xml after:
<struts>
<package name="default" extends="struts-default,json-default">
<interceptors>
<interceptor name="noScriptInterceptor"
class="org.deadmandungeons.website.NoScriptInterceptor"></interceptor>
<interceptor-stack name="noScriptStack">
<interceptor-ref name="noScriptInterceptor" />
<interceptor-ref name="defaultStack" />
</interceptor-stack>
</interceptors>
<action name="contact" class="org.deadmandungeons.website.action.ContactAction" method="execute">
<interceptor-ref name="noScriptStack"/>
<result type="json" name="success" />
<result type="json" name="input" />
<result type="json" name="error"/>
<result type="chain" name="noScript">noScriptContact</result>
</action>
<action name="noScriptContact" class="org.deadmandungeons.website.action.ContactAction" method="execute">
<result name="success">%{noScript}</result>
<result name="input">%{noScript}</result>
<result name="error">%{noScript}</result>
</action>
</package>
</struts>
And here is the NoScriptInterceptor class:
public class NoScriptInterceptor implements Interceptor {
private static final long serialVersionUID = -1472114260682759961L;
#Override
public void destroy() {
}
#Override
public void init() {
}
#SuppressWarnings("unchecked")
#Override
public String intercept(ActionInvocation invocation) throws Exception {
final ActionContext context = invocation.getInvocationContext();
String actionName = Utils.toCamelCase(invocation.getAction().getClass().getName());
Map<String,Object> parameters = (Map<String,Object>)context.get(ActionContext.PARAMETERS);
Object noScriptParam = parameters.get(actionName + ".noScript");
if (noScriptParam != null) {
return Constants.NO_SCRIPT;
}
return invocation.invoke();
}
}
I have a project using struts 2.1.8. The project is configured by annotation using struts2-convention-plugin. Here is my struts config in web.xml:
<filter>
<filter-name>struts2Filter</filter-name>
<filter-class>
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>struts2Filter</filter-name>
<url-pattern>/struts/*</url-pattern>
</filter-mapping>
struts.xml:
<constant name="struts.convention.default.parent.package" value="borrow-default" />
<constant name="struts.convention.package.locators" value="action" />
<constant name="struts.convention.package.locators.basePackage" value="com.abc.action" />
<constant name="struts.convention.result.path" value="/" />
A.java:
#Namespace("/regist")
public class A extends ActionSupport{
#Action(value="/a", results = {#Result(location = "/a/test.jsp")})
public String execute(){
return SUCCESS;
}
}
Here is the problem, I can access the test.jsp in url http://localhost:8080/a/test.jsp and http://localhost:8080/regist/a.action, but I can still visit the same page in url http://localhost:8080/a/test.action. I don't know why this happens, what's wrong in my config or code?
I also tried some other url, it seems the namespace doesn't take effect.
In web.xml your url pattern is like:
<url-pattern>/struts/*</url-pattern>
but you are placed jsp and getting it from /a/test.jsp
once check it...
I upgraded the struts to 2.3.15.1 and this question disappeared
I want to add an action to my struts.xml but when I do it my webapp stop to work and I don't know why. I post here some details of my webapp.
web.xml :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
<display-name>ILIMobileLeborgne</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
struts.xml (in the src folder in Eclipse):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<constant name="struts.devMode" value="true" />
<constant name="struts.custom.i18n.resources" value="ilimobile" />
<package name="ilimobile" namespace="/" extends="struts-default">
<action name="index">
<result>/index.jsp</result>
</action>
<action name="registerIllimite">
<result>/registerIllimite.jsp</result>
</action>
<!-- When i try to do add the following action my app doesn't working, the browser said me that the ressource asked is unavailable and when i delete it my (little) app works correctly -->
<action name="registerClientInfo" class="action.SubscribeAction">
<result name="success">/paiement.jsp</result>
</action>
</package>
</struts>
my SubscribeAction (in the action package in the source folder) :
package action;
import model.*;
import com.opensymphony.xwork2.ActionSupport;
public class SubscribeAction extends ActionSupport {
private Client client;
private String abonnement;
public String getAbonnement() {
return abonnement;
}
public void setAbonnement(String abonnement) {
this.abonnement = abonnement;
}
#Override
public String execute() throws Exception {
// TODO Auto-generated method stub
return SUCCESS;
}
public Client getClient() {
return client;
}
public void setClient(Client client) {
this.client = client;
}
}
And my JSP page which use the action defined :
<%# page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%# taglib prefix="s" uri="/struts-tags" %>
<!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=UTF-8">
<title>Insert title here</title>
</head>
<body>
<s:form action="registerClientInfo">
<s:textfield key="client.nom"/>
<s:textfield key="client.prenom"/>
<s:textfield key="client.email"/>
<s:textfield key="client.adresse"/>
<s:textfield key="client.ville"/>
<s:textfield key="client.cp"/>
<s:submit/>
</s:form>
</body>
</html>
If you need some extra info ask me but i think you could see why my app doesn't want to work :/ I'm pretty sure that it's just a little error but i can't find it...
Thanks for all and have a happy new year party :)
(Sorry for my English I'm a french student ^^)
Edit : I post here the Eclipse stack trace which show me that he can't find my action class but i don't know why :/ I've a struts example made by my teacher and i don't think that he made some extra steps to deploy the app with a tomcat server on Eclipse
The stack trace :
Unable to load configuration. - action - file:/home/blackmario/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ILIMobileLeborgne/WEB-INF/classes/struts.xml:20:68
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: Action class [action.SubscribeAction] not found - action - file:/home/blackmario/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/ILIMobileLeborgne/WEB-INF/classes/struts.xml:20:68
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:480)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:424)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:541)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:290)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:239)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
... 18 more
So, it sounds like your application fails to start when you add that action, correct? Nothing works, even the ones that worked before. So, you should look in the logs of the servlet container you are using. Nothing is more fundamental that finding where the logs are and becoming familiar with them.
When you do look in the logs, I'm guessing you'll see either
1) an error complaining that the syntax of the struts.xml is bad and the application fails when trying to parse it.
or
2) A ClassNotFoundException because the class file for that action is not on the classpath of the application. If this is the case make sure that the class files for that action are actually being put into the WAR file's WEB-INF/lib or WEB-INF/classes direcgtory; that's where a webapp's classloader looks for class files. If you don't know much about this, you should read more about Java Servlets.
Both of these are things that might cause the application to not successfully start. You must look at the logs; they will amost always tell you that the application had a specific issue. If you ask about that specific issue on this forum, you'll get very useful answers. Otherwise, I'm kind of guessing.
By default .action extension is used by the struts-default package that you extend. When you place the url in the browser make sure you have use correct url.
Try changing
<action name="registerClientInfo" class="action.SubscribeAction">
<result name="success">/paiement.jsp</result>
</action>
to
<action name="registerClientInfo" class="SubscribeAction">
<result name="success">/paiement.jsp</result>
</action>