struts2

Struts2 +JSON RPC

I have developed a native client interface which calls struts2 JSON RPC using post method. I have set content type, content length as suggested in the spec. The request body looks like as follows : {"method": "uploadTxpAssignment","id": "txpUploadRequest", "params":{"addressByDestAddrId":{"addrLine1":"test home","addrLine2":"7th ave","...

RequestDispatcher with Struts2

Currently I fail to getRequestDispatcher from Struts2 as below: RequestDispatcher rd = httpReq.getRequestDispatcher("/category.htm"); Error was show as below: The requested resource (/xxxx/category.htm) is not available. but it working well when http:/xxxx/yyyy/category.htm?id=21 execute does anyone have idea? ...

Configuration manager shouldn't be null error

we have a WAR that has S2 code in it and the WAR is deployed on Glassfish. We are noticing the configuration manager shouldn't be null error when we deploy the code and try to bring use the application (in browser). The error does not happen when the Application server is restarted after the deployment. Log: [#|2009-12-04T12:55:47.215...

Sitemesh + Struts2 + Velocity: Decorators cannot access the context's objects

Hi, I have a struts2 web app using velocity. I am integrating Sitemesh to the project. The decorators are called properly but for some reasons, the objects placed in the context via the toolbox configuration (velocaity related) are not being loaded. Has anyone faced this issue? Thanks a lot ...

Struts2 URL with .action

I want the URL of the below format http://localhost/users/abc rather than http://localhost/users?name=abc How to achieve this in Struts2? ...

Storing data when an jsp call (no submit) an action.

Hi at all... I need some help about a little question. I make a pagination by db for my survey application. I divided my list of questions in six page. Before the pagination, when the user submit the vote, the action check a hashmap and return error on key where the resp is not present. Now, with the pagination, I call the pages by ...

Problem with StrutsSpringTestCase and rest-plugin

I'm able to run tests against my rest-plugin classes with StrutsSpringTestCase, but none of the parameters are set on the action. For e.g.: @Test public void testAgegateParams() throws Exception { request.setParameter("year", "2000"); request.setParameter("month", "01"); request.setParameter("day", "1"); ActionProxy pr...

JBOSS create PDF, XLS

I am writing a JBOSS web app with Struts2 and would like to produce reports in PDF and XLS format. How can I do this? Are there popular packages that can do this for me? ...

In struts 2 Optiontransferselect 's moveSelectedOptions doesn't seem to work

I have a optiontransferselect and the left list box has a couple of values. When I try to move the values to the right .the button doesnt work. There is no error occuring when i click on the moveselect button .The values dont move either. ...

How to configure maxFileSize in Struts 2 for File Upload

Hi All, I have written an application using Struts2 for File Upload and want to override the default maxFileSize of 2MB. This is what I have in my strus.xml file: ...

Default Redirect using Struts2

Currently when you hit the root context of my application Struts2 throws an error: ex. http://localhost:8080/ returns HTTP ERROR 404 Problem accessing /. Reason: There is no Action mapped for namespace / and action name . Is there a way to do a default redirect in Struts2? ...

Validation HashMap->Radiobutton. Struts2.

Hi at all I have another problem! :) I have a hashmap linked on jsp with a radiobutton. When I check a radio, my hashmap is populated with the param that I spec on the tag. Now I want to validate the check on radiobutton. How can I make this? Is possible with the annotations? I have just found a solution, using an another list. But...

Properties file not working with Struts2 and Glassfish

I have a properties file in my application which is built using S2. The properties files resides in WEB-INF/classes and are mentioned in struts.properties as: struts.custom.i18n.resources=myproperty1,myproperty2 to use the properties i just do the following in my JSP's <s:text name="my.property.title"/> this setup works fine on th...

Struts2 and Dojo (double?) publish

I am publishing with dojo topics: dojo.event.topic.publish("publishThisTarget"); And in JSP I have listenTopics: <s:url var="url2publish" action="MyAction" namespace="/public" /> <sx:div showLoadingText="false" indicator="ajaxIndicator" id="content" href="%{url2publish}" theme="ajax" listenTopics="publishThisTarget" preload="fal...

Different ways to use properties file in j2ee app

I have a j2ee app using Struts2. I have a gloabl properties file which is declared in struts.properties which resides in WEB-INF/classes. It has the following setting: struts.custom.i18n.resources=mypropertyfile mypropertyfile also resides in WEB-INF/classes Say for example it contains the following: pdf.test.title=PDF Test then...

pdf in iframe in jsp on tomcat, also Struts2

Hello Everyone, I'm having some issues getting my pdf file to display in my jsp page. I have the pdf saved on my tomcat server with a file location as follows c:/tomcat 6.0/webapps/appname/reports/saved/filename.pdf I am trying to open that file (preferably not using the c: location) and displaying it in an iframe in my jsp file using ...

Disable Struts 2.1 Dynamic Attributes

Is there any configuration option which can be used to disable the dynamic attributes feature in Struts 2.1? I use an older webserver which does not support dynamic attributes. Ideally I'm hoping for an alternative DTD or a configuration option in struts.xml ...

Passing OGNL expression from Tiles attribute to <s:iterator> (Struts2)

Hi, everyone! :) I am trying to pass an OGNL expression from Tiles framework (2.0.4) to the value attribute of <s:iterator> tag like this: tiles.xml <definition name="test" template="/test.jsp"> <put-attribute name="collectionName" value="apples"/> </definition> test.jsp <tiles:importAttribute toName="collectionName" name="coll...

Conditional column using JSP

Hello All, I recently started using the DisplayTag library and I've run into a problem. I'm trying to create a column that will allow the user to link to another page if that other page will actually have something to display. I have it setup so that there's always a hyperlink there but I'm having trouble with the conditional. I have a...

Struts 2 REST and validation

I'm using Struts 2 and the REST plugin. Validation in Struts 2 is ClassName-actionAlias-validation.xml. However, using the REST plugin the action alias is always /. For example OrdersController -> /orders -> OrdersController-orders-validation.xml. How can I get different validations depending on the REST method? Mainly, I want one type o...