Re: How to specify namespace for s:submit.

2009-03-01 Thread Zarar Siddiqi
possible without the use of JavaScript? On Sun, Mar 1, 2009 at 8:52 AM, Dave Newton wrote: > Zarar Siddiqi wrote: >> >> submits a .  If you want your two submit buttons >> to call two different actions, you'll need two different forms. > > can submit to different

Re: How to specify namespace for s:submit.

2009-02-28 Thread Zarar Siddiqi
submits a . If you want your two submit buttons to call two different actions, you'll need two different forms. If you can't do that then you could have an onclick handler for both the submit buttons and depending on which one the user clicks, you can change the action value of the form (). Zar

Re: getText from an interceptor

2009-02-26 Thread Zarar Siddiqi
If your actions are extending ActionSupport than you can go like so: public String intercept(ActionInvocation invocation) throws Exception { String message = ((ActionSupport) invocation.getAction()).getText("resource.key") ... } Zarar On Thu, Feb 26, 2009 at 12:23 PM, Security M

Using JSP 2.0 syntax inside Sitemesh decorator

2008-09-24 Thread Zarar Siddiqi
I can't believe I haven't run into this issue before but I just noticed that you can't use JSP 2.0 syntax inside a Sitemesh decorator. My Sitemesh config is exactly like as described here: http://struts.apache.org/2.x/docs/sitemesh-plugin.html The only difference is that I'm using PageFilter ins

Re: accessing url parameters in jsp.

2007-12-19 Thread Zarar Siddiqi
Well, you could just use the pageContext variable to get the query string like so: ${pageContext.request.queryString} Zarar strutstwouser wrote: > > Hi, > > I need to access certain url parameters and pass them on as the query > string > to an iframe within the jsp > > So, if the incoming

Re: css_xhtml theme -

2007-12-05 Thread Zarar Siddiqi
A much easier way to do this would be to apply a CSS style like this: div.wwgrp br { display: none; } See this old blog post: http://arsenalist.com/2007/04/11/struts-2-form-control-templates/ On Dec 5, 2007 9:14 AM, Angel Gruev <[EMAIL PROTECTED]> wrote: > Thank you both for the quick respo

Re: getText returning message key

2007-11-16 Thread Zarar Siddiqi
Make sure that you have a property called struts.custom.i18n.resources defined in struts.properties which refers to the resource bundles that you're using. For example: struts.custom.i18n.resources=resource1,resource2 The above would look for resource bundles called resource1.properties and reso

Re: struts There is no Action mapped for namespace / and action name

2007-10-18 Thread Zarar Siddiqi
Problems that I see: 1. Spring bean is defined as "helloWorld" but referred to as "HelloWorld" in Struts config (case is incorrect). 2. You're saying that your action class is under src/action so I would think the fully qualified name of the class might be action.HelloWorldAction but that's now h

Re: problem in of struts-config.xml file..

2007-10-17 Thread Zarar Siddiqi
Try putting the redirect="true" on the global forward instead of the action forward like this: The rest seems OK. Zarar On 10/17/07, Srhan <[EMAIL PROTECTED]> wrote: > > Hi, > I've web.xml file in which I've index.jsp as my welcome files list. > > index.jsp >

Re: static access to request / response / page context objects?

2007-10-12 Thread Zarar Siddiqi
Looks like you need a dose of ServletActionContext: http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html Zarar On 10/11/07, Adam Hardy <[EMAIL PROTECTED]> wrote: > I'm writing a few static methods to use as taglib functions in my JSPs, in > particular r

Re: ModelDriven Resource Bundle not working ?

2007-10-08 Thread Zarar Siddiqi
I thought you could only specify properties files for action beans, not model ones. So in your case try specifying PersonneFilterAction.properties Zarar On 10/8/07, pilou <[EMAIL PROTECTED]> wrote: > > hi > I noticed that the property bundles named with the Model Bean class name > does not seem

