Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 14 Feb 2010 04:25:49 -0000 Issue 9005

user-digest-help

2010-02-13


Author LoginPost Reply

user Digest 14 Feb 2010 04:25:49 -0000 Issue 9005

Topics (messages 205010 through 205021):

HTTP/HTTPS Switch Options
 205010 by: CRANFORD, CHRIS

JavaTemplate Plugin
 205011 by: Hoying, Ken

Re: Can s:select multiple have a object.someList as name?
 205012 by: wild_oscar

s:select and indents
 205013 by: CRANFORD, CHRIS
 205015 by: DustFrog

i18n database backed
 205014 by: CRANFORD, CHRIS
 205016 by: Balwinder Kumar
 205020 by: DustFrog

please solve this question on <html:multibox>?
 205017 by: tejz

question on <html:multibox>?
 205018 by: tejz

struts2 : submit Collection Set as parameter
 205019 by: Jipu Jiang

Struts 2 convention plugin & tiles support
 205021 by: Peter Nguyen

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------


Attachment: user_205010.ezm (zipped)


In our prior Struts 1.x release of our web portal, all connections were
redirected through HTTPS. Unfortunately, there was a fair amount of
information on the portal which could have easily been served back to
the browser via HTTP rather than using SSL to avoid unnecessary overhead
but at the time the easiest solution was simply to stay HTTPS.



As we've moved to Struts 2.1.x, I'm revisiting alternatives. Ideally
what I would like to be able to do is secure the authentication process
and then potentially move the session back to HTTP to avoid that
unnecessary overhead. I've read that you can create a Filter and adjust
the Tomcat cookies that are set, but I was curious if there is a more
elegant and supported way of doing this?



Presently authentication is what I am looking at but down the road,
there may be additional actions that we would want to consider securing
but maintaining the session between both the HTTP and HTTPS states of
the site just to protect the data being sent to and from the browser and
server.



Thoughts and suggestions?




Attachment: user_205011.ezm (zipped)
I would like to make use of the JavaTemplate Plugin in order to improve my applications performance. However, I do have "ajax" themed tags, as well as, some of my own theme tags. I perfectly realize that the any non "simple" theme tags would not be able to take advantage of the performance improvement. However, I cannot seem to get my application to work at all. Does this mean that in order to use this plugin, I can only use the "simple" theme and no other?

Cannot render tag [head] because theme [ajax] was not found. - [unknown location]
    at org.apache.struts2.views.java.JavaTemplateEngine.renderTemplate (JavaTemplateEngine.java:58)
    at org.apache.struts2.components.UIBean.mergeTemplate (UIBean.java:559)
    at org.apache.struts2.components.UIBean.end (UIBean.java:513)



-----------------------------------------
***Note:The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader of
this message is not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient,
you are hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify the Sender
immediately by replying to the message and deleting it from your
computer. Thank you. Premier Inc.

Attachment: user_205012.ezm (zipped)



wild_oscar wrote:
>
>
> I am trying to pass the multple selected items on a s:select onto a
> List<Serious> that I have on an "some" object:
>
> Some{
> List<Serious> seriousness; ...}
>
> I am using spring to inject "some" in my action:
> <bean id="some" scope="prototype"
>    class="package.SomeClass">
>  </bean>
>
> Using a:
> <s:select multiple="true" value="%{#some.seriousness.{id}}"
> multiple="true" name="some.seriousness.id" list="activeIngredients"
> listKey="id" listValue="name" />
>
> I'm facing an issue: the some.seriousness is being injected with multiple
> Serious objects, with some repetitions of selected elements. If I select
> 2 elements, I'll get a list with size 4 (2x each one), sometimes more.
>
> I've also tried with name="some.seriousness", but this one goes directly
> to input result (indicating an error in populating the fields).
>
> Note that if name="seriousList" and I can successfully see selected items
> if I declare an Integer[] in the action:
>
> Integer[] seriousList;
>
> Does anyone know how to successfully inject the selected values onto the
> object's list.
>
>
>


A few months later, I still haven't found a way to do this.

Is there a way to have the selected fields in a multiple select be injected
onto an object's list property?

In other words, in the example:

<s:select label="Pets"
    name="petIds"
    list="petDao.pets"
    listKey="id"
    listValue="name"
    multiple="true"
    size="3"
    required="true"
    value="%{petDao.pets.{id}}"
/>

the action will need an Integer[] petIds.

Is there a way for the action to have an "owner" object (there's a property
called owner.pets), where the selected fields populate owner.pets ?
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_205013.ezm (zipped)
Is it possible to use the s:select tag in order to render a list of
values by allowing spaces to be used to indent the options in a
tree-like hierarchy or is there another preferenced way of doing this?

I found in the select.ftl template where I could change
"${itemValue?html}" to "${itemValue)" and it would work as I expected,
but I am wondering if there is another way to do this without modifying
the standard simple template for this UI object.

Thanks
Chris




Attachment: user_205015.ezm (zipped)

Would using the optgroup tag in conjunction with the select tag meet your
needs? Refer to the HTML documentation:
http://struts.apache.org/2.0.14/docs/optgroup.html
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_205014.ezm (zipped)
Anyone have any suggested ways to support i18n internationalization
backed by a database table rather than property files?




Attachment: user_205016.ezm (zipped)
Chris, What sort of benefit database will offer over properties files?

Regards,
Balwinder Kumar
CRANFORD, CHRIS wrote:
> Anyone have any suggested ways to support i18n internationalization
> backed by a database table rather than property files?
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>  



Attachment: user_205020.ezm (zipped)

I can see how it can be beneficial in these ways:

1) The application does not have to be redeployed if changing existing
labels.
2) Label descriptions can be modified in real time.
3) If there are multiple applications and common labels, they can be
shared among the other applications.

If you only have one application, and it's relatively simple, having a
database resource may be an "overkill".

I guess if I were supporting such a thing, I would create some tables
something like this:

Table: Resource
Columns:

resource_sid : Unique identifier for record; autoincrementing # value
label_name : Resource identifier
label_text : Text to associate with label
language_code : Coded value representing the language

Composite key would be language_code + label_name.

Table: Language
Columns:

language_sid : Unique identifier for record; autoincrementing # value
language_code : Coded value representing the language (e.g. 0, 1, 2, ...)
langauge_text : Text representing the coded value (e.g. English, Spanish,
French, ...)

You would then have to track a language code in your user web session and
use this code when generating your views to pull out the desired language
labels.
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_205017.ezm (zipped)

I have a JSP where data is shown by use of a for:each loop. In this loop I
have a multibox tag which will display checkboxes next to each corresponding
row. A user will have the ability to select all or a few or none of the
checkboxes and click print.How can I do this?

JSP PAGE LOOK :--

MULTIBOX PERSONNAME INVITATIONLIST
------------- ------------------ ---------------------
PROPERTY:-- [STRINGARRAY] [STRING] [STRINGARRAY]

<table><tr>
<logic:iterate id="message" name="MessageForm" property="nameList">

<td>
<html:multibox name="FORM" property="GETINVITATIONS">
<bean:write name="FORM" property="name" />
<bean:write name="FORM" property="selectedInv" /> <------ how to add String
array to 'GETINVITATIONS'?
</html:multibox>
</td>

<td><bean:write name="FORM" property="name" /></td> [NAME]
<td>

<bean:define id="List" name="FORM" property="invLst"
type="java.util.ArrayList" />
<html:select style="width:200px;" name="FORM" property="selectedInv"
styleId="selectedInv1" multiple="true"> [MULTIPLE INVITATION NAMES]
<html:options name="List"/>
</html:select>

</td>
</logic:iterate>
</tr>
</table>

only name is adding to the GETINVITATIONS , selectedInv is not adding to it.
only name printing in the console.
how to do it?
plase help me ......
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_205018.ezm (zipped)

I have a JSP where data is shown by use of a for:each loop. In this loop I
have a multibox tag which will display checkboxes next to each corresponding
row. A user will have the ability to select all or a few or none of the
checkboxes and click print.How can I do this?

JSP PAGE LOOK :--

MULTIBOX PERSONNAME INVITATIONLIST
------------- ------------------ ---------------------
PROPERTY:-- [STRINGARRAY] [STRING] [STRINGARRAY]

<table><tr>
<logic:iterate id="message" name="MessageForm" property="nameList">

<td>
<html:multibox name="FORM" property="GETINVITATIONS">
<bean:write name="FORM" property="name" />
<bean:write name="FORM" property="selectedInv" /> <------ how to add String
array to 'GETINVITATIONS'?
</html:multibox>
</td>

<td><bean:write name="FORM" property="name" /></td> [NAME]
<td>

<bean:define id="List" name="FORM" property="invLst"
type="java.util.ArrayList" />
<html:select style="width:200px;" name="FORM" property="selectedInv"
styleId="selectedInv1" multiple="true"> [MULTIPLE INVITATION NAMES]
<html:options name="List"/>
</html:select>

</td>
</logic:iterate>
</tr>
</table>

only name is adding to the GETINVITATIONS , selectedInv is not adding to it.
only name printing in the console.
how to do it?
plase help me ......
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_205019.ezm (zipped)
Hi all,

I have a problem with Struts2 type conversion. Here is the classes:

public class Square {
 private int id;
 private Set points = new HashSet();
 
 public Square() {
   
 }
 
 public Square(int id, Set points) {
   this.id = id;
   this.points = points;
 }

 //Setters and getters
}

public class Point {
 private int x;
 private int y;

 public Point() {
   
 }
 
 public Point(int x, int y) {
   this.x = x;
   this.y = y;
 }
}

JSP:
<s:form action="set_submission">

 <s:textfield name="square.points.makeNew[0].x" label="x:
"></s:textfield>
 <s:textfield name="square.points.makeNew[0].y" label="y:
"></s:textfield>
 
 <s:textfield name="square.points(1).x" label="x:
"></s:textfield>
 <s:textfield name="square.points(1).y" label="y:
"></s:textfield>
     
 <s:textfield name="points(2).x" label="x: "></s:textfield>
 <s:textfield name="points(2).y" label="y: "></s:textfield>

 <s:submit></s:submit>
</s:form>

SetSubmission-conversion.properties:

Element_point=com.test.bean.Point
KeyProperty_points=x
CreateIfNull_points = true

Action:
public class SetSubmission extends ActionSupport {

 private Set<Point> points = new HashSet<Point>();
 private Square square = new Square();
 
 public String execute() throws Exception {
   System.out.println("points: " + points.size());
   for(Point p : points) {
     System.out.println("X = " + p.getX() + ", Y = "
+ p.getY());
   }
   
   System.out.println("square.points: " +
square.getPoints().size());
   for(Point p : (Set<Point>) square.getPoints()) {
     System.out.println("X = " + p.getX() + ", Y = "
+ p.getY());
   }
   return SUCCESS;
 }

Here I want the JSP page to submit values directly into the Set 'points'
in Action class. How can I do this?

I managed to submit values directly into the Set<Point> points
collection. However, when it comes to a set inside another object, it
doesn't work.

Any help would be very much appreciated.

Cheers,
Jipu







-----Original Message-----
From: Peter Bliznak [mailto:bliznak@(protected)]
Sent: 11 February 2010 18:14
To: Struts Users Mailing List
Subject: Reading properties from separate source folder

Hi all,
here's my problem. How do I make S2 read property files from separate
folder.
We have different properties for prod, uat and so on ... so we want the
have
separate folder which will contain different set of files for each
environment.

in S1 we used to have two source folders one for java files and second
for all properties.
I tried same thing here and I can't make it work or maybe it is not even
supported.Any ideas?

Peter.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



Attachment: user_205021.ezm (zipped)
Hi,

I'm currently looking at the Struts 2 Convention plugin for small project as
a means of zero configuration, however I'm also looking to use tiles for my
templating. Does anyone know if there's any documentation on supported
result types for the convention plugin (other than the default
dispatcher,velocity,freemarker result types) and if Tiles is supported?

Thanks,
Peter.

--

Samuel Goldwyn<http://www.brainyquote.com/quotes/authors/s/samuel_goldwyn.html>
- "I don't think anyone should write their autobiography until after
they're dead."
©2008 gg3721.com - Jax Systems, LLC, U.S.A.