top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

sj:select value problem

+1 vote

I have a multiple dropdown menu. What I want to do is to pre-select related items based the value passed in. Specifically, I have html: Select keywords 1 Cool 1 Heat 3 Heat 1 Heat/1 Cool jsp: and I pass in an array to "value".
The array has [1 Cool, 1 Heat, 1 Heat/1 Cool]. The array's name is "patternKeyword2". When I ran the code, I found that these three items [1 Cool, 1 Heat, 1 Heat/1 Cool] were not selected in the dropdown menu.

posted Aug 6, 2013 by Deepak Dasgupta

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
Do you use the Struts 2 jQuery plugin? And please do some better formatting.

Similar Questions
+1 vote

I am using s:select to create a dropdown and then checked the html. I wanted to add bgcolor as yellow. I referred to the following link

but still not sure how to put the background clour as yellow. Can anyone provide any pointers? Also, is it OK to use JSTL tags in JSPs in a Struts 2 application ?

0 votes

Dear all,Imagine you have the following scenario:

- a property in your action: private Entity entity;
- Entity has a List entity2List
- Entity2 has a Entity3 entity3

Now, you need an s:select with multiple="true" to populate entity3. This corresponds to having a request in the form entity.entity2List[n] (n=0,1,2...depending on how many items are selected).

Question: how should the name parameter of the s:select be like to achieve this?

I have tried the following without success (meaning entity.entity2List has is empty):

<s:select multiple="true" name="%{entity.entity2List[]}" list="#someList" listKey="id" listValue="code"/>
<s:select multiple="true" name="entity.entity2List[]" list="#someList" listKey="id" listValue="code"/>
+2 votes

I am facing an issue related to maintaining session token value when we have window forms.

We have a main form, which needs token to submit. There is a link through which we can open a window , which also needs token and can submit the form.

Once we close the window and try to submit the main form, we get token mismatch error. Because the session token had changed by this time.

Is there any solution for this issue.

+1 vote

I am using struts 2.3.15 libraries. I have put a text field value as "user ".

Whenever I submit the form, the text field value changes and the special character changes to "?".

I have struts1 also in the same project and it works perfectly fine for struts1 pages.

+1 vote

Facing some issue, while we use wildfly-deploy maven plugin to deploy strut2 application to wildfly aka jboss 7, struts2 is unable to read file packaged inside .war. If i deploy from an IDE or manually then there is no issue.

The only difference is wildfly-deploy plugin is deploying application war inside {WILDFLY_HOME}/standalone/data/ folder where as manual or IDE will deploy it under {WILDFLY_HOME}/standalone/deployments/ folder.

In essence struts2 unable to read file if deployed under certain location.

Any thoughts, application is working perfectly except label's are not coming only label key is coming in screens.