Re: Using annotations

2007-10-07 Thread Zarar Siddiqi
Well, a couple things pop into one's mind: 1. Why are you using the @SkipValidation on the execute() method, this is telling Struts NOT to validate calls to this action. 2. Your action is called teste.do which is a little fishy because usually the extension (.do) doesn't need to be specified in th

Re: Trouble with using struts tags in freemarker files

2007-10-05 Thread Zarar Siddiqi
I load it using the following: <#assign s=JspTaglibs["/struts-tags"]> You'll also need to load the JspSupportServlet: JspSupportServlet org.apache.struts2.views.JspSupportServlet 1 Look at the section called "Tag Support" here: http://struts.apache.o

Re: struts2 issue- not retaining..

2007-10-03 Thread Zarar Siddiqi
Yeah, you're going to have to load them every time. You could store the collections in session or application scope if that's feasible but other than that you don't really have a choice. Alternately, I think the cleanest way of doing this might be to make an Ajax call to load the third selection

Re: [Struts 2] : Zero Configuraiton : some feedback

2007-10-02 Thread Zarar Siddiqi
I think the Zero Configuration idea is a nice idea but the implementation is far from sufficient and will probably get better over time (hopefully). The problem mainly is with the limit of annotations. There are things that can be represented in struts.xml that have no chance of being represente

Re: OT, ajax form submission

2007-09-29 Thread Zarar Siddiqi
my Struts apps I use Prototype/Scriptaculous for the Ajaxy features, I don't see anything wrong with that. Besides, Prototype is lightweight, easy-to-use, tested and has excellent documentation, hence the suggestion. Zarar On 9/29/07, Oleg Mikheev <[EMAIL PROTECTED]> wrote: > Zarar Sid

Re: how to avoid creating new Action class instance for every request in STRUTS2

2007-09-29 Thread Zarar Siddiqi
If you're using Spring you could define your action bean as a singleton and that would do the trick since the same instance would always be reused. Note that this is pretty crazy in most cases, you're probably better off storing our objects in session scope like Chris suggested. Zarar On 9/29/07

Re: OGNL in JSP

2007-09-29 Thread Zarar Siddiqi
ActionContext.name") But you're right in if what you're looking for is stored in some place other than the context then it seems difficult to retrieve it using JSP. On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Yes, but how does solve this problem? > &

Re: OT, ajax form submission

2007-09-28 Thread Zarar Siddiqi
I really recommend using something like Prototype to do your Ajax stuff. There's no need to reinvent the wheel and introduce countless bugs in the process, Prototype is tested for all relevant browsers and it'll take you 10 minutes to do what you're trying to do if you use it: http://www.prototyp

Re: Mapping a jsp to an action

2007-09-28 Thread Zarar Siddiqi
Am I crazy or is Jennie using Struts 1.x and Mark just proposed a solution for 2.x? Jennie, your web.xml servler-mapping is overriding each other, you're first saying you want /*/*.jsp sent to action but then you're saying you want *.do's sent to action? I'm not too sure if that's valid. Have you

Re: OGNL in JSP

2007-09-28 Thread Zarar Siddiqi
Did you know you have all the variables declared in this class as public static final at your disposal: http://svn.apache.org/viewvc/struts/struts2/tags/STRUTS_2_0_9/core/src/main/java/org/apache/struts2/views/util/ContextUtil.java?revision=558805&view=markup They include "stack"and "ognl". Zara

Re: style display for html:text or any control

2007-09-28 Thread Zarar Siddiqi
It's been a while since I've used Struts 1.x but did you try using to set a variable and them dump it in cssStyle using ${} syntax? If not that, you could always add the CSS class to the input field using JavaScript. Zarar On 9/28/07, prem_gadgetquest <[EMAIL PROTECTED]> wrote: > > I have lots

Re: [S2] Freemarker Configuration?

2007-09-24 Thread Zarar Siddiqi
I'm not sure what you want to do with the FreemarkerManager instance but if you're looking to do things like build results programmatically, my posting where I answered my own question on the Freemarker User list might be helpful: http://www.nabble.com/forum/ViewPost.jtp?post=12740736&framed=y If

Re: [S2] struts tags

2007-09-08 Thread Zarar Siddiqi
Zarar On 9/6/07, Adam Hardy <[EMAIL PROTECTED]> wrote: > I am using struts tags for the first time in a JSP with S2 and I haven't found > what I'm looking for so I guess it's not available, but could I just check for > certain? > > I want to put a string into a button using an i18n bundle. I tr

Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Zarar Siddiqi
Freemarker variables using the $ or # syntax, you should probably do an if check like this: <# if myActionProperty.subProperty?exists> ${myActionProperty.subProperty} I know, it's a bit of a pain. Zarar Siddiqi On 9/6/07, Kenton <[EMAIL PROTECTED]> wrote: > > I'm

Re: ServletRequestAware

2007-09-04 Thread Zarar Siddiqi
Try this guy: http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/ServletActionContext.html stanlick wrote: > > I have an action that determines the requester IP address. The action > implements ServletRequestAware, but I don't like it being all tangled up > in the Servlet

Re: Can you specify the name of struts.xml for Struts2?

2007-08-30 Thread Zarar Siddiqi
The struts.configuration.files property in struts.properties at the root of your classpath can specify struts configuration files using a comma separated list, by default this property is set to: struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml You can change it if you l

Re: Reload combo option if validation fail.

2007-08-26 Thread Zarar Siddiqi
nd the > action info in ActionProxy. > Now I can load the collections base on method and result type :) > Thanks for your help. > > Regards, > Boon Leng > > > Zarar Siddiqi wrote: > > > > You could implement Preparable and load countryOptions in the prepare()

Re: Reload combo option if validation fail.

2007-08-20 Thread Zarar Siddiqi
You could implement Preparable and load countryOptions in the prepare() method. http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html Zarar On 8/20/07, Boon Leng <[EMAIL PROTECTED]> wrote: > > In my form, I have a select box which get the option value populate

Re: Authentication and Authorization in S2

2007-08-20 Thread Zarar Siddiqi
If you're using Spring, it's probably a great idea to use Acegi Security to handle authentication/authorization. I can't think of anything it can't do. http://www.acegisecurity.org/ There's also Berkano which doesn't do nearly as much as Acegi but can handle most general AA problems: http://ber

Re: global exception handling - struts sometimes ignores my setting in struts-config, what's wrong?

2007-08-13 Thread Zarar Siddiqi
Struts isn't catching this exception because you're throwing it in a JSP page which is being accessed outside the Struts servlet (directly via a URL). Try throwing the exception in a Struts action and see what happens. But even if you do that you'll run into a problem with the current setup. You'

Re: S2 : Validation per Action method - ideas?

2007-08-09 Thread Zarar Siddiqi
Specify your validation rules in a file called MyActionClass-myAction-validation.xml where MyActionClass is the action class and myAction is the name of the action being executed. So your struts.xml would look something like: ... With this setup the validation in MyActionClass-myAction-validation

Re: [s2] Is it possible to replace/supplement i18n resolution logic?

2007-08-04 Thread Zarar Siddiqi
> Well, if your Action class implements TextProvider (as does > ActionSupport), then you can resolve keys any way you'd like. As for > plugging/altering the existing lookup that is used by ActionSupport, > it really isn't possible right now, and I've love to see a patch > making that more flexible

Re: [S2] ClassCastException on getParameters

2007-08-04 Thread Zarar Siddiqi
Why can't you access the HttpServletRequest object using ServletActionContext.getRequest() and then just use the getParameter() method to get the request parameters? If you're getting a ClassCastException it's because you're casting something that isn't a String to a String. Find out what the typ

