How to have a gridview like control in Struts 1.2

2009-07-20 Thread lplpp
Hi there, I am using struts 1.2.9. I am trying to display a record (which has an image and title) into a 3x3 grid with paging. I am fetching these records from by database and would like to display them to automatically be set on my page. Is there a control in struts which could help me ahieve t

Problem with LoginInterceptor

2009-07-20 Thread mathias-ewald
Hi, recently I was told using Interceptors was better than using a BaseAction object performing the login process. I agree. Still I have some trouble: This is what happens: I have a JSP that creates a button liked with another action: AgencyDetails.jsp - ...

Prevent persisting data when validation fails

2009-07-20 Thread taltun
When submitting a form using manual validation in my action. Even when the validation fails and the action method supposed to be called is not called at all, the dirty data is persisted ? How can I prevent data from being persisted if the validation fails ? Note: I use prepare method to load e.

Re: Problem with LoginInterceptor

2009-07-20 Thread Nils-Helge Garli Hegvik
You need to include one of the framework interceptor stacks (e.g "defaultStack") in your "defaultLoginStack" stack. As you have configured it, your interceptor is the only one that is being executed, so none of the framework "magic" gets applied. Nils-H On Mon, Jul 20, 2009 at 10:09 AM, mathias-e

Re: Struts w/Ajax with Struts again

2009-07-20 Thread cpanon
Hi PW But I cant access the session objects with JS, nor can I iterate the collections I have in the session to display the updated values that were written in the Ajax processing action.  Correct? --- On Mon, 7/20/09, Paweł Wielgus wrote: From: Paweł Wielgus Subject: Re: Struts w/Ajax with S

Re: Problem with LoginInterceptor

2009-07-20 Thread mathias-ewald
Thx for the reply! I checked the Login Intercepter Tutorial once again and recognized I forgot some Interceptors as you told. This is what they suggest to define: You need to include one of the framework interceptor stacks (e.g "defaultStack") in your "defaultLoginStack" stack. As you have con

Re: Struts w/Ajax with Struts again

2009-07-20 Thread Paweł Wielgus
Hi cpanon, what i meant is to do real refresh of the page, just like the one when You hit F5 button or click "Refresh" on your browser. Try this: 1. load the page 2. do some of that ajax stuff 3. hit F5 is the result like You have expected? After all not using ajax at all may be best solution in y

Re: Problem with LoginInterceptor

2009-07-20 Thread Dave Newton
mathias-ewald wrote: the additions Interceptors cannot be found. Where are they defined?? My first guess would be that you're using Struts 2.1+ and the reference material you're using is for Struts 2.0. Interceptors are now named using camelCase: modelDriven, servletConfig, etc. (or whatever

Re: Prevent persisting data when validation fails

2009-07-20 Thread Jim Kiley
What are you using to manage persistence? Can we see your action's source code? On Mon, Jul 20, 2009 at 5:42 AM, taltun wrote: > > When submitting a form using manual validation in my action. Even when the > validation fails and the action method supposed to be called is not called > at all, th

RE: null and zero issue

2009-07-20 Thread Russo, Joe
I just put a post out on Enterprise Java Community under web services. Thanks. -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Friday, July 17, 2009 6:51 PM To: Struts Users Mailing List Subject: Re: null and zero issue Russo, Joe wrote: > I know this may not be

Re: Prevent persisting data when validation fails

2009-07-20 Thread taltun
I use JPA (hibernate) to persist. An example of action that use prepare to load a person object from transactional manager. When the validate fails and it return back to the input page the request ends and the transaction persists the dirty user object to database. The dirty user object should

Re: Problem with LoginInterceptor

2009-07-20 Thread mathias-ewald
Hi, yes I am using the latest version of struts2. Most likely the tutorials I used refer to other versions. I set the struts.xml as follows: ---

Re: Prevent persisting data when validation fails

2009-07-20 Thread Greg Lindholm
> I use JPA (hibernate) to persist. > > > > An example of action that use prepare to load a person object from > transactional manager. When the validate fails and it return back to the > input page the request ends and the transaction persists the dirty user > object to database. The dirty user ob

Re: Problem with LoginInterceptor

2009-07-20 Thread mailtolouis2020-struts
I don't think it will preserve your parameter by default, I might be wrong, if it do, then that is another magic in S2 I didn't know that. For what I understand is there are 2 request from the user, 1) http://localhost:8080/projektseminar/rating/Rate?staffResourceId=1 2) login submit I don't thi

Re: Problem with LoginInterceptor

2009-07-20 Thread mathias-ewald
Hi, so what do you suggest? Isn't there any way to do that? cu mathias mailtolouis2020-struts wrote: > > I don't think it will preserve your parameter by default, I might be > wrong, if it do, then that is another magic in S2 I didn't know that. > > For what I understand is there are 2 reque

