Re: struts2 validation

2008-07-13 Thread Jeromy Evans
Nicole Luneburg wrote: The validate attribute here is used to enable client-side validation only. That will only work if you include the attribute in the page. My setup is that I have an Action class, which uses a Form to set and get f= ield values from the JSP page. In Struts1

RE: Customizing CSS

2008-07-13 Thread Jishnu Viswanath
.class1{ background-color:red; } .class2{ background-color:blue; } Sorry I have not seen your earlier mail, what ever you want to do using class Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., w

struts2 validation

2008-07-13 Thread Nicole Luneburg
Hi all! Been looking all over the net but my validation simply isn't working :( I have a JSP page with a dropdown box in a form. I just want to make sure the value in the dropdown box is not empty. It currently looks like this: My setup is th

Re: [S2] current URL in ValueStack?

2008-07-13 Thread Pierre Thibaudeau
> > The benefit of EL is that your IDE (hopefully) understands it, I wish my MyEclipse JSP editor was as clever as that... (Should I just revert to Eclipse with the correct collection of plugins? or maybe switch to IntelliJ?) In any case, thanks a million!

Re: problem with checkbox (when using disabled property)

2008-07-13 Thread ravi_eze
yes it doesnt. Atleast in version 2.0.9. i heard its fixed in 2.1 version. you can write a reset interceptor also for this. i.e. always (before param interceptor) reset the checkbox field. If there is some checkbox getting submitted then you will get them, else the field would be reset by the inte

Extending Struts Controls - problem

2008-07-13 Thread Narayana S
Hi, I have extended Simple theme (by modifying XHTML theme), implemented the column span for every control as given below. it is working fine. Now to pass these parameters directly within the textfield tag, i have extended org.apache.struts2.views.jsp.ui.TextFieldTag and cr

Re: [S2] current URL in ValueStack?

2008-07-13 Thread Jeromy Evans
Pierre Thibaudeau wrote: But your statement about EL intrigues me. How would you do that in EL? Is there some value available to EL in the request context? simply ${pageContext.request.requestURI} The benefit of EL is that your IDE (hopefully) understands it, which in my opinion is much

Re: [S2] Recipe for Action and View

2008-07-13 Thread ravi_eze
hi, i didnt get you. I have a page for which i need to do some preprocessing to display it. After the page is done by user it has to be processed. Can you please elaborate on the soln given? ravi Gabriel Belingueres-2 wrote: > > Sorry it seems I entered the conversation later and didn't saw t

Re: Customizing CSS

2008-07-13 Thread Narayana S
Hi, Thanks for your reply, but i am talking about UI screen, not a table display. in the screen itself for every control i want to apply an alternate back ground color. for example these two should come with two different background colors. On Thu, Jul 10, 2008 at 3:18 PM, Narayana S

Re: [S2] current URL in ValueStack?

2008-07-13 Thread Pierre Thibaudeau
Hello Jeromy, I thought of your OGNL solution a few minutes ago, just before reading your post. I had been so adamant on finding the value explicitly within the value stack, that I had momentarily forgotten that I had access to the HttpServletRequest object. But your statement about EL intrigues

Re: [S2] current URL in ValueStack?

