Re: How to specify namespace for s:submit.

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

Re: How to specify namespace for s:submit.

2009-02-28 Thread Zarar Siddiqi
s:submit/ submits a s:form/. 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

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

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

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 url is

Re: css_xhtml theme - br

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

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

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 how

Re: problem in global-forward 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: global-forwards forward name=welcome path=/login.do redirect=true/ /global-forwards action path=/login type=com.cingular.cscape.cmps.struts.action.SignOnAction validate=false forward name=success

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

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 to

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

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: servlet servlet-nameJspSupportServlet/servlet-name servlet-classorg.apache.struts2.views.JspSupportServlet /servlet-class

Re: struts2 s:select 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

Re: OT, ajax form submission

2007-09-29 Thread Zarar Siddiqi
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 Siddiqi wrote: I really recommend using

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

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 c:set 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

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: 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:

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=558805view=markup They include stackand ognl. Zarar

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=12740736framed=y If

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} /#if I know, it's a bit of a pain. Zarar Siddiqi On 9/6/07, Kenton [EMAIL PROTECTED] wrote: I'm a newbie trying learn how to use

Re: [S2] struts tags

2007-09-08 Thread Zarar Siddiqi
s:submit theme=simple value=%{getText('category.edit.cancelButton')}/ 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?

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

Re: Reload combo option if validation fail.

2007-08-26 Thread Zarar Siddiqi
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() method. http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony

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:

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.

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: action name=myAction class=MyActionClass method=myMethod.../action

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

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: 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 as

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

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

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)

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: link rel=stylesheet type=text/css href=${pageContext.request.contextPath}/css/myStyles.css / If you're using Freemarker, its even easier, just use ${base} like this:

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

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

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

2005-07-21 Thread Zarar Siddiqi
Have you tried storing it in a variable using using c:set and having escapeXml=false and then putting that variable inside the value attribute of the html:text tag? - Original Message - From: lk [EMAIL PROTECTED] To: user@struts.apache.org Sent: Thursday, July 21, 2005 12:40 PM

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 user@struts.apache.org Sent: Monday, July 11, 2005 2:26 PM Subject: I can't initialize de Serlvet Action :( Throw an exception ServletAction

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 user@struts.apache.org Sent: Monday, July 11, 2005 3:56 PM Subject: RE: Putting execute() in ActionForm

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 ActionForm,

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

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: user@struts.apache.org 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

Re: HTML:LINK

2005-06-20 Thread Zarar Siddiqi
Short answer: No. You can't use html:link/ 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: a href=# onClick=document.forms['myForm'].submit();/my link/a If you're not getting user input and simply

Re: localisation of Dates

2005-06-20 Thread zarar . siddiqi
You can use the fmt library. It adjusts to your locale. jsp:useBean id=currDate class=java.util.Date/ fmt:formatDate value=${currDate} type=date dateStyle=full/ 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

Re: HTML:LINK

2005-06-17 Thread Zarar Siddiqi
Link looks like: html:link action=/whatever.do?action=Do Somethinghi/html:link 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

Re: HTML:LINK

2005-06-17 Thread Zarar Siddiqi
. SimpleDispatchAction indeed looks much simpler: http://wiki.apache.org/struts/StrutsCatalogDispatchActionImproved On 6/17/05, Zarar Siddiqi [EMAIL PROTECTED] wrote: Link looks like: html:link action=/whatever.do?action=Do Somethinghi/html:link Make sure you have following

Re: another newbie

2005-06-16 Thread Zarar Siddiqi
=${pageContext.request.contextPath}MyAction.do to achieve this. Using html:link takes care of that. Zarar Siddiqi - Original Message - From: Nitesh [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Cc: [EMAIL PROTECTED] Sent: Thursday, June 16, 2005 1:20 AM Subject: Re

Re: Pass parameter to javascript function

2005-06-16 Thread Zarar Siddiqi
Shot in the dark, try this: html:radio idName='lista' onclick='setBusquedaProveedor(${idProveedor},${strRazonSocial})' property='idProveedor' value='idProveedor' / - Original Message - From: Rafael Taboada [EMAIL PROTECTED] To:

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