Re: Excaption Handling in Struts 2

2007-04-05 Thread Dave Newton
--- ChristopherAngel wrote: How do I call an action before going to that page? This is untested, but AFAICT you should be able to have the result be whatever type you want, so perhaps you could send it to a type='action-redirect'? http://struts.apache.org/2.x/docs/exception-interceptor.html

Re: Excaption Handling in Struts 2

2007-04-05 Thread ChristopherAngel
Looks like you're right. I now have: global-results result name=Exception type=chainexception/result /global-results global-exception-mappings exception-mapping exception=java.lang.Exception result=Exception/ /global-exception-mappings

S2: Passing paramaters with autocompleter

2007-04-05 Thread Scott Nesbitt
I am trying to use the Ajax autocompleter and would like to pass some parameters. This is my JSP: form id=selectForm s:url id=autosports action=LookupSports includeParams=all s:param name=key value=SearchString/ s:param name=value value=yarr/ s:param name=context

Re: resume after login feature

2007-04-05 Thread meeboo
I'm kind of stumped on this problem too, how can I send the original request uri to the login action so that it knows what page to redirect to? Jae K wrote: Hello all, this is a struts2 question. I'm trying to implement a feature where a custom AuthenticationInterceptor would redirect

Re: resume after login feature

2007-04-05 Thread Dave Newton
--- meeboo [EMAIL PROTECTED] wrote: I'm kind of stumped on this problem too, how can I send the original request uri to the login action so that it knows what page to redirect to? Which is the problem; getting the original request, or sending data to the action? Sending data to the action

Re: S2: Passing paramaters with autocompleter

2007-04-05 Thread Musachy Barroso
You can use the formId attribute, like: form id=dataForm //fields here /form s:autocompleter formId=dataForm .. / and it will pass the fields of the form as paramteers when the autocompleter is loaded. musachy On 4/5/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I am trying to use the Ajax

Re: resume after login feature

2007-04-05 Thread meeboo
Yeah Dave, the problem is passing the data. I have my Login.java action class which implements ServletRequestAware but it'll of course only retrieve localhost:8080/login.action since that's the request URI. I need to somehow tell it which location the user tried to login from so that it can

Re: Action Validator ans s:url...

2007-04-05 Thread stanlick
Thanks Ted. Let us suppose for a moment there are no parameters passed with the URL. Is there an S2 pulley or chain I can tug on to bypass the validation? Maybe this is not a case where I should be using a S2 tag? It strikes me as odd that a hyperlink not related to the form would be

[S2] Validation setup

2007-04-05 Thread Skip Hollowell
I had the whole validation thing working great, and then I had to go and get 'fancy' with my Actions and aliases, and now, I can't seem to get my validator xml files named correctly... !-- Use Case 01 -- action name=Account_* class=com.skip.action.AccountAction method=list

Re: resume after login feature

2007-04-05 Thread Dave Newton
--- meeboo [EMAIL PROTECTED] wrote: Yeah Dave, the problem is passing the data. I have my Login.java action class which implements ServletRequestAware but it'll of course only retrieve localhost:8080/login.action since that's the request URI. I need to somehow tell it which location the

Re: Action Validator ans s:url...

2007-04-05 Thread Dave Newton
--- [EMAIL PROTECTED] wrote: It strikes me as odd that a hyperlink not related to the form would be intercepted by the form validator. Meh; if an action is Validatable then it's Validatable, you know? I have to agree with Ted--if you're passing a parameter that's being used by the method, why

Re: [S2] Validation setup

2007-04-05 Thread Dave Newton
--- Skip Hollowell [EMAIL PROTECTED] wrote: I had the whole validation thing working great, and then I had to go and get 'fancy' with my Actions and aliases, That'll teach ya'! AccountAction_payment-validation.xml doesn't work AccountAction_Payment-validation.xml doesn't work Are the

Re: resume after login feature

2007-04-05 Thread meeboo
Gotcha Dave... now all I need is clean URL:s before I can actually consider using this damned framework :) Dave Newton-4 wrote: --- meeboo [EMAIL PROTECTED] wrote: Yeah Dave, the problem is passing the data. I have my Login.java action class which implements ServletRequestAware but

Re: resume after login feature