Re: obtaining a user's selection in a s:select object

2007-08-03 Thread Zarar Siddiqi
The same way you would get a textfields. If your select box can allow for multiple selections, declare a String[] array in your action class and the selected values will map to it. Don't forget the getter and setters. Zarar On 8/3/07, Session A Mwamufiya <[EMAIL PROTECTED]> wrote: > Hi again, >

Re: Bean population

2007-06-29 Thread Zarar Siddiqi
That magic starts happening in http://struts.apache.org/2.0.8/struts2-core/apidocs/com/opensymphony/xwork2/interceptor/ParametersInterceptor.html ParametersInterceptor . Take a look at the javadocs and source to see how its done. You could then extend the class or write a new interceptor which

Re: display table

2007-06-25 Thread Zarar Siddiqi
This is more a displaytag question than a Struts one really but make sure you have the IText jar in your classpath and that you've setup your displaytag filter correctly (which should be the case since your other exports are working) Zarar abhi_kaul wrote: > > Hi! > I am using display table

Re: s2: Base url in jsp's

2007-06-24 Thread Zarar Siddiqi
If you're just trying to get the context path, you can just use ${pageContext.request.contextPath}. That way you can just write: If you're using Freemarker, its even easier, just use ${base} like this: You can't just specify "css/myStyles.css" as the value of the href tag as that will be in

Re: [S2] Action with wildcard not found and strange behavior of s:form

2007-06-24 Thread Zarar Siddiqi
The only mysterious part here is figuring out why you would want to use ! in your action name. The default behavior of Struts 2 is for the URL http://localhost:8080/actionName!myMethod.action to actually execute myMethod instead of execute() when the action is called so you don't need to make you

Re: [S2] + Spring - WebApplicationContext?

2007-06-24 Thread Zarar Siddiqi
That'll work but if you want to use one line to get it, use this: http://www.springframework.org/docs/api/org/springframework/web/context/support/WebApplicationContextUtils.html#getRequiredWebApplicationContext(javax.servlet.ServletContext) WebApplicationContextUtils.getRequiredWebApplicationCont

Re: extending a template

2007-06-24 Thread Zarar Siddiqi
You might want to post your JSP code. But I thinks specifying the 'template' and 'theme' attributes of your JSP tag should do the trick. I blogged about this a while back: http://arsenalist.com/2007/04/11/struts-2-form-control-templates/ Also make sure that when you extract your template/theme

Re: Spring Action Instantiation

2007-06-19 Thread Zarar Siddiqi
It sounds to me like your Action class might be configured as a singleton. If that's the case the action class' constructor would only be called once on startup. Make sure you have singleton="false" in your Spring config for the action class. The default value for singleton is true. stanlick

Documentation added to Wiki

2007-06-19 Thread Zarar Siddiqi
I've just added a few links to the Wiki that show how to deal with some common issues when using Struts. Unit Testing http://arsenalist.com/2007/06/18/unit-testing-struts-2-actions-spring-junit/ Validation http://arsenalist.com/2007/05/10/struts-2-validation-using-annotations/ Zero Configuratio

Re: How to put the sumbol ′ into an html:text tag

2005-07-21 Thread Zarar Siddiqi
Have you tried storing it in a variable using using and having escapeXml="false" and then putting that variable inside the value attribute of the tag? - Original Message - From: "lk" <[EMAIL PROTECTED]> To: Sent: Thursday, July 21, 2005 12:40 PM Subject: How to put the sumbol ′ int

Re: Putting execute() in ActionForm

2005-07-11 Thread Zarar Siddiqi
I think the ideal that you're searching for is "one class per view". Take a look at JSF. - Original Message - From: "Schaub, Stephen" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Monday, July 11, 2005 3:56 PM Subject: RE: Putting execute() in ActionForm Rick Reumann

Re: I can't initialize de Serlvet Action :(

