struts2

Configuring SiteMesh for specific action mappings in Struts 2?

Hi, I'm trying to configure sitemesh to only take effect for a certain subset of action mappings in my Struts 2 application. Say for example, I have the following struts.xml snippet: <package name="default" namespace="/" extends="struts-default"> <action name="showForm"> <result>/view/form.jsp</result> </action> </package> <pa...

Converting from Waffle/Pico to Struts2/Guice

Hi all, I've been tasked with converting an application which was developed by myself in the Waffle Framework using PicoContainer as a DI mechanism into our new "stack" which is to use Struts2 as a framework with Guice as the DI mechanism. Does anyone out there have any helpful pointers as to how to do this with minimal pain and at the...

Two struts2 webapps fail to start together

I have problems getting two different struts2 webapps to start together in tomcat. But each of the webapps start correctly when placed independently inside webapps folder of tomcat. I get the following in catalina.out logs- SEVERE: Error filterStart Aug 13, 2009 3:17:45 PM org.apache.catalina.core.StandardContext start SEVERE: Context ...

Hidden field value is lost if the Validation fails strut2

i am using strut-2.1.6 I have a view page wich contains the Primary key of the currently viewed record in a hidden field. If i post this page to Save the record and any validation gets faild. i come back on the same page it keeps all other values but lose the hidden field value. Now when try to save it i get null for the primary key val...

How do I pass struts2 <s:select multiple="true"> with a Map

I have an bean placed on my action Event.java, the action is Called ManageEvents. I would like the user to be able to add to a struts2 multiple select form field and create a list or map of items (in this case Map where the data would be . <struts2:select name="event.dj_map" label="Add DJs To Your Event" list="event.dj_map" listsize="...

Struts2: How to set corresponding values of selected row in the VO class from JSP report ?

In my Struts2 application I am generating a textual report (in jsp) using iterator tag like <table> <tr> <td>ID</td> <td>PROOF</td> <td>DELETE</td> </tr> <s:iterator value="listOfVOClassObjects"> <tr> <td><s:property value="requestId" /></td> <td><s:property value="requestChecker" /></td> <td><s:property value="requestProof" /></td> <t...

Struts 2 validation

Can anyone please let me know how to check if start date > end date in Struts 2 validation.xml ...

How to set locale in a custom Struts 2 ActionMapper

I have implemented a custom ActionMapper which obtains the locale from the URI (the URI itself, not the request parameters). From within ActionMapper.getMapping(), how do I set the locale for the current action? Here are some ideas I've considered: ActionContext.getCurrent().setLocale(). Unfortunately, it seems that a fresh new Action...

Tomcat6 webapp using log4j for logging, unable to log to syslog

Hello, I am trying to log my webapp logs into syslog at local4 level. Environment: Tomcat6, OpenSolaris, Struts2, log4j. Content of my log4j.properties is as follows- log4j.rootLogger=INFO, SYSLOG log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender log4j.appender.SYSLOG.syslogHost=localhost log4j.appender.SYSLOG.layout=org.apache...

Struts2 dynamic parameter name in redirect-action

I'm successfully using a redirect-action for one of my struts2 mapping files as follows: <action name="setAsCurrentCart" class="com.fmp.MyAction"> <result name="success" type="redirect-action"> <param name="actionName">myOtherAction</param> <param name="foo">${foo}</param> </result> <interceptor-ref name="defaultComponentS...

Struts2 Interceptor *after* JSP is rendered - how?

I was wondering if I can capture the result of an action after the result returns and the JSP is rendered. I want to be able to take the entire result (generated HTML) and push it into memcached so I can bring it via Nginx with-out hitting the application server. Any ideas? PS: I know I can run the interceptor after the action executes ...

Looking for an open source IDE supports Struts 2.x.

Currently I am using struts 1.3 netbean 6.7. I have googled for struts 2.x support for netbeans unfortunately I didn't got. My question is "Is there any open source IDE supports struts 2.x?". ...

ognl.MethodFailedException "setCreatedDate" failed for object com.security.data.PasswordHistory@d5b561

i am using strut2.1.6 with tomcat 5.5 i have a Date field createDate in my PasswordHistory Bean, and corresponding date component on my "search.jsp" this field is optional - no validation required . if i submit the form i am get the follwoing error on console ognl.MethodFailedException: Method "setCreatedDate" failed for object com.s...

Struts2 doesn't find jsp files

I've been trying to no avail to set up a simple Struts2 application so I can get on with learning the framework. Basically, what I am expecting to happen is that when an action is triggered that isn't defined, then a default page will be displayed. This app is being developed in Eclipse. I have a very simple struts.xml file set up in t...

Velocity + Struts2 + Sitemesh + Spring +Hibernate Integration How to configur web.xml?

Hi friends, I needed to create an application using Struts2 as MVC,Hibernate for data access and spring in the business logic. And also I needed to use Velocity for presentaion and sitemesh for templating. Integrating Hibernate and Spring is done easily but integrating spring, sitemesh and velocity together with Struts2 is not clea...

How To Avoid the probelm of appending request parameters when using display tag with struts and tiles

Hi, I was using display tag in the jsp with struts and tiles. It works fine, but it always appends the parameters int the url for each request. If the url size is more than 250 the url is breaking. How to avoid the problem of appending the request parameters for every request using the display tag with struts and tiles ...

Struts 2 and locale question

I've got forms that I display on almost every pages of a website (a login form, for example), so I don't use an action for those. The "post" of those forms just goes to an action and if there is a validation error, it displays another "central" page. The only thing that doesn't seems to work in the form page is displaying a message in di...

in Struts2, to submit values by postwith using an action, method

Hello, I'm from South Korea :) I have a question, but I couldn't find a solution for my problem in Korean web community. <s:form name="form1" method="post" action="products" theme="simple"> <s:hidden name="code" value="%{code}"/> <s:submit type="button" name="method:selectSale" value="goPage"/> </s:form> This code has no problem....

[Struts2] using anchor instead of submit (post)

I have a question, but I couldn't find a solution for my problem in Korean web community. <s:form name="form1" method="post" action="products" theme="simple"> <s:hidden name="code" value="%{code}"/> <s:submit type="button" name="method:selectSale" value="goPage"/> </s:form> This code has no problem. But, I want to use "anchor" in...

Struts Tag> use anchor tag instead of submit

<s:form action="products" method="post" theme="simple"> <s:hidden name="code" value="%{code}"/> <s:submit type="button" method="selectSale" value="see"/> </s:form> Question> How can I change <s:submit> to <s:a> struts tag? I want to send parameters to next page(action) by post (not get) ...