2007-04-05 Thread Dave Newton
--- meeboo [EMAIL PROTECTED] wrote: Gotcha Dave... now all I need is clean URL:s before I can actually consider using this damned framework Clean URLs? FYI, the source for org.apache.struts2.interceptor.ServletConfigInterceptor shows how to access the request, from which you can grab the

Re: S2: Passing paramaters with autocompleter

2007-04-05 Thread Scott Nesbitt
Thank you, Musachy! I did overlook that option, my state parameter is passing great now. I also figured out why the string I typed into the autocomplete field had a value but no key: I forgot to put name=team in the s:autocomplete tag. Once I did that it worked fine. Thanks again, Scott ---

Re: [S2] Validation setup

2007-04-05 Thread Skip Hollowell
Dave Newton-4 wrote: --- Skip Hollowell [EMAIL PROTECTED] http://www.nabble.com/user/SendEmail.jtp?type=postpost=9857845i=0 wrote: AccountAction_payment-validation.xml doesn't work AccountAction_Payment-validation.xml doesn't work Are the underscores typos? No typos. I am grasping at

Re: [S2] Validation setup

2007-04-05 Thread Dave Newton
--- Skip Hollowell [EMAIL PROTECTED] wrote: Dave Newton-4 wrote: Skip Hollowell said: AccountAction_payment-validation.xml doesn't work AccountAction_Payment-validation.xml doesn't work Are the underscores typos? No typos. So how can I turn on the validation for this form / action /

Re: [S2] Validation setup

2007-04-05 Thread Skip Hollowell
Dave Newton-4 wrote: --- Skip Hollowell [EMAIL PROTECTED] http://www.nabble.com/user/SendEmail.jtp?type=postpost=9858550i=0 wrote: Dave Newton-4 wrote: Skip Hollowell said: AccountAction_payment-validation.xml doesn't work AccountAction_Payment-validation.xml doesn't work Are the

Re: Action Validator ans s:url...

2007-04-05 Thread stanlick
Maybe you missed the part about *not* passing a parameter with the link url? I am experimenting with a few ideas to minimize writing too many Action classes by leveraging the wildcard method feature. This link allows an item to be deleted and the parameter being passed is a read-only hibernate

Re: Action Validator ans s:url...

2007-04-05 Thread Ted Husted
How the link is generated isn't relevant. Once the response hits the browser, everything is in HTML, and the framework is no longer involved. When the client clicks the link, it sends back a GET for the resource. If the action resource has been configured for validation, then validation fires. By

Re: Action Validator ans s:url...

2007-04-05 Thread Dave Newton
--- [EMAIL PROTECTED] wrote: Maybe you missed the part about *not* passing a parameter with the link url? Maybe I was answering your *first* question? This link allows an item to be deleted and the parameter being passed is a read-only hibernate id that was loaded into the page during the

Re: Action Validator ans s:url...

2007-04-05 Thread stanlick
Ted -- This is a great explanation! Can you add to this how Validator naming works with respect to wildcard methods? For instance: CourseAction list() create() Course-validation.xml and supposedly support for something like Course-create-validation.xml I think I remember reading

form filed populated wrongly

2007-04-05 Thread Guna
Hi, I have two jsp pages with different form bean. on first jsp page, i have field called LastName. on first jsp page if user press cancel the request. the user is navigated to second jsp page which has also a field called lastName. The problem is what ever value i enter on first jsp page

How to get a attribute value of map value?

2007-04-05 Thread Felipe Rodrigues
Hi guys, I have this case now, and I'm not getting take the value of a map value attribute. Let me explain better. I have a class: class Mov{ private String att; public String getAtt(){ return att; } } and I put it inside a java.util.Map, like Map test = new HashMap();

Re: Action Validator ans s:url...

2007-04-05 Thread Ted Husted
The WebWork bang notation for calling methods doesn't support per-method validations. However, the Struts-style wildcards do support per-method validations. Validations can be specified just as if the method name had been hardcoded in the configuration. The syntax is

Re: Action Validator ans s:url...

2007-04-05 Thread Dave Newton
--- Ted Husted [EMAIL PROTECTED] wrote: Note that it is the action name not the method name. (Though, I often wonder if the method name would make more sense.) Sakes alive, really?! Hmm, I wonder if I've just been naming things luckily up 'til now--I may have to rename some validation files,

Re: Struts 2 URL mapping