2005-07-11 Thread Zarar Siddiqi
The trouble is that you're not saying much. - Original Message - From: "Mariano Petrakovsky" <[EMAIL PROTECTED]> To: "Lista de correo de Struts" Sent: Monday, July 11, 2005 2:26 PM Subject: I can't initialize de Serlvet Action :( Throw an exception ServletAction can't load... In

Re: How to access the first item in a Collection in a JSP?

2005-07-06 Thread Zarar Siddiqi
Wel, I catually have something like form.cards[0].cardNumber, but it is also not an array. It is a collection. Doesn't matter, it works for both as long as you got a getCardNumber() in there. Wendy Smoak wrote: From: "Mick Knutson" <[EMAIL PROTECTED]> > I have a Collection in my ActionFo

Re: Is there any Jsp template like Smarty template ?

2005-06-29 Thread Zarar Siddiqi
Sun's Creator Studio rulez the inexpensive Java IDE world; JetBrain's IDEA rulez the $300+ IDEs. Eclipse isn't worth a shit. But REAL programmers prefer ed or vi. ~mark An old woodcutter once had to chop down a very large tree and all he owned was a hacksaw. He was really really good at us

Re: How to pass Jstl param implicit Object to html:link

2005-06-21 Thread Zarar Siddiqi
Make sure params is of type java.util.Map. - Original Message - From: "Laurie Harper" <[EMAIL PROTECTED]> To: Sent: Tuesday, June 21, 2005 12:48 PM Subject: Re: How to pass Jstl param implicit Object to html:link 'params' is a JSTL implicit object; I don't think it's required to be

Re: localisation of Dates

2005-06-20 Thread zarar . siddiqi
You can use the fmt library. It adjusts to your locale. Zarar On Tue, 21 Jun 2005, Arno Schatz wrote: > Hi, > > How do I present a Date in the users locale in a JSP? > > I tried > > but the format is not ok. When I use the format attribute it won't show up in > the locale > prefer

Re: HTML:LINK

2005-06-20 Thread Zarar Siddiqi
Short answer: No. You can't use and submit values entered in input elements to your action without using Javascript. As Wendy said, you can use a simple link and do this: my link If you're not getting user input and simply passing data through using then you can do something like this:

Re: HTML:LINK

2005-06-17 Thread Zarar Siddiqi
t of work. SimpleDispatchAction indeed looks much simpler: http://wiki.apache.org/struts/StrutsCatalogDispatchActionImproved On 6/17/05, Zarar Siddiqi <[EMAIL PROTECTED]> wrote: Link looks like: hi Make sure you have following in ApplicationResources.properties: whatever.dispatch=Do Somethin

Re: HTML:LINK

2005-06-17 Thread Zarar Siddiqi
Link looks like: hi Make sure you have following in ApplicationResources.properties: whatever.dispatch=Do Something When you load the method Map, make sure something like this happens: public Map getKeyMethodMap() { // stuff map.put("whatever.dispatch", "Do Something");

Re: Pass parameter to javascript function

2005-06-16 Thread Zarar Siddiqi
Shot in the dark, try this: - Original Message - From: "Rafael Taboada" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" Sent: Thursday, June 16, 2005 10:18 AM Subject: Re: Pass parameter to javascript function Finally I found a desesperated solution :'( But what happend with

Re: another newbie

2005-06-16 Thread Zarar Siddiqi
Using my action link is probably better. This way you wont' have to worry about the context path of your application. might not work since the action is preceded by the context path. You would have to do something like: to achieve this. Using takes care of that. Zarar Si

Re: Sending dynamic parameters to a forward

2005-06-14 Thread Zarar Siddiqi
Where do you see the af.setURL(String) method in the ActionForward class? http://struts.apache.org/api/org/apache/struts/action/ActionForward.html I had a similar problem where dynamic values needed to be passed in via an ActionForward but I wasn't able to find something as simple as you suggest