simulate event on struts 2 tag

2007-10-01 Thread Pablo Vázquez Blázquez
Hi all! I have the following code: s:a id=removeProject theme=ajax notifyTopics=/submitProjectForm loadingText= targets=workspaceAjaxContent executeScripts=true onclick=var a = confirm('Are you sure you want to do this?'); if (a) { var link =

Re: Login implementation, how to forward user to original destination?

2007-10-01 Thread Anton Pussep
First of all thanks a lot for the fast reply. The problem with storing something in the session is it that if the user tried to access two different pages at once in separate windows and had to login in both, he will be forwarded in both to the last page he tried to access. I think this is a

Custom Tag lib passing c:out tags

2007-10-01 Thread Jennie Moeller
I have a custom tag lib i call passing a parameter of a c:out tag. We don't have jsp expression lang supported so i have to use the c:out tag to pass the variable into the custom tag but it doesnt' like it. here is my tag: tag nameencodechars/name

Re: how to return to originating jsp when rendering jasperreport from struts2

2007-10-01 Thread bhanupratap
Hai, Can u please send me your complete code regarding this. -- View this message in context: http://www.nabble.com/how-to-return-to-originating-jsp-when-rendering-jasperreport-from-struts2-tf4108965.html#a12976873 Sent from the Struts - User mailing list archive at Nabble.com.

RE: Custom Tag lib passing c:out tags

2007-10-01 Thread Jennie Moeller
FYI I found a solution if anyone else has this issue: In the custom tag lib where you set your Parameter you need to include this code: try { parameter = (String) ExpressionUtil.evalNotNull(encodechars, parameter, value, String.class, this, pageContext); } catch (Exception

s:select + ajax issue

2007-10-01 Thread Pablo Vázquez Blázquez
Hi everybody! Anyone knows why this code results in an increasing number of threads to RefreshTree action when I use the selector?? script type=text/javascript dojo.event.topic.subscribe(/submitSelectorForm, function(data, type, e) { if (type==before) { //do something

Re: s:select + ajax issue

2007-10-01 Thread Dave Newton
--- Pablo Vázquez Blázquez [EMAIL PROTECTED] wrote: Anyone knows why this code results in an increasing number of threads to RefreshTree action when I use the selector?? Because your submit button listens to the published topic of the select? script type=text/javascript

Re: Login implementation, how to forward user to original destination?

2007-10-01 Thread Paul Benedict
There's no perfect solution. You should choose a first-win or last-win strategy. Paul On 10/1/07, Anton Pussep [EMAIL PROTECTED] wrote: First of all thanks a lot for the fast reply. The problem with storing something in the session is it that if the user tried to access two different pages

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread mikeh96
Thanks for taking the time.. unfortunately, the exceptions are still percolating up. Do you have it working? Brian Trzupek wrote: I am not 100% sure on this, but I think you need to have struts.devMode = false in struts.properties. Give that a whirl. Brian- On Sep 30, 2007,

RE: [S2] FTL Help - Access Properties

2007-10-01 Thread Hoying, Ken
That will work. However, I really need to assign the value to a variable for use later since one cannot nest the tags. I need to perform the @s.text so that I can later use that value in a call to @s.url. I am not sure how I can do that. Any ideas? Thanks in advance! -Original

[OT] displaytag nested tables ...

2007-10-01 Thread Giovanni Azua
Hi all, Can anyone confirm that was able to have displaytag nested tables working in Struts 2? I followed their nested table example. I don't get any errors but it does not work either ... Any experiences? TIA, regards, Giovanni

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley
Is the exception occurring during the call to execute() (or equivalent) business logic method? This is where the exception handler interceptor is applied. It seems like the exception you are receiving is from a rendering phase outside the execution of the actions logic. /Ian mikeh96 wrote:

Re: s:select + ajax issue

2007-10-01 Thread Pablo Vázquez Blázquez
I want to call RefreshTree whenever I change the option in the select menu. So, I´m simulating a submit with an onchange event (or that´s what I would like to). What´s wrong? Dave Newton escribió: --- Pablo Vázquez Blázquez [EMAIL PROTECTED] wrote: Anyone knows why this code results in

Re: s:select + ajax issue

2007-10-01 Thread Pablo Vázquez Blázquez
Well, I have found the solution (at least, my solution). I must destroy topics before publishing it. Pablo Vázquez Blázquez escribió: I want to call RefreshTree whenever I change the option in the select menu. So, I´m simulating a submit with an onchange event (or that´s what I would like

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread mikeh96
thanks for looking. I pasted the full stack trace below. I am not using any home grown action code (yet). This is coming from the DefaultActionSupport during the rendering stage. com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:348) Do I need to

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley
The result is executed after the interceptors and after the action has executed. Look at the invoke() method on the DefaultActionInvocation class. Therefore, because your exception is in rendering the result, the exception is not managed by the interceptor. If you threw the same exception

RE: [S2] ScopedModelDriven issues [newbie]

2007-10-01 Thread Hodgins, Grant
Based on the documentation I didn't think so. The interceptor appears to be correctly persisting the object in the session. It just seems that the model is not being populated on form submission. Is there something obvious I should check to ensure that the model is being properly populated? Is

RE: OT, ajax form submission

2007-10-01 Thread Henry Park
Thank you for recommending Prototype. I am trying it right now, and had a question. When submitting a form (using post), do I have to specify all of the form elements in the parameters tag? Or is there some all encompassing function? Here is what I have: new

Re: Where are the logic: tags?

2007-10-01 Thread Marcos Hernandez
Thanks Cesar, but that's doesn't seems to be what I'm looking for. The c:forEach tag seems to have the same functionality that the s:iterate. What I need is a simple for, something to populate a s:select tag with a long list of consecutive integers, not with the values of a collection. Thanx

Re: OT, ajax form submission

2007-10-01 Thread Randy Jonasz
Hi Henry, Just add the following: postBody: Form.serialize(yourFormId), to your request. On 10/1/07, Henry Park [EMAIL PROTECTED] wrote: new Ajax.Request('Login!show.action', { method:'post', postBody: Form.serialize(yourFormId), onSuccess:

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread mikeh96
Thanks for the clarification. Is the solution of extending VelocityResult and configuring it with a template name to return (e.g. 404.vm) if the requested template throws the ResourceNotFoundException a viable one ? Or is there a way to handle this more elegantly ? thanks again for your

Re: Where are the logic: tags?

2007-10-01 Thread Gabriel Belingueres
To use the s:select tag you need to somehow put the consecutive integers into a collection or Iterator. AFAIK there is no way to define this collection easily using OGNL or JSTL (something like comprehension lists in Haskell). 2007/10/1, Marcos Hernandez [EMAIL PROTECTED]: Thanks Cesar, but

[OT] Re: Where are the logic: tags?

2007-10-01 Thread Dave Newton
c:forEach var=... begin=... end=... step=... --- Marcos Hernandez [EMAIL PROTECTED] wrote: Thanks Cesar, but that's doesn't seems to be what I'm looking for. The c:forEach tag seems to have the same functionality that the s:iterate. What I need is a simple for, something to populate a

Re: Where are the logic: tags?

2007-10-01 Thread Chris Pratt
You should be able to use: c:forEach begin=1 end=10 var=ndx (*Chris*) On 10/1/07, Gabriel Belingueres [EMAIL PROTECTED] wrote: To use the s:select tag you need to somehow put the consecutive integers into a collection or Iterator. AFAIK there is no way to define this collection easily

Setting/Accessing List Size on JSP

2007-10-01 Thread Cory D. Wiles
How do I set/display the size of my list in the result of my jsp? I am able to check for the size in my iterator tag, but I would like to be able to display the size as a property. I have tried the following and it didn't work. s:set name=myListSize value=%{#attr['myList'].size}/ s:property

Struts2 Cookbook Question

2007-10-01 Thread Whitmire, Tracy Carroll
I'd like to use some of the information found in the cookbook http://struts.apache.org/2.x/docs/how-do-i-populate-a-form-bean-and-get- the-value-using-the-taglib.html But I don't see what/where is BeanUtil.setProperties Thanks in advance

RE: OT, ajax form submission

2007-10-01 Thread Henry Park
Thank you Randy, that worked out great. -Henry -Original Message- From: Randy Jonasz [mailto:[EMAIL PROTECTED] Sent: Monday, October 01, 2007 9:40 AM To: Struts Users Mailing List Subject: Re: OT, ajax form submission Hi Henry, Just add the following: postBody:

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley
Yes, that's definitely a valid approach. I guess the question I have is how are you using the feature? It looks like you are simply providing a pass-through to view a velocity template that is the same as the action name. Are you expecting the user to make a request to a template that will

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread mikeh96
You are right... I am just trying to catch those rare events. Now here's something crazy: (and I have checked, and double checked, restarted server, etc). BUT if I add a to my action, the exception mapping WORKS. If I take it away, the exception is not caught. action name=*

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread mikeh96
You are right... I am just trying to catch those rare events. Now here's something crazy: (and I have checked, and double checked, restarted server, etc). BUT if I add a to my action, the exception mapping WORKS. If I take it away, the exception is not caught. action name=*

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread Ian Roughley
I have no ideas about that one :) mikeh96 wrote: You are right... I am just trying to catch those rare events. Now here's something crazy: (and I have checked, and double checked, restarted server, etc). BUT if I add a to my action, the exception mapping WORKS. If I take it away, the

Re: Struts 2: Unable to catch exceptions via global-exception-mappings

2007-10-01 Thread mikeh96
the previous posting seems to not like the \param\ You are right... I am just trying to catch those rare events. Now here's something crazy: (and I have checked, and double checked, restarted server, etc). BUT if I add a lt;paramgt to my action, the exception mapping WORKS. If I take it

Re: Setting/Accessing List Size on JSP

2007-10-01 Thread Gabriel Belingueres
try: s:set name=myListSize value=myList.size()/ 2007/10/1, Cory D. Wiles [EMAIL PROTECTED]: How do I set/display the size of my list in the result of my jsp? I am able to check for the size in my iterator tag, but I would like to be able to display the size as a property. I have tried the

Re: Setting/Accessing List Size on JSP

2007-10-01 Thread Cory D. Wiles
I was able to get it like: s:set name=myListSize value=%{myList.size}/ On 10/1/07, Gabriel Belingueres [EMAIL PROTECTED] wrote: try: s:set name=myListSize value=myList.size()/ 2007/10/1, Cory D. Wiles [EMAIL PROTECTED]: How do I set/display the size of my list in the result of my jsp? I

A try catch and return question

2007-10-01 Thread Zhang, Larry \(L.\)
I have a method having the following structure: public Object myMethod() { try { // some code return theReturnedObject, }catch{ // some code } finally { // some code } } Please let me know if the following version of code

[OT] Re: A try catch and return question

2007-10-01 Thread Cesar Arevalo
The blocks you mention achieve different results. In the FIRST block you will have to add a return statement for when an exception is thrown, this allows you to set the theReturnedObject to a value for when an exception is thrown. In the SECOND block if you are modifying theReturnedObject in

ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
I have a ModelDriven action which controls CRUD operations on JPA managed Entity E. E has a property called ?name? which maps to a database column with a NOT NULL constraint. I have added a RequiredStringValidator annotation to my Action to validate that the ?model.name? property is non-null.

RE: Struts2 Cookbook Question

2007-10-01 Thread Dave Newton
BeanUtil, however, was part of WebWork, IIRC. --- Rod Bollinger [EMAIL PROTECTED] wrote: BeanUtils is part of Apache Commons: http://commons.apache.org/beanutils/ HTH, -Rod -Original Message- From: Whitmire, Tracy Carroll [mailto:[EMAIL PROTECTED] Sent: Monday, October 01,

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Musachy Barroso
If there is a validation error the code on your action shouldn't be executed at all, so you wouldn't have this problem. Are you applying the defaultWorkflow interceptor to your action? regards musachy On 10/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I have a ModelDriven action which

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
True. The action's execute method is not being called. However, in the ModelDriven pattern, the invalid (in my case Null) request parameters are set on the Model during request processing. This is opposed to a non-ModelDriven action where the parameters would be set on Action properties.

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Dave Newton
I haven't tried this, but perhaps changing the order the interceptors are specified is a potential way out. --- [EMAIL PROTECTED] wrote: True. The action's execute method is not being called. However, in the ModelDriven pattern, the invalid (in my case Null) request parameters are set on

Re: Struts URLs for perfectionists like Ebay's URLs

2007-10-01 Thread Emi Lu
Is there a way to hide .action .do by using filter url-pattern? For example, I have the following codes: filter filter-nametutorial/filter-name filter-class org.apache.struts2.dispatcher.FilterDispatcher /filter-class /filter filter-mapping

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Piero Sartini
Since my Model is acquired from the Hibernate session (during the prepare() Action method), it is a transactional persistent instance. Note this from the hibernate documentation: Transactional persistent instances (ie. objects loaded, saved, created or queried by the Session) may be

Re: Struts URLs for perfectionists like Ebay's URLs

2007-10-01 Thread Piero Sartini
Am Montag 01 Oktober 2007 23:33:01 schrieb Emi Lu: Is there a way to hide .action .do by using filter url-pattern? Have a look at http://code.google.com/p/smarturls-s2/wiki/WalkThrough (last paragraph: Extensionless URLs) -

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Musachy Barroso
* instantiate a temporary bean used for the form only: BeanUtils.copyProperties(tempBean, yourBean); That's what I do. musachy -- Hey you! Would you help me to carry the stone? Pink Floyd - To unsubscribe, e-mail: [EMAIL

RE: Struts2 Cookbook Question

2007-10-01 Thread Whitmire, Tracy Carroll
Your memory serves you well. WebWork did have the appropriate class and method. But I don't see it any longer. So how are people doing it now? Migrating an existing project from Struts1 and it seems like it would be a logical step in the process. Maybe not. -Original Message- From:

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
That's an interesting idea Dave. I'm using the paramsPrepareStack. It'll take some investigation to see if that would fix the issue. best, Jon French Programmer ASRC Management Services ECOS Development Team [EMAIL PROTECTED] 970-226-9290 Fort Collins Science Center US Geological Survey 2150

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Dave Newton
--- [EMAIL PROTECTED] wrote: That's an interesting idea Dave. I'm using the paramsPrepareStack. It'll take some investigation to see if that would fix the issue. Shouldn't take much; it might be as simple as adding a validate/defaultWorkFlow up towards the top (although I might try just

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Musachy Barroso
I only use the beanutils.copy solution on a few places, on the other cases I always load the object model on the prepare() method if the id field is set (editing), and then call update or create on the entity manager in my action method. I never got that problem so I'm wondering what is different.

wierd problem

2007-10-01 Thread Henry Park
I am having a wierd problem where my action calls are not forwarding to the correct page. Actually it works one time, but when I try to run the same action again (this time on the same page) it attempts to go to a different action (i.e. INPUT). Here is how I have it set up: struts.xml:

Inheritance within form beans

2007-10-01 Thread Kothari, Kailash
Hello, I have an interesting Struts design requirement and Im a little lost, would really appreciate help ! I have multiple form beans in my application and a lot of them share data. Instead of duplicating the common attributes in each form bean, I am opting for an more elegant approach, i.e.

Re: Inheritance within form beans

2007-10-01 Thread Rick Reumann
On 10/1/07, Kothari, Kailash [EMAIL PROTECTED] wrote: What I also need is that, when a child form bean is instantiated by Struts, I want Struts to check if there is an instance of the parent form bean in the session and if so, pre populate that data from the parent to the child form bean.

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
Thanks Piero: * don't flush the session and destroy the object This is exactly what I want to do. However, the Hibernate session automatically flushes when the EntityManager is closed during the OpenEntityManagerInView filter exit filter operation. I definitely need the filter in place to

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
Yes, musachy. I do something very similar. Here is my prepare() method: public void prepare() throws Exception { if( this.id==0 ) { this.entity = new Entity(); } else { this.entity = this.entityDao.findById(this.id); } } Here is the

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Musachy Barroso
Only difference is that I don't use model driven. Is there any setting to tell hibernate to flush the session when closed or it does that by default? musachy On 10/1/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Yes, musachy. I do something very similar. Here is my prepare() method:

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
Unfortunately, it appears that xworks validation works not on the ServletRequest parameters, but on the properties already set on the Action - or in my case the model bean. So moving the interceptor up the stack would just break validation. From the

Re: ModelDriven CRUD validation failure still causes JPA update

2007-10-01 Thread Jon_French
Yes. It is my understanding the that Hibernate FlushMode MANUAL or NEVER (deprecated) instructs Hibernate to only flush the session when explitly instructed to do so. In my case, I assume this means on a call to EntityManager.flush(). By default, the mode seems to be set to AUTO. I've tried

Re: ModelDriven CRUD validation failure still causes JPA update - RESOLVED

2007-10-01 Thread Jon_French
OK: I've fixed the problem. I'm not sure why this was the case, but here is what was causing the problem: In my ModelDriven action, I had a method like this: public CollectionProjectType getAllProjectTypes(){ return this.projectTypeDao.getAll(); } Notice that instead of

Error: Could not load 'struts.widget.Bind'

2007-10-01 Thread Moacir Cardoso
Hello, I'm getting this error when trying to use ajax theme Error: *Could* *not* *load* '*struts*.*widget*.*Bind*'; *last* *tried* '*__package__*.*js*' Source File: http://localhost:8080/*struts*/dojo/dojo.*js* http://localhost:8080/struts/dojo/dojo.js Line: 94 Searching on google I've

Ajax forms not working

2007-10-01 Thread Moacir Cardoso
Hi, I'm unable to make my ajax form work body div id='two' style=border: 1px solid yellow;binitial content/b/div s:form id=theForm2 cssStyle=border: 1px solid green; action=cadastro/pessoa_salvarEndereco.action method=post theme=ajax input type='text'

Re: Ajax forms not working

2007-10-01 Thread Dave Newton
Do you have an s:head theme=ajax/ tag? --- Moacir Cardoso [EMAIL PROTECTED] wrote: Hi, I'm unable to make my ajax form work body div id='two' style=border: 1px solid yellow;binitial content/b/div s:form id=theForm2 cssStyle=border: 1px solid green;

Re: Struts2 Cookbook Question

2007-10-01 Thread matt.payne
I tend to just make my bean a getter/setter on the action and let the framework take care of it. However, if you are looking for the equivalent to setProperties/copy etc look at xwork's com.opensymphony.xwork2.util.OgnlUtil Matt Whitmire, Tracy Carroll wrote: I'd like to use some of the

[OT] Silicon Valley Code Camp at Foothill College on Oct. 27-28

2007-10-01 Thread Van Riper
This is a free event by and for the developer community in Silicon Valley. I've been promoting this event within the local Java developer community. I'll also be leading one technical session at this Code Camp based on my experiences converting to S2 from WebWork2 and the ways we use S2 now in our