You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by akoo <og...@yahoo.com> on 2009/05/20 17:48:20 UTC
problems upgrading from struts 2.0 to 2.1
Hi guys,
I am having some strange issues trying to upgrade from struts 2.0 to 2.1.
I have this simple login form
<html>
<head><title>Simple jsp page</title></head>
<body>
<s:form action="Login" theme="simple" method="post">
<table>
<tr>
<td>Username</td>
<td><s:textfield name="username"></s:textfield> </td>
</tr>
<tr>
<td>Password</td>
<td><s:password name="password"></s:password></td>
</tr>
<tr>
<td colspan="2"><s:submit value="Login"></s:submit> </td>
<tr>
</table>
</s:form>
</body>
</html>
which seems to get rendered as.
<html>
<head><title>Simple jsp page</title></head>
<body>
<form id="Login" name="Login" action="/reddragon/Login.xhtml"
method="post">
<table>
<tr>
<td>Username</td>
<td><input type="text" name="username" value=""
id="Login_username"/> </td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="password"
id="Login_password"/></td>
</tr>
<tr>
<td colspan="2"><input type="submit" id="Login_0"
value="Login"/>
</td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</form>
</body>
</html>
After going through the struts 2.1 filter. Web.xml is set up the following
way
<display-name>Red Dragon</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>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/struts/*</url-pattern>
</filter-mapping>
and struts.xml is setup this way
<struts>
<constant name="struts.enable.DynamicMethodInvocation" value="false" />
<constant name="struts.devMode" value="false" />
<package name="reddragon" namespace="" extends="struts-default">
<result-types>
<result-type name="tiles"
class="org.apache.struts2.views.tiles.TilesResult"></result-type>
</result-types>
<!-- Add actions here -->
<action name="Login" class="com.castle.webapp.actions.LoginAction"
method="login">
<result name="success" type="tiles">mainpage</result>
<result name="input">index.jsp</result>
</action>
</package>
</struts>
I suspect on the the gazillions of plugins jars that I downloaded with 2.1
is getting in the way. I have no explanation why that form action is set to
xhtml and not a .action.
The form of course does not work when I submit and gives me the following
error
java.lang.NoSuchMethodException:
com.castle.webapp.actions.LoginAction.create()
java.lang.Class.getMethod(Class.java:1605)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)
org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
What is this create method and why is it looking for a create method?
Thanks.
--
View this message in context: http://www.nabble.com/problems-upgrading-from-struts-2.0-to-2.1-tp23638049p23638049.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: problems upgrading from struts 2.0 to 2.1
Posted by Musachy Barroso <mu...@gmail.com>.
are you using the REST plugin? I can't think of anything else that
would add that ".xhtml" extension.
musachy
On Wed, May 20, 2009 at 11:48 AM, akoo <og...@yahoo.com> wrote:
>
> Hi guys,
> I am having some strange issues trying to upgrade from struts 2.0 to 2.1.
> I have this simple login form
>
>
>
> <html>
> <head><title>Simple jsp page</title></head>
> <body>
> <s:form action="Login" theme="simple" method="post">
> <table>
> <tr>
> <td>Username</td>
> <td><s:textfield name="username"></s:textfield> </td>
> </tr>
> <tr>
> <td>Password</td>
> <td><s:password name="password"></s:password></td>
> </tr>
> <tr>
> <td colspan="2"><s:submit value="Login"></s:submit> </td>
> <tr>
> </table>
> </s:form>
> </body>
> </html>
>
>
>
> which seems to get rendered as.
>
>
> <html>
> <head><title>Simple jsp page</title></head>
> <body>
> <form id="Login" name="Login" action="/reddragon/Login.xhtml"
> method="post">
> <table>
> <tr>
> <td>Username</td>
> <td><input type="text" name="username" value=""
> id="Login_username"/> </td>
> </tr>
> <tr>
> <td>Password</td>
> <td><input type="password" name="password"
> id="Login_password"/></td>
> </tr>
> <tr>
> <td colspan="2"><input type="submit" id="Login_0"
> value="Login"/>
> </td>
> </tr>
> <tr>
> <td colspan="2"></td>
> </tr>
> </table>
> </form>
>
> </body>
> </html>
> After going through the struts 2.1 filter. Web.xml is set up the following
> way
>
>
> <display-name>Red Dragon</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>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/struts/*</url-pattern>
> </filter-mapping>
>
> and struts.xml is setup this way
>
> <struts>
> <constant name="struts.enable.DynamicMethodInvocation" value="false" />
> <constant name="struts.devMode" value="false" />
> <package name="reddragon" namespace="" extends="struts-default">
> <result-types>
> <result-type name="tiles"
> class="org.apache.struts2.views.tiles.TilesResult"></result-type>
> </result-types>
> <!-- Add actions here -->
> <action name="Login" class="com.castle.webapp.actions.LoginAction"
> method="login">
> <result name="success" type="tiles">mainpage</result>
> <result name="input">index.jsp</result>
> </action>
> </package>
> </struts>
>
>
> I suspect on the the gazillions of plugins jars that I downloaded with 2.1
> is getting in the way. I have no explanation why that form action is set to
> xhtml and not a .action.
> The form of course does not work when I submit and gives me the following
> error
>
>
> java.lang.NoSuchMethodException:
> com.castle.webapp.actions.LoginAction.create()
> java.lang.Class.getMethod(Class.java:1605)
>
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.getActionMethod(AnnotationValidationInterceptor.java:75)
>
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:47)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>
> com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122)
>
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236)
>
> com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195)
>
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87)
>
>
> What is this create method and why is it looking for a create method?
> Thanks.
> --
> View this message in context: http://www.nabble.com/problems-upgrading-from-struts-2.0-to-2.1-tp23638049p23638049.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"Hey you! Would you help me to carry the stone?" Pink Floyd
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org