struts2

Does Struts2 rest plugin support nested resources

Does struts2 rest plugin support nested resources like rails? ...

Struts2 taglib, compare with null

I am trying to know why this code is not working when I compare a String with null in a JSP. <s:set name="myvar" value="%{'teststring' != null}" /> <!-- always true --> myvar value is ${myvar} Above code works fine, and prints "myvar value is true". But doing any of these <s:property value="myvar" /> <s:property value="%{myvar}" /> ...

In JSP, how to output "<br/>"

I have a string var in my Struts2 action, like this: String tmp = "<br/>"; I want to print it out to the html page as HTML tag by JSP, like this: <s:property value="tmp"/> But, in the html page, the < and > was translated to &lt; and &gt; which i don't want to. So how should I do this? ...

struts2 validation invoking xml

i have a login-validation.xml which define some basic field validation rules. however that's not enough for me. i need to do some more database lookup and i consider this as part of my validation logic. how can i do both xml validation and my database lookup in one go? i suppose i will write something like public void validate() { ...

Struts2 request character encoding

Hello, I'm using Struts2. When I send 'special' characters like ä or ã through a form, the actions that receive it display those characters differently (like à + a little square). I know that I have an encoding problem, but I was unable to find where the request encoding can be configured for Struts2. Can anyone please help me ? Bes...

struts2: jsp include with parameters

when I include jsp either by jsp:include or by s:include and specify parameters - they are perfectly accessible by EL ${param.XXX} but not by OGNL %{#parameters.XXX}. WHY??? What should I use instead in struts tags? ...

struts2 exception detect ajax?

hi i am configuring struts.xml with <global-exception-mappings> but i would like to return the exception stack according to ajax/xmlhttprequest type or typical one thus: if request is typical ordinal http request, and exception thrown to struts -> response html if request is ajax/xmlhttprequest (and expecting json) -> response json ...

Post parameters are becoming null (at random)

Hi, My web application is developed with Struts2 and it was working fine till recently. All of a sudden one of the modules has started malfunctioning. The malfunctioning module is 'Update Student details' page. This page has a lot of fields like 'schoolName', 'degreeName', etc . School 1: <input name="schoolName"> School 2: <input ...

Struts 2 Type Conversion : Specifying nested key for a collection

Hello All, I am developing a web application using Struts 2 (struts 2.0.14) and Hibernate (3.2.6). I am facing a problem while directly populating a Hibernate Entity object using the form data. Let me give some background information regarding my source. There is a one-to-many mapping between Table1 and Table2, which is implemented b...

Multiple users in Login Session

I'm a fresh Struts2 Beginner... and now I'm making a little project... but now I'm in trouble... :( My Project is a kind of Fan Club and I want to allow multiple users in my site.. it's smoothly run on localhost and can access... it has posting photo, and pdf file.. that's all ok But in appsrv, I can't post anything...and login session i...

Using the Struts 2 Message Store Interceptor with Annotations

I am currently converting a Struts 2 application to use the Convention plugin and Annotations instead of the XML configuration. The original XML looks like: <action name="store" method="store" class="com.company.webapp.dop.AuthorAction"> <result name="success" type="redirectAction">list</result> <result name...

Struts 2.0 page navigation

The situation is something like this. There are three pages page1,page2,page 3 Situation Page1 >> takes to >> Page 2 >> takes to >> Page 3 Page 2 is an intermediate page, which has links and links contains the params required by the action to reach page3. <a href="<s:url action="gotoPage3" includeParams="none"> <s:param name="re...

convert integer(long) to double in jsp

Hi, i want to do arithmetic operation on jsp . I am using struts tag lib tag following is the code : <s:set name="value1" value ="%{0.0}" /> <s:set name="value2" value ="%{0.0}" /> <s:set name="percent" value ="%{0.0}" /> <s:iterator> <s:set name="value1" value ="%{#value1+ someIntegerValue1}" /> ...

struts2 portlet with spring on liferay problem

i tried to integrate struts2 portlet with spring into liferay portlet container but i failed to create action of struts with spring first i use struts 2 spring plugin and create the action into spring config file like <bean id="helloStruts2Portlet2" class="com.portlet.struts.HelloStruts2Portlet"><property name="title" value="Software E...

Struts2 + jQuery Autocompletion (Solved, with DOJO :) )

I used the jQuery autocompletion for my Struts2 application. Pratically, my action made a list of strings that jQuery use. This is the script: $().ready(function() { $("#tag").autocomplete("/myAction/Action", { multiple : true, autoFill : true, minChars:1 }); ...

Newbie: Build error running Struts2 on JBoss from Eclipse

I've been a .NET developer for over 8 years now and I've been placed on a Java project and I'm trying to get up to speed. I'm using Eclipse EE 3.5.1, JBoss 5.1, and Struts 2.1.8.1 (all the latest versions as AFAIK). I'm trying to create a new project with a simple login and home page. But when I run my project from Eclipse I get the fo...

read parameters from friendly url in Struts2

Using Convention Plugin, I am able to achieve friendly URL in Struts2. Now, I want to read the parameter from the URL. How to acheive this. http://domain.com/book/struts2 http://domain.com/book/hibernate Regards Ganesh ...

Struts 2 Validation - Do expression & fieldexpression validators support automatically rendering client-side for OGNL expressions?

Do the Struts 2 expression and/or fieldexpression validators support automatically rendering client-side ECMAScript/JavaScript validation for the OGNL expression defined in the validation XML file, like what is done for the other bundled validators (requiredstring, stringlength, etc.)? I ask, because the following ECMAScript is rendered...

Implementing Struts 2 Interceptors using Struts 1

Hello all, I have a legacy application written with Struts 1. The only feature I was asked to add is to protect some actions. Currently any user can do whatever he/she wants. The idea is to allows all user see the data, but block modification operation, i.e. to modify data a user should log in. I know Struts2 has interceptors, so I cou...

struts 2 text tag with dynamic expression , how ?

I need to supply the key dynamically from the action to the text tag <s:text name="<%=talkToUsInfo.messageKey%>" /> but the name attribute on text tag is declared as false ( not sure why ? ) How do i get something like this working without changing the tld in the jar file ? ...