2007-04-05 Thread cilquirm
You actually can do that with the default mapper, using wildcarding. Here's an example of what we do : action name=view/* class=com.thestreet.cms.web.actions.story.ViewAction param name=id{1}/param /action The only trick is that you have to remember to suffix your url appropriately

Re: Struts 2 URL mapping

2007-04-05 Thread cilquirm
You actually can do that with the default mapper, using wildcarding. Here's an example of what we do : action name=view/* class=com.thestreet.cms.web.actions.story.ViewAction param name=id{1}/param /action The only trick is that you have to remember to suffix your url appropriately

Re: Struts 2 URL mapping

2007-04-05 Thread cilquirm
You actually can do that with the default mapper, using wildcarding. Here's an example of what we do : action name=view/* class=com.thestreet.cms.web.actions.story.ViewAction param name=id{1}/param /action The only trick is that you have to remember to suffix your url appropriately

Re: How to get a attribute value of map value?

2007-04-05 Thread cilquirm
The second way, %{test['AnyString'].att} or even, explicitly, %{test['AnyString'].getAtt()} should both work. I know it might sound dumb, but is there a value to att? ( using that class as an example, there's no way to set it :-) -a Felipe Rodrigues wrote: Hi guys, I have this case

Re: request.getParameterValues OGNL ?

2007-04-05 Thread cilquirm
Hi, Does s:iterator value=#request['email'] id=email ... /s:iterator not work for you? Will Berger wrote: How does one in struts 2 process a list of req parameters using ognl? In jsp, this gets the job done. % String emailList[] = request.getParameterValues(email));

Re: [S2] Validation setup

2007-04-05 Thread Skip Hollowell
OK, I think I may be on to something here... In this particular Action, I am working with a Payment class, instead of individual fields. that may very well be where all of my trouble is. s:form namespace=/irmc action=Payment_retrieveFee validate=true s:textfield key=payment.amtToPay /

Struts2..Problems with getText() in jsp files

2007-04-05 Thread Jeff C
hi, I've spent the last couple of weeks migrating our site from webwork 2 to struts 2. The Struts 2 version of the app worked fine on my windows machine, as well as in our qc environment (apache/tomcat 5). However, when we rolled the code to the production servers, we encountered a rather major

Re: Struts 2 and JSTL (XML)

2007-04-05 Thread Brian Thompson
Yeah, it's possible. Just declare both taglibs in your jsps, like this: %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c % %@ taglib uri=http://java.sun.com/jsp/jstl/fmt; prefix=fmt % %@ taglib uri=http://java.sun.com/jsp/jstl/sql; prefix=sql % %@ taglib uri=/struts-tags prefix=s %

S2: Better passing of fields by link

2007-04-05 Thread Scott Nesbitt
I have a link that calls an action and I would like the action class to have some field values from my page. Currently I do this: s:url id=editUrl action=EditLineup includeParams=all/ s:a href=%{editUrl} onclick=this.href=rewriteLink(this.href)Edit Lineup/s:a In rewriteLink() I manually create

Re: S2: Better passing of fields by link

2007-04-05 Thread Musachy Barroso
What problem are you having? Just do: s:a theme=ajax formId=form .. / like what you did for the autocompleter, there are a few examples on showcase also. musachy On 4/5/07, Scott Nesbitt [EMAIL PROTECTED] wrote: I have a link that calls an action and I would like the action class to have

Re: How to get a attribute value of map value?

2007-04-05 Thread Mark Menard
On 4/5/07 1:34 PM, Felipe Rodrigues [EMAIL PROTECTED] wrote: %{test['AnyString'].att} prints nothing and finally I've used this technique to access the properties of entities stored in a Map. (http://www.vitarara.org/cms/node/81) Are you sure that the att attribute has something in it? Mark

STRUTS2 Resource Bundles

2007-04-05 Thread Love, Andrew
Hello, I would like to add a resource bundle to the path for validation messages. The bundle must load from a path that does not follow the Package hierarchy defined in struts2. The textProvider in the ActionSupport class is private so I cannot directly add the bundle from an Action class.

Re: Action Validator ans s:url...

2007-04-05 Thread stanlick
Ted -- I think the method name validation naming would be more intuitive. Thanks, Scott On 4/5/07, Ted Husted [EMAIL PROTECTED] wrote: The WebWork bang notation for calling methods doesn't support per-method validations. However, the Struts-style wildcards do support per-method

S2: Design Input suggestion

2007-04-05 Thread Harring Figueiredo
Folks: I have a form that is rendered by calling an action from a get or a put. In edit mode, the fields are pre-populated from the POJO (param to get the POJO is passed on the URL GET). In create mode, the fields are, of course, empty. The design issue I am having has to do with the

Re: upload fail occasionally

2007-04-05 Thread torben
I have now done some more studies by making my own fileUploadInterceptor class. It is complety the same as org.apache.struts2.interceptor.FileUploadInterceptor, except that I write in the log the class name of the HttpServletRequest I get in the intercept method. If I bypass apache as

Re: Action Validator ans s:url...

2007-04-05 Thread Dave Newton
--- Ted Husted [EMAIL PROTECTED] wrote: Note that it is the action name not the method name. (Though, I often wonder if the method name would make more sense.) Apparently I've just been lucky (and had fewer method-specific validations than I thought :/ so far. Having the validation files key

Re: Struts 2 + Spring 2 + JPA + AJAX Tutorial Issue

2007-04-05 Thread Peter Milne
On Wed, 2007-04-04 at 20:12 -0400, Musachy Barroso wrote: oopsI had to upload a new one, overwriting the old one doesn't fix it: http://cwiki.apache.org/confluence/download/attachments/33168/quickstart_maven2.zip musachy On 4/4/07, Peter Milne [EMAIL PROTECTED] wrote: I'm getting

Re: Action Validator ans s:url...

2007-04-05 Thread Ted Husted
On 4/5/07, Dave Newton [EMAIL PROTECTED] wrote: Turns out the annotations are class-based as well (again, I had just been lucky so far)... If the validation files were based off of method names the annotations could be as well, which would be a nice, unified view of things, IMO. The validation

Re: Action Validator ans s:url...

2007-04-05 Thread Dave Newton
--- Ted Husted [EMAIL PROTECTED] wrote: The validation comes out of XWork, so we'd have to file a ticket over there. My guess is that it wouldn't be worth it; it's easy enough to see the need for the existing way of doing it and it's not *that* much more work. I guess. :/ If anybody else chimes

MVC 2 design, how to

2007-04-05 Thread mansour77
Hello every one: I am trying to write a little application to familiarize myself with struts 2. I am trying to design the application using mvc2. the application is nothing but a small utility for invoices. It store, retrieves and update invoices. Each invoice belongs to an Account in the DB.

Re: Action Validator ans s:url...

2007-04-05 Thread stanlick
Actually annotations do work at the method level. On 4/5/07, Dave Newton [EMAIL PROTECTED] wrote: --- Ted Husted [EMAIL PROTECTED] wrote: Note that it is the action name not the method name. (Though, I often wonder if the method name would make more sense.) Apparently I've just been lucky

struts controller with JSF view

2007-04-05 Thread Keith Easterbrook
Hi, Our team is dealing with a technology decision and I was hoping to get some advice. Some members would like to use JSF for the entire MVC, and some would very much like the injection from Struts 2. We have decided that the view will be JSF, but the controller is still up in the air. This is

Re: MVC 2 design, how to

2007-04-05 Thread Ted Husted
It sounds like that you might want to use the ModelDriven approach, where the AccountManager is the model object. I was surprised to find that there doesn't seem to be a page or FAQ with regard to using ModelDriven. Essentially, all you need to do is place a model property on a base Action

Re: S2: Better passing of fields by link

2007-04-05 Thread joey
I think you want the a tag having the ajax function like the autocompleter tag. You can just use ajax lib javascript like dojo to achieve it. There is the snippet: function dojoForm(form) { var kw = { mimetype: text/plain, encoding:

Re: Action Validator ans s:url...

2007-04-05 Thread Dave Newton
--- [EMAIL PROTECTED] wrote: Actually annotations do work at the method level. That's what I thought too :/ I must be doing something toopid, and I would have sworn I did this before (but I already made one huge mis-assumption about my validations); hopefully it'll be obvious to a fresh set of

Re: S2: Better passing of fields by link

2007-04-05 Thread Musachy Barroso
I think it is easier just to use the anchor tag from the ajax theme, which already does this. regards musachy On 4/5/07, joey [EMAIL PROTECTED] wrote: I think you want the a tag having the ajax function like the autocompleter tag. You can just use ajax lib javascript like dojo to achieve it.

Re: struts controller with JSF view

2007-04-05 Thread Gary VanMatre
From: Keith Easterbrook [EMAIL PROTECTED] Hi, Our team is dealing with a technology decision and I was hoping to get some advice. Some members would like to use JSF for the entire MVC, and some would very much like the injection from Struts 2. We have decided that the view will be

Re: S2: Better passing of fields by link

2007-04-05 Thread joey
Yes,your method is easier,I just missed your reply. regards joey On 4/6/07, Musachy Barroso [EMAIL PROTECTED] wrote: I think it is easier just to use the anchor tag from the ajax theme, which already does this. regards musachy On 4/5/07, joey [EMAIL PROTECTED] wrote: I think you want the a

Re: S2: Design Input suggestion

2007-04-05 Thread joey
I don't think you should turn on validation in edit mode or create mode. Validation is only needed in save mode. edit mode or create mode is just to show field data,no submit. You can set validation only work for save mode like this: Addinterceptor-ref name=crudStack param

autocompleter with JSON plugin

2007-04-05 Thread Rohit Dewan
I have the following in the body: @s.url id=foos value=foosList.action / @s.form theme=ajax action=addTest method=add @ s.autocompleterModel theme=ajax href=%{foos} name=foo / @s.submit value=OK action=addTest method=add/ @ s.submit value=Cancel

Re: How to get a attribute value of map value?

2007-04-05 Thread Felipe Rodrigues
Yeah, I know. I'll make some others test. I just aked to make discart a OGNL syntax error. So if it is the correct form, so I need figure out what value is getting to att. And yes, My class has the setAtt method. Actually, this value comes from database using boxSQL framework.

Re: How to get a attribute value of map value?

2007-04-05 Thread Felipe Rodrigues
hum... I thought it could be the right way, because print nothing is better than print it as a literal. I'll debug a little more to find the error. Thanks anyway. Mark Menard wrote: On 4/5/07 1:34 PM, Felipe Rodrigues [EMAIL PROTECTED] wrote: %{test['AnyString'].att} prints nothing and

Re: How to get a attribute value of map value?

2007-04-05 Thread Felipe Rodrigues
So, in the link you sent me, I found this: myEntitiesMap['%{id}'].value It is used to change the value of some Entitie inside the Map. How to put some entitie inside the Map using OGNL? One more question.Where could I found out when to use %{} or #? Thanks, Felipe Mark Menard wrote: On

Help: JSP and Java 5 enum

2007-04-05 Thread Paul Benedict
Has anyone ever compared or iterated a Java 5 enum in JSP? I want do the following: c:if test=${obj.enumProperty == enum} I don't mind comparing ordinals too, but I must be able to do a comparison. Thanks! Paul - To

FreeMarker evaluating result of s.url?

2007-04-05 Thread River Tarnell
hello, i have a FreeMarker template which looks like this: @s.url id=viewurl includeParams=none action=view title=title.text / a href=${viewurl}View/a as long as title.text contains simple text, this works fine: it outputs a href=.../view.action?title=whatever. however, if the literal

Re: Help: JSP and Java 5 enum

2007-04-05 Thread Paul Benedict
I found the answer. The Apache JSTL implementation automatically coerces the r-value to an enum. So the below example works as wanted. Paul Benedict wrote: Has anyone ever compared or iterated a Java 5 enum in JSP? I want do the following: c:if test=${obj.enumProperty == enum} I don't mind

Re: STRUTS2 Resource Bundles

2007-04-05 Thread Aram Mkhitaryan
Add struts.properties next to struts.xml and add global resources like struts.custom.i18n.resources=com.xyz.MyResourceBundle,com.xyz.props also see here for more details http://struts.apache.org/2.0.6/docs/how-do-i-set-a-global-resource-bundle.html Best, Aram On 4/6/07, Love, Andrew [EMAIL

Re: WildCards and Results

2007-04-05 Thread Aram Mkhitaryan
As Ted wrote those methods should return Strings which will determine the result to be shown. String myCustomMethod() { if(1) return result1; else return result2; } action name=sample method=myCustomMethod result name=result1/pages/course1.jsp/result result