2008-07-13 Thread Jeromy Evans
Pierre Thibaudeau wrote: (Struts 2.1.2) In the JSP, is it possible through some OGNL expression to get hold of the URL of the current request? I looked through the XML output obtained through debugging, but could not find anything. (I know I can get hold of the action and parameters; so there m

[S2] current URL in ValueStack?

2008-07-13 Thread Pierre Thibaudeau
(Struts 2.1.2) In the JSP, is it possible through some OGNL expression to get hold of the URL of the current request? I looked through the XML output obtained through debugging, but could not find anything. (I know I can get hold of the action and parameters; so there might a complicated way out.

Re: Referring to Properties object via OGNL?

2008-07-13 Thread Jeromy Evans
Dave Belfer-Shevett wrote: In my JSP, I have: Preferred cid is Which, when rendered: Pddreferred cid is (with nothing after it) This expression reads "evaluate perferredcid, then get the value of #attr.properties[evalresult]". I expect you want. so it uses the literal string 'preferre

Re: [S2] action mapping with merely default action

2008-07-13 Thread Jeromy Evans
2008/7/13 Dave Newton <[EMAIL PROTECTED]>: Again, this is if you're intent on using XML configuration. Dave didn't mention that if you're NOT intent on using XML configuration, then the CodeBehind plugin was created exactly for this purpose. http://struts.apache.org/2.x/docs/cod

Re: Referring to Properties object via OGNL?

2008-07-13 Thread Dave Belfer-Shevett
On Sun, 13 Jul 2008, Gabriel Belingueres wrote: Properties implements the Map interface, so AFAIK, it should work accessing it as a Map. Did you tried #attr.mapname[somekey]? Yes... I have an interceptor that does: applicationMap = invocation.getInvocationContext().getApplication(); applicat

RE: Referring to Properties object via OGNL?

2008-07-13 Thread Dave Belfer-Shevett
On Sun, 13 Jul 2008, Martin Gainty wrote: access it with <% ValueStack stack = getStack(); stack.findValue("#attr.someKey"); %> http://www.docjar.com/docs/api/java/util/Stack.html where you put the value.. HashSet,HashMap or Property is up to you.. Doesn't this violate the 'scriptlets are bad'

Re: Referring to Properties object via OGNL?

2008-07-13 Thread Gabriel Belingueres
Properties implements the Map interface, so AFAIK, it should work accessing it as a Map. Did you tried #attr.mapname[somekey]? 2008/7/13 Dave Belfer-Shevett <[EMAIL PROTECTED]>: > I have a situateion where I'm loading application specific settings via a > Properties object on initialization. I'm

Re: [S2] action mapping with merely default action

2008-07-13 Thread Pierre Thibaudeau
Brilliant! Thanks, Dave! 2008/7/13 Dave Newton <[EMAIL PROTECTED]>: > Depending on how your application is laid out you could also put a > "catch-all" mapping at the end of your regular mappings, like so: > > > /static/{1}.jsp > > > Again, this is if you're intent on using XML configuration.

Re: [S2] action mapping with merely default action

2008-07-13 Thread Dave Newton
(Whoops; wrong button.) Depending on how your application is laid out you could also put a "catch-all" mapping at the end of your regular mappings, like so: /static/{1}.jsp Again, this is if you're intent on using XML configuration. Dave --- On Sun, 7/13/08, Pierre Thibaudeau <[EMAIL PROT

Re: [S2] action mapping with merely default action

2008-07-13 Thread Dave Newton
--- On Sun, 7/13/08, Pierre Thibaudeau wrote: > [S1] > > [S2] > > /static/home.jsp > If you're intent on using XML configuration, leave out the class. > > /static/home.jsp > Dave - To unsubscribe, e-mail: [EMAIL PRO

Referring to Properties object via OGNL?

2008-07-13 Thread Dave Belfer-Shevett
I have a situateion where I'm loading application specific settings via a Properties object on initialization. I'm storing the Properties object up into the ApplicationMap (heck it could be in the SessionMap, I'm easy), but i can't seem to switch JSP behaviour based on information in the Prope

[S2] action mapping with merely default action

2008-07-13 Thread Pierre Thibaudeau
With Struts1, if I wished to render a JSP page without bothering with the machinery of an action (yet going through the filters/interceptors), I would have an action mapping as follows: With Struts2, in the same situation, I would do: /static/home.jsp This

Re: Struts Text & Property together(s:text and s:property

2008-07-13 Thread Jeromy Evans
Jishnu Viswanath wrote: Hi all, I would like to achieve something like this /> If your action extends ActionSupport, or implements TextProvider, or a TextProvider is in the ValueStack, then you can call one of the various getText() methods to access resources. Something like the

RE: question about submitting checkboxes

2008-07-13 Thread Jishnu Viswanath
Eric, If you are using struts 2, Eric have u tried s:checkboxList ?? Syntax: If its just a Boolean object ignore the key value :D Regards, Jishnu Viswanath Software Engineer *(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll Tavant Technologies Inc., www.tavant.com PEOPLE :: P

Struts Text & Property together(s:text and s:property

2008-07-13 Thread Jishnu Viswanath
Hi all, I would like to achieve something like this /> I know this code is not going to work; in short the name that should come is inside a property, Eg:- someProperty = "my.text.label" gives me my.text.label give me the value I wanted. But how can I get both at same time? Any one

Re: question about submitting checkboxes

2008-07-13 Thread Jeromy Evans
Eric Hamacher wrote: Hello: I have a form on which there can, in theory, be an infinite number of checkboxes (Users are selecting files from a tree and there is no telling how many will be selected). The name of each checkbox is determined at runtime (= to the path of the file). That being

Re: Thoughts of using explicit regexps instead of wilcards for action mappings?

2008-07-13 Thread Jeromy Evans
Karr, David wrote: "MyStuff_(add|save|load|delete)", that is still more concise than having Has anyone ever considered this? I threw this together but don't use it any more: http://code.google.com/p/struts2urlplugin/ You can plugin a regex matcher (default) or plaintext or others. Aft

Re: CodeBehind and index action?

2008-07-13 Thread Jeromy Evans
Paul Benedict wrote: Does the CodeBehind plugin allow me to specify a default action for a directory? So that way I can just do /dir instead of /dir/index.action? If not, how can I do it? I want any directory to go invoke index.action I am using Struts 2.0.11 Paul No, that's a feature of t