Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem when using Struts 2.3.4 with portlet

 
E. Tse
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i just upgraded struts 2 from 2.2.3 to 2.3.4 and found a problem, tried a night to fix but still no idea... Anyone can help ??

my application is written in portlet, which use Jsr168Dispatcher of struts2-portlet-plugin-2.3.4.jar. Everything was fine before upgrade but it does not work after changing struts version.

portlet.xml
<portlet>
<portlet-name>abcportlet</portlet-name>
<portlet-class>org.apache.struts2.portlet.dispatcher.Jsr168Dispatcher</portlet-class>
<init-param>
<name>portletNamespace</name>
<value>/abcportlet</value>
</init-param>
<init-param>
<name>viewNamespace</name>
<value>/view</value>
</init-param>
<init-param>
<name>defaultViewAction</name>
<value>input</value>
</init-param>
[...]
</portlet>

struts.xml
<package name="abcportletView" namespace="/abcportlet/view" extends="struts-portlet-default">
<action name="updateForm" method="updateForm" class="xyz.myActionClass">
[...]


jsp
<s:form id="sampleForm" name="sampleForm" action="updateForm" namespace="" theme="css_xhtml" method="post" enctype="multipart/form-data" >
[...]
</s:form>

Problem 1 - Resolved
default action input will show the jsp, inside the jsp having a submit button to submit the form with action "updateForm".

My first problem is: after the submit, it said invalid action /abcportlet/updateForm.action, which i does not have action extension in my application. i have originally configured to put extension as blank, with the following config value in struts.xml, but it seems changed the logic of reading that...

<constant name="struts.action.extension" value="" />

From reference, i changed to the following:

<constant name="struts.action.extension" value="," />

then, it seems working...

Problem 2
another problem comes...

09:39:31,349 ERROR [jsp:154] Unable to locate action mapping for request, probably due to an invalid action path: /abcportlet/updateForm - [unknown location]

Anyone can help ??? wanna see if it is my configuration problem using new version of struts or it is a bug in struts 2.3.4 ?? Thanks thanks !!!
 
E. Tse
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
seems no one have experience in using struts 2 in portlets ?? if so, can you recommend me which forum can be a good place in asking these kind of question ? as it is urgent, i need to resolve it asap. thanks !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic