Struts 2 validation is not working for comma separated number entered in text field which has property type integer

2009-01-19 Thread jitendra
Hi, We are using the struts2.0.6 framework as part of our business application. Recently we found that there is a validation issue with struts2 frame - work. Let me explain my problem first. In a jsp page, I have defined a s:text field and the field property is Integer type(defined in bean). No

Re: Struts 2 validation is not working for comma separated number entered in text field which has property type integer

2009-01-19 Thread Lukasz Lenart
2009/1/19 jitendra : > My question is how I can validate the Integer value which has the commas in > it. Basically, we don't want to add any custom validator for this field > because if we do so then we have to apply this validation through out our > application and it is around 150 places. The be

RE: exception handling

2009-01-19 Thread doahh
I must be misunderstanding something, is that not what I am already doing my chaining to another action? Andy Hahn wrote: > > Regarding to the first responder - you could take this a step further and > have ActionUnhandledExceptionHandler redirect to another action (Redirect > After Post)‏. >

Re: Struts 2 session problem

2009-01-19 Thread RajibJana
It seems to me SEAM has answer to my problem. Check out their booking example if anyone is interested. Thanks Rajib RajibJana wrote: > > "The issue that you may lose track of that state for a user if another > user hijacks the session is not a use case for a feature but a description > o

Re: Struts 2 session problem

2009-01-19 Thread stanlick
I think you can get the unique "handle" to either a tab or new window created with Ctrl-N via the DOM. I remember trying this back when tabs came onto the scene. With that key you could use a Map in session to correlate the conversations. Peace, Scott On Sun, Jan 18, 2009 at 11:32 PM, dusty wr

Re: Sending XML data from action to YUI

2009-01-19 Thread Musachy Barroso
You could write your own result that uses XStream, or any other library to serialize the objects into xml. musachy On Mon, Jan 19, 2009 at 2:27 AM, aum strut wrote: > Hi All, > > I developing ajax based application using struts 2.0.11 > for ajax we are using YUI for making ajax based call and cu

Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)

2009-01-19 Thread Frank Otto
I have found a solution. I have to set a cookie with JSESSIONID in my JSP (view.jsp). So the ajax request shares the same session and I can get the session object. Nils-Helge Garli Hegvik schrieb: Did you try the suggestion of encoding the session id in the url? It does sound strange indeed. H

Re: Struts 2 session problem

2009-01-19 Thread Dave Newton
dusty wrote: Creating a separate subsystem on the server to partition a single HTTP session for multiple users and maintain the conversation is classic overengineering. Seems like Seam has gone to a lot of trouble to provide just another way to persist state. It's not "over-engineering" to al

Crystal Reports in Java

2009-01-19 Thread Mileidys Gonzalez Prieto
Hi... I was trying to visualize some Crystal reports in my web Application; can somebody help me with links or information about how to do it? I'm using an Struts projects with hibernate, and the reports with Crystal Reports. Mileidys González Prieto Consultant i-Frontier Henck Arronstraat 16 |

How can I render a two column layout with

2009-01-19 Thread Michael Obster
Hi, can anybody tell me how I can make a two column layout with ? Putting some table tags around doesn't work because renders also as table. To get my intention more clear, I need s.th. like this: label selectbox label selectbox label input label selectbox ... Cheers, Michael ---

Re: How can I render a two column layout with

2009-01-19 Thread Nils-Helge Garli Hegvik
Try using the "simple" theme. Nils-H On Mon, Jan 19, 2009 at 3:46 PM, Michael Obster wrote: > Hi, > > can anybody tell me how I can make a two column layout with ? > Putting some table tags around doesn't work because renders also as > table. > To get my intention more clear, I need s.th. like

Re: How can I render a two column layout with

2009-01-19 Thread Dave Newton
Michael Obster wrote: can anybody tell me how I can make a two column layout with ? Putting some table tags around doesn't work because renders also as table. You can either use the "simple" theme (which is problematic because it doesn't include field error messages) or create a new theme (u

Re: How can I render a two column layout with

2009-01-19 Thread Robert Graf-Waczenski
Hi! Add "theme='simple'" to your tag, then no tag is written and you can supply your own custom layout. Robert Michael Obster wrote: Hi, can anybody tell me how I can make a two column layout with ? Putting some table tags around doesn't work because renders also as table. To get my i

Dynamic TextFields in Struts 2

2009-01-19 Thread KE LI
Dear All, I want to do something like this: in my action i create: List textFields = new ArrayList(); and i tried to write set method in 2 ways: 1. public void setTextFields (List textFields) 2. public void setTextFields(String text) { textFields.add(text); } and in my jsp, i

Re: Dynamic TextFields in Struts 2

2009-01-19 Thread Dave Newton
KE LI wrote: Dear All, I want to do something like this: in my action i create: List textFields = new ArrayList(); and i tried to write set method in 2 ways: 1. public void setTextFields (List textFields) 2. public void setTextFields(String text) Without a machine to check with, I'd

RE: exception handling

2009-01-19 Thread Andy
Yes you are chaining, but if you write to a database, for example, the user could refresh the page and re-write to the database. The point I was trying to make was to use the PRG pattern. > Date: Mon, 19 Jan 2009 03:27:57 -0800 > From: ga...@prodia.co.uk > To: user@struts.apache.org > Subje

Re: Dynamic TextFields in Struts 2

2009-01-19 Thread sasikumar
Hi, you dont have to explicitly add the values to the list in the setter methods, since the framework will do that for you , also you dont have to explicitly provide the index in the property field (name) (even though it will work with explicit indexing as well) . refer the fallowing code

Type conversion?

2009-01-19 Thread Henrik Strøm-Andersen
As new to Struts 2 I guess this is a simple question for you: I have an action class (ShowUserAction) with a populated list: private List backendsystems = new LinkedList(); This action class has the usual public set, get and add methods for the list. Among other string fields I want to transfe

Re: Sending XML data from action to YUI

2009-01-19 Thread aum strut
Thats what i came up with.. any one have any idea where i can find a good starter so that i can write my own result type? thanks for the help Musachy On 1/19/09, Musachy Barroso wrote: > > You could write your own result that uses XStream, or any other > library to serialize the objects into xml

Re: Sending XML data from action to YUI

2009-01-19 Thread Musachy Barroso
Take a look at the results, they are pretty simple, this is StreamResult for example: http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dispatcher/StreamResult.java?view=markup all you need to do is implement the Result interface, and then register the result

RE: exception handling

2009-01-19 Thread doahh
I had not considered doing that before so thanks for the input, it would be better. Sorry to the OP for partially hijacking his thread. Andy Hahn wrote: > > > Yes you are chaining, but if you write to a database, for example, the > user could refresh the page and re-write to the database. Th

Re: Sending XML data from action to YUI

2009-01-19 Thread aum strut
Thanks Musachy for the help i will try to follow what u have suggested On 1/19/09, Musachy Barroso wrote: > > Take a look at the results, they are pretty simple, this is > StreamResult for example: > > > http://svn.apache.org/viewvc/struts/struts2/trunk/core/src/main/java/org/apache/struts2/dis

RE: paramsPrepareParamsStack

2009-01-19 Thread Stanley, Eric
Wes, you were spot on. I didn't extend the right package. Thanks. :) -Ryan -Original Message- From: Wes Wannemacher [mailto:w...@wantii.com] Sent: Friday, January 16, 2009 3:17 PM To: Struts Users Mailing List Subject: Re: paramsPrepareParamsStack On Fri, 2009-01-16 at 13:49 -0700, Sta

Re: stack values in converter

2009-01-19 Thread Andrei Ivanov
On Sat, Jan 17, 2009 at 7:30 PM, Andrei Ivanov wrote: > Hello, > I have a date converter that does something like this: > > String value = values[0]; > Locale locale = (Locale) context.get(ActionContext.LOCALE); > DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); > Date date =

Dinamic example - s:tree

2009-01-19 Thread Guilherme
Hello, someone with some example of how to use taglibrary s:tree of struts? I'm having great difficulties, then the code below: thanks for any help, JSP: <%@ taglib prefix="s" uri="/struts-tags" %> s ACTION: package action; import bean.TreeModel; import com.opensymphony.xwork2.ActionSupp

Re: Struts 2 session problem

2009-01-19 Thread Greg Lindholm
+1 I find I need this all the time when developing; I want to login as 2 different users and test multi-user interactions. Currently I'm forced to use 2 different browsers, login once with Firefox and once with IE. This works for development but wouldn't be an acceptable answer for users (plus

RE: Struts 2 session problem

2009-01-19 Thread Radu Solomon
This is not really a struts 2 issue but a browser issue. This is the way firefox persists sessions. If you try same thing in IE6 it will work fine, IE7 some times and IE8 fully emulates firefox. Furthermore you can try this with gmail and you will see the same behaviour. This is a fairly well k

RE: Struts 2 session problem

2009-01-19 Thread Greg Lindholm
Oh I fully understand this is a issue with how browsers deal with sessions. However these are the browsers our apps have to work with so as a developer I have to make the apps work with them and I expect any decent app framework to have good solutions to all the common use cases. And I consider ha

Re: Struts 2 session problem

2009-01-19 Thread Jim Kiley
Are there frameworks that handle this situation differently? It's a browser-side issue, so it isn't clear to me how a server-side framework could solve it. jk On Mon, Jan 19, 2009 at 3:02 PM, Greg Lindholm wrote: > > Oh I fully understand this is a issue with how browsers deal with sessions. >

Re: Struts 2 session problem

2009-01-19 Thread Greg Lindholm
Yes, SEAM does: http://www.seamframework.org/Documentation/DoesSeamSupportMultipleBrowserWindowsOrTabs I haven't dug into exactly how they do it but I would not be surprised if they pass around a hidden conversation token with every request. Then any state information that gets stored in the se

[S2] Exploding memory usage with JBoss5

2009-01-19 Thread Wolfgang Knauf
Hi all, I have a quite small Struts 2 application running on a JBoss 5.0GA. It contains some EJB3 entity beans, an EJB3 session bean, a handful of struts actions and three JSPs. After about 5 redeploys (I use JSR88), JBoss is consuming more and more memory (>500MB) and thus getting poorly slow.

[S2] s:action in value stack?

2009-01-19 Thread Wolfgang Knauf
Hi all, there is one thing about calling an action through the tag: I can provide an "id", and I can call the properties of the action with "#actionid.field" annotations later on the page. But I would expect this action to be placed on the value stack, so that e.g. would access "getField()"

[Struts2] Login form for spring security2.0

2009-01-19 Thread Raghu
Hi, I am trying to setup my struts2 login form for spring security.. I have to specify action as* "/j_security_check"* but struts2 is appending .action with the action value and eventually my action is becoming * "/j_security_check.action"* and that is not I want. How can prevent struts2 to appen

Filter chaining, redirecting to an action?

2009-01-19 Thread Chris Boldon
I am working on converting a few of my applications from Struts 1 to Struts 2. My application in Struts 1 had a filter which checked the servlet path, compared it to a list of known actions and handled accordingly. If the mapping existed, it would forward it on it's merry way, to the correct acti

RE: Struts 2 session problem

2009-01-19 Thread Andy
I agree with ya. I have been doing something very similar with hidden fields in my app for some time. The server knows if a new browser instance is requested by checking the hidden field. If its empty it then creates a new key and sets the hidden field. Basically partitions the session base

RE: Struts 2 session problem

2009-01-19 Thread Martin Gainty
HttpServletResponse.encodeURL http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpServletResponse.html#encodeURL(java.lang.String) Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relate

Re: Dynamic TextFields in Struts 2

2009-01-19 Thread KE LI
Hi Dave and Shashi, Thanks for you two's quick reply!! It does help~:) I just got up, lol. Licco 2009/1/20 sasikumar > Hi, > you dont have to explicitly add the values to the list in the setter > methods, since the framework will do that for you , > also you dont have to explicitly provid

RE: Filter chaining, redirecting to an action?

2009-01-19 Thread Gustave Pheiffers
Hey Chris, You could try a Struts 2 Interceptor, which would on the intercept method either ( based on the servlet path )return a global result e.g. mailto:cbol...@gmail.com] Sent: Tuesday, 20 January 2009 11:31 a.m. To: user@struts.apache.org Subject: Filter chaining, redirecting to an action?

Re: Struts 2 session problem

2009-01-19 Thread dusty
revolutionary indeed. RajibJana wrote: > > "The issue that you may lose track of that state for a user if another > user hijacks the session is not a use case for a feature but a description > of a bug" > > > --The issue is windows tabs overwrite each others data that are put into > the sess

Re: [Struts2] Login form for spring security2.0

2009-01-19 Thread dusty
Do not use use a normal I think you could also do a Raghuveer Rawat-2 wrote: > > Hi, I am trying to setup my struts2 login form for spring security.. > I have to specify action as* "/j_security_check"* but struts2 is appending > .action with the action value and eventually my action

Re: [S2] s:action in value stack?

2009-01-19 Thread dusty
I have not researched this butthe way I understand it the action is executed and its result evaluated and that result sent in place. You can choose not to execute the result but then it just "does something" and the view moves on. When you are doing you are at the view stage right? Your or

Re: [S2] Exploding memory usage with JBoss5

2009-01-19 Thread dusty
Anyone seen this in Tomcat? Wolfgang Knauf wrote: > > Hi all, > > I have a quite small Struts 2 application running on a JBoss 5.0GA. > It contains some EJB3 entity beans, an EJB3 session bean, a handful of > struts actions and three JSPs. > After about 5 redeploys (I use JSR88), JBoss is co

Re: stack values in converter

2009-01-19 Thread dusty
Sorry. I don't think I understand your problem. When you say the stack is being cleared are you seeing nulls in your converter for values that were previously populated on the stack by the Parameters Interceptor? Andrei Ivanov-2 wrote: > > On Sat, Jan 17, 2009 at 7:30 PM, Andrei Ivanov > wr

Re: Sending XML data from action to YUI

2009-01-19 Thread dusty
Has either of you tried the XSLT result type? I have not and I am curious about how well it works. aum strut wrote: > > Thanks Musachy for the help > i will try to follow what u have suggested > > > > On 1/19/09, Musachy Barroso wrote: >> >> Take a look at the results, they are pretty s

Re: Type conversion?

2009-01-19 Thread dusty
So, when you write you are asking Struts to convert your list to a string and represent it like: and I am not sure that is what you want. Because when you resubmit that String struts is not really sure how to rebuild the list. I see you have read up on type conversion and that is good. The

html:messages

2009-01-19 Thread m.harig
hello all i've a new-user page (say new_user.jsp) . am inserting a new user into db. after inserting am mapping my page to new_user.jsp . what my doubt is i've to display a message "User created successfully". how do i do it? help me out of this please. note : am se

Re: Sending XML data from action to YUI

2009-01-19 Thread Miguel
The xslt result works fine, but you need to build the dom tree (using dom, jdom, dom4j or anything that can "export" to w3 dom) and have it in memory. I think Xstream also can "export" to w3 DOM. I´ve used xstream and it works like a charm (in reflexion mode), but I don´t know how to "customize" th

RE: Struts 2 session problem

2009-01-19 Thread RajibJana
Can I expect this feature in future version of S2? It will help the S2 developers immensely, I bet. Thanks Rajib Andy Hahn wrote: > > > I agree with ya. I have been doing something very similar with hidden > fields in my app for some time. The server knows if a new browser > instance is r

Re: html:messages

2009-01-19 Thread dusty
In your action method use addActionMessage. Then in the jsp page use to display the message(s) in the list. You will be using the MessageStoreInterceptor. If you are using 2.1.6 make sure the "store" interceptor is in your stack in struts.xml. If you are using an earlier version you need t

Re: Struts 2 session problem

2009-01-19 Thread Wes Wannemacher
On Tuesday 20 January 2009 00:01:22 RajibJana wrote: > Can I expect this feature in future version of S2? It will help the S2 > developers immensely, I bet. > > Thanks > Patches are always welcome! -Wes -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring,

Re: html:messages

2009-01-19 Thread m.harig
Thanks for replying me. am using struts 1.2 . how do i do it in struts 1.2 dusty wrote: > > In your action method use addActionMessage. Then in the jsp page use > to display the message(s) in the list. > > You will be using the MessageStoreInterceptor. If you are using 2.1.6 > make sur

Re: Sending XML data from action to YUI

2009-01-19 Thread aum strut
I tried using XSLT result type but it forced me to have a stylesheet might be something i was doing wrong but finally for XM i found that creating your own custom result type is the clean approach and it worked quite smoothly for me. -aum On Tue, Jan 20, 2009 at 9:55 AM, Miguel wrote: > The xs

Re: Struts 2 session problem

2009-01-19 Thread Dale Newfield
andrh...@hotmail.com wrote I agree with ya. I have been doing something very similar with hidden fields in my app for some time. If every request in your app is a POST, or if every link in your app is javascript that causes a POST, that's fine. I like using actual links, though, which resul

Re: Struts 2 session problem

2009-01-19 Thread RajibJana
I strongly feel that this should be a feature of S2, it will ease the developers work. With due respect to S2, I can say that SEAM provides few more relevant features that are required for todays enterprise applications. Thanks Rajib Wes Wannemacher wrote: > > On Tuesday 20 January 2009

Re: Struts 2 session problem

2009-01-19 Thread RajibJana
I strongly feel that this should be a feature of S2, it will ease the developers work. With due respect to S2, I can say that SEAM provides few more relevant features that are required for todays enterprise applications. Thanks Rajib Wes Wannemacher wrote: > > On Tuesday 20 January 2009

display a message

2009-01-19 Thread m.harig
hello this is my code if (!isCancelled(request)) { //business logic ActionMessages errorMsgs = new ActionMessages(); errorMsgs.add("messageId", new ActionMessage("User","message.insert")); //saveEr