RE: Struts w/Ajax with Struts again

2009-07-20 Thread Martin Gainty
did you check scope="request" in struts-config.xml as earlier suggested Martin Gainty __ Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein,

Problem with s:text expansion...

2009-07-20 Thread Peter Björkman
Hi! I have an annoying problem with s:text expanding my named resources from the stack. Example: : The desired behavior is that s:text should print the localized text with the key "user.description" and s:property should print the value of user.getDescription() found on the stack. But s:text ma

RE: Problem with Global Exception Mapping

2009-07-20 Thread surya.mulakala
Hi, We are using struts, Spring and Hibernate in our application. For handling exceptions in application, we are using global exception mappings in struts2. Whenever an exception is coming in the application it is taking us to required action and the functionality is working . But in weblogic ser

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-20 Thread Haroon Rafique
On Yesterday at 9:16pm, DC=>Dimitrios Christodoulakis ...: DC> [..snip..] DC> DC> When testing (junit 4) an action implementing the Sessionaware DC> interface (my login and register classes) I noticed that the session DC> object is set to null by BaseStrutsTestCase. This was mentioned before D

Re: Global Exception Handling in struts2

2009-07-20 Thread surya.mulakala
Hi, We are using struts2.1.6, Spring and Hibernate in our application. For handling exceptions in application, we are using global exception mappings in struts2. Whenever an exception is coming in the application it is taking us to required action and the functionality is working . But in weblogic

Re: Prevent persisting data when validation fails

2009-07-20 Thread taltun
Ok. - What is the best way to copy a persistent object ? Using BeanUtil.copy or clone, etc? Greg Lindholm-2 wrote: > >> I use JPA (hibernate) to persist. >> >> >> >> An example of action that use prepare to load a person object from >> transactional manager. When the validate fails and it r

Re: Prevent persisting data when validation fails

2009-07-20 Thread taltun
By the way, how can I let JPA return a deatached object ? I make use of GenericDaoJpa.java which is attached to this message. http://www.nabble.com/file/p24571326/GenericDaoJpa.java GenericDaoJpa.java Greg Lindholm-2 wrote: > >> I use JPA (hibernate) to persist. >> >> >> >> An example of acti

Problem with IE6 after upgrading to 2.1

2009-07-20 Thread Scott Nesbitt
I recently upgraded from Struts 2.0.12 to 2.1.6. Everything works fine in IE8, but IE6 (sometimes) hangs before it finishes downloading everything. One one machine it works with IE6, and on another it hangs. Using Fiddler2 I see that IE6 is not requesting the very last .GIF file on the page t

Re: Global Exception Handling in struts2

2009-07-20 Thread Dave Newton
Did you see the rest of the comment I put in JIRA? Dave surya.mulak...@wipro.com wrote: Hi, We are using struts2.1.6, Spring and Hibernate in our application. For handling exceptions in application, we are using global exception mappings in struts2. Whenever an exception is coming in the app

RE: Global Exception Handling in struts2

2009-07-20 Thread surya.mulakala
Yeah. I have seen it. But I'm not able to understand what you are trying to say. I'm new to struts2. Thanks and Regards, Surya -Original Message- From: Dave Newton [mailto:newton.d...@yahoo.com] Sent: Monday, July 20, 2009 8:27 PM To: Struts Users Mailing List Subject: Re: Global Exceptio

Pb displaying image

2009-07-20 Thread tutu
Hi, I have a pb while trying to display an image that is not in my application but on the file system!! I've tried to put this in my jsp: file:///<%=request.getAttribute( /1.png"> and that too: /1.png"/> /1.png"/> (imageLocation reference D:/images) but nothing is displayed. Does anybody kno

Re: Prevent persisting data when validation fails

2009-07-20 Thread Greg Lindholm
> > By the way, how can I let JPA return a deatached object ? > > I make use of GenericDaoJpa.java which is attached to this message. > http://www.nabble.com/file/p24571326/GenericDaoJpa.java GenericDaoJpa.java > > > See http://stackoverflow.com/questions/31446/detach-an-entity-from-jpa-ejb3-persis

action-method-validation

2009-07-20 Thread Louis Voo
Hi, Does struts2 support action-method-validation ? Regards Louis

Re: Problem with LoginInterceptor

2009-07-20 Thread mailtolouis2020-struts
I'm new in S2, so not much suggestion I can give u now. May be your interceptor store the entire action in the session. Once login success, you get back the action and invoke it again. May be someone can give more better suggestion? Regards Louis From: mathi

Re: Problem with LoginInterceptor

2009-07-20 Thread Paweł Wielgus
Hi all, You can prepare comeback link and put it to session or whereever You like: Map parameters = ServletActionContext.getRequest().getParameterMap(); String redirectLink = namespace+"/"+actionMapping.getName(); if (parameters.size() > 0) { redirectLink += "?"; for (Entry entry :

Re: Prevent persisting data when validation fails

2009-07-20 Thread taltun
Thank you very much!! During my research, I remember some one solved the issue by creating an Struts 2 intercepter. He placed the intercepter right after the validationIntercepter. The job of the intercepter was to check if getActionErrors or getFieldErrors collections was not empty than it close

Re: Pb displaying image

2009-07-20 Thread Jim Kiley
Make sure the image is visible to your webserver, and then use an http://url to access it, rather than a file:// url. jk On Mon, Jul 20, 2009 at 11:08 AM, tutu wrote: > > Hi, > > I have a pb while trying to display an image that is not in my application > but on the file system!! > > I've tried

Re: action-method-validation

2009-07-20 Thread Wes Wannemacher
Yes On Mon, Jul 20, 2009 at 11:45 AM, Louis Voo wrote: > Hi, > > Does struts2 support action-method-validation ? > > > Regards > Louis -- Wes Wannemacher Author - Struts 2 In Practice Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more http://www.manning.com/wannemacher --

Re: action-method-validation

2009-07-20 Thread Jim Kiley
Do you mean, can I write a validateFoo() method for my foo() action method and be sure validateFoo() will run before foo() does? Yes. jk On Mon, Jul 20, 2009 at 11:45 AM, Louis Voo wrote: > Hi, > > Does struts2 support action-method-validation ? > > > Regards > Louis -- Jim Kiley Senior Te

Re: Prevent persisting data when validation fails

2009-07-20 Thread Greg Lindholm
> Thank you very much!! > > During my research, I remember some one solved the issue by creating an > Struts 2 intercepter. He placed the intercepter right after the > validationIntercepter. The job of the intercepter was to check if > getActionErrors or getFieldErrors collections was not empty tha

RE: Tags as template parameters?

2009-07-20 Thread Kawczynski, David
Sitemesh doesn't build the entire page... it is a Filter that grabs the response text (immediately before the servlet container sends it to the client) and adds to it. Decorators contain what is added to the response. I've found that if your decorators require a lot of run-time logic then yes, it

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-20 Thread Dimitrios Christodoulakis
Thanks Haroon for the handy advice. That seems to do the trick as far as the session object is concerned. The test passes now. Would it be easy for someone to extend your code to include actions that implement the -aware interfaces? If I wanted to take a shot at that, is there a particular point yo

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-20 Thread Haroon Rafique
On Today at 4:32pm, DC=>Dimitrios Christodoulakis wrote: DC> Thanks Haroon for the handy advice. That seems to do the trick as far DC> as the session object is concerned. The test passes now. DC> Glad it worked out. DC> DC> Would it be easy for someone to extend your code to include actions

Struts2 framework question.

2009-07-20 Thread sharath karnati
Dear All,      In strust2, we'll use struts.xml file for configuration.      As per my knowledge, when server is started it will load struts.xml file into memory and it will parse this .xml file.  Depending upon URL it will navigates to required class and .jsp file accordingly.      I have simila

RE: Problem with s:text expansion...

2009-07-20 Thread Martin Gainty
Good Evening assume you are loading the properties file as Properties properties = new Properties(); String string; try { properties.load(new FileInputStream("filename.properties")); string = properties.getProperty("user.description"); } catch (IOException e) {

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-20 Thread Dimitrios Christodoulakis
Thanks for clarifying Haroon, Actually the additions you are mentioning sum up the original testing code pretty well. Like I said, from an educational point of view, I think one can learn a lot about the framework itself by studying that article and the comments. Thanks for the "preparable" bit t

RE: unit testing Struts2 application (with Spring and Hibernate)

2009-07-20 Thread Martin Gainty
can you show the code to obtain proxy? could you post the URL for article? Merci Martin Gainty __ Note de déni et de confidentialité Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons a

Re: unit testing Struts2 application (with Spring and Hibernate)

2009-07-20 Thread Dimitrios Christodoulakis
The full article is here: http://depressedprogrammer.wordpress.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/ I think the author's explanations cover a lot. The comments and the subsequent conversations are of value too. On Mon, Jul 20, 2009 at 7:33 PM, Martin Gainty wrote: > > can yo

Re: Prevent persisting data when validation fails

2009-07-20 Thread Burton Rhodes
I had the same problem while using the opensessioninview pattern. Since this pattern in struts uses an interceptor, in the OSiV interceptor I checked to see if validation had failed in an Action. If so, I "rolled back" the transaction to make sure it didn't persist the data. I eventually removed t