Re: How to specify namespace for s:submit.

2009-03-01 Thread Zarar Siddiqi
>  can submit to different actions, I'm just not sure if the
> namespace can be specified.

How? Wouldn't the Struts tag just render a form tag with two different
submit buttons and clicking on either one will invoke the action
defined in the form tag? I don't see how this is 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 actions, I'm just not sure if the
> namespace can be specified.
>
> Dave
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



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 ().

Zarar



On Fri, Feb 27, 2009 at 2:54 PM, Leena Borle  wrote:
> Hi,
>  Probably this questions has been asked before, but could not find answer
> on the list.
>  How do I specify namespace for  tag ? I have two buttons in the
> from and both of them call different action from different name space. These
> are not AJAX actions
>  I tries using  and also tried to give just
> action="/namespace1/MyAction". Does not work.
>  Is this technically possible ?
>
> Thanks
> Leena
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



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 Management
 wrote:
> I have LoggedInInterceptor.java and LoggedInInterceptor.properties in a
> package, how do I use getText from the interceptor to read from the
> properties file?
>
>
>
>
> -
> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
> For additional commands, e-mail: user-h...@struts.apache.org
>
>

-
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org



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 instead of
FreeMarkerPageFilter since I'm not using Freemarker.

If I store something in session under a key called "user", I should be able
to access it like so: ${user} or ${sessionScope.user} inside a JSP page.  It
works fine on standalone JSP pages but not inside decorators.

Any idea what the workaround or fix here is?

Thanks,
Zarar


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 :
> 
> http://localhost:9080/myapp/searchForm.action?mainObj.childObj=xyz&abc=123
> 
> i need to pass to iframe as :
> 
> 
> 
> I can access the abc param as  ,
> but the same doesn't work for 
> 
> Ideally, i would want the entire incoming query string be passed on to the
> iframe- but didn't find anything handy.
> 
> Note  : i can't use the s:action tag in this case, since the result is a
> jasperreport page, and it flushes the response within the result itself ;
> so
> had to go with iframe.
> 
> Any help is appreciated.
> 
> Thanks,
> Joseph
> 
> 

-- 
View this message in context: 
http://www.nabble.com/accessing-url-parameters-in-jsp.-tp14411652p14424668.html
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 response.
> It worked!
>
> 2007/11/28, Eric Martin <[EMAIL PROTECTED]>:
>
> >
> >
> > Agreed...the  is irritating ;)
> >
> > Just to expand on what Dave said...
> >
> > 1) extract the template/simple/inputtransferselect.ftl file from the
> > struts
> > jar.
> > 2) put the file in your classpath, we have it in
> > WEB-INF/classes/template/simple
> > 3) edit the file and remove the . For example:
> > change: ${parameters.leftTitle}
> > to: ${ parameters.leftTitle}
> >
> > HTH
> >
> > -Eric
> >
> >
> > newton.dave wrote:
> > >
> > > You can customize the templates by extracting them
> > > from the jar and putting them in your classpath. The
> > >  thing is irritating.
> > >
> > > d.
> > >
> > > --- Angel Gruev <[EMAIL PROTECTED]> wrote:
> > >
> > >> Hello,
> > >>
> > >> I want to use the css_xhtml theme of struts 2. The
> > >> problem is that by
> > >> default, the  results in HTML of
> > >> Label and input field that
> > >> have  between them.
> > >> This makes it hard to align the lable and the input
> > >> field on the same line
> > >> using css.
> > >> Why is this  tag there?! An how can be removed
> > >> easily?
> > >>
> > >> Thanks!
> > >> Angel Gruev
> > >> Dreamix Ltd < www.dreamix.eu>
> > >>
> > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> > --
> > View this message in context:
> > http://www.nabble.com/css_xhtml-theme---%3Cbr%3E-tf4889135.html#a13995673
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 resource2.properties at the root of your classpath.

Zarar


On Nov 15, 2007 7:09 AM, Dean Pullen <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>
>
> Having a perculiar problem regarding getText() in an action.
>
>
>
> It seems to be returning the key, not its value, even though the key
> exists.
>
> (Which is odd, as the javadocs say getText returns null if key not
> found).
>
>
>
> The action is a login action, not sure if that makes any difference, but
> it shouldn't, everything else works fine except getText.
>
>
>
> Cheers,
>
>
>
> Dean.
>
>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 you're referring to it in
the Spring config.  Also, is your class called HelloWorldAction or
HelloWorld? Just pick one and use that as your Java file name and the
class name.

3. : Usually result is success but I guess you
could actually return ActionSupport.NONE in your action but I get a
feeling you're not doing that either.

Zarar


On 10/18/07, Ádamo Azambuja <[EMAIL PROTECTED]> wrote:
>  i Have this problem and i lost 2 days trying do fix, what can i do in this
> case?
>
> I use java 1.4.2 / Struts 2 J4 / Hibernate and Spring.
>
> i have the HelloWorld.java in the src and src/action to test.
>
>
> *struts.xml *
> 
>
> 
>
> 
> 
> 
> /HelloWorld.jsp
> 
> 
>
> *applicationContext.xml *
> 
>  class="HelloWorldAction" singleton="false">
> 
>
> *web.xml *
> 
> Spring OpenEntityManagerInViewFilter
> 
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
> 
> 
> 
> Spring OpenEntityManagerInViewFilter
> /*
> 
> 
> struts
> org.apache.struts2.dispatcher.FilterDispatcher
>
> 
> 
> struts
> /*
> 
>
> --
> Ádamo B. Azambuja
> JEE Developer
> icq: 112102893
> msn: [EMAIL PROTECTED]
> E-Mail 1: [EMAIL PROTECTED]
> E-Mail 2: [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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
>   
>
>  in index.jsp I've struts logic redirect tag.
>
> 
>
> In struts-config.xml file I've the following in 
>
> 
>
> 
>
>   
>
> And I've the following login action..
>
>  type="com.cingular.cscape.cmps.struts.action.SignOnAction" validate="false">
>   
> 
>
> Once I try to run the following URL in the browser it is saying "Page cannot
> be displayed"
>
> http://localhost:7001/cmps
>
> http://localhost:7001/cmps/login.do
>
> Please advise me if I'm doing any thing wrong.
>
> Thanks,
> Anil
>
>
> --
> View this message in context: 
> http://www.nabble.com/problem-in-%3Cglobal-forward%3E-of-struts-config.xml-file..-tf4642355.html#a13259654
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 right now I'm writing a method to return an internationalised 
> string
> from the resource bundles for use such as this:
>
>  title="${adam:message('trading.catalog.goSomewhere')}">
>Somewhere
> 
>
> For this example I need access to the locale in use.
>
> I suspect that my options are to tap into the S2 framework somewhere or to set
> up a filter to store this stuff in my own ThreadLocal (which wouldn't tie me
> into any version of struts).
>
> Any thoughts on how to achieve this?
>
> Regards
> Adam
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 work.
> Here is my example :
> the bean class and bundle and action class are in the same package,
>
> Bundles name => PersonneFilterBean.properties
>
> Java sources for the bean =>
> ==
>
> package exemple.action.admin;
>
> public class PersonneFilterBean {
>
>private String nom;
>private Integer age;
>
>public String getNom() {
>   return nom;
>}
>
>public void setNom(String nom) {
>   this.nom = nom;
>}
>
>public Integer getAge() {
>   return age;
>}
>
>public void setAge(Integer age) {
>   this.age = age;
>}
> }
>
>
> Java source for the ACTION =>
> ==
>
> public class PersonneFilterAction extends ExempleAction implements
> ModelDriven {
>
>private static final long serialVersionUID = -2355406819601885551L;
>private PersonneFilterBean m_personneFilterBean = new
> PersonneFilterBean();
>
>@Override
>public String execute() throws Exception {
>   getLog().debug("OK success !");
>   return SUCCESS;
>}
>
>public PersonneFilterBean getModel() {
>   getLog().debug("OK success !");
>   return m_personneFilterBean;
>}
> }
>
>
> thanks for help
> --
> View this message in context: 
> http://www.nabble.com/ModelDriven-Resource-Bundle-not-working---tf4588469.html#a13097564
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 the Struts
tags, it finds that on its own (and it's usually .action for Struts 2,
not .do but I guess you might have changed the defaults in
struts.properties)
3. You haven't posted your action definition from struts.xml so I'm
assuming you haven't changed it to somehow exclude the validation
interceptor.

Zarar



On 10/5/07, Guilherme <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to use annotations to validate some fields in my application. The
> code is this:
>
> @Validation
> public class Teste extends ActionSupport {
>
> private Cliente cliente;
>
> @VisitorFieldValidator(message = "")
> public Cliente getCliente() {
> return cliente;
> }
>
> public void setCliente(Cliente cliente) {
> this.cliente = cliente;
> }
>
> @Override
> @SkipValidation
> public String execute() throws Exception {
> // TODO Auto-generated method stub
> return super.execute();
> }
> }
>
> @Validation
> @Entity
> @Table(name="cliente")
> @SequenceGenerator(name = "sqc_cliente", sequenceName = "sqc_cliente")
> public class Cliente {
>
> ...
>
> @EmailValidator(message = "dfdfdf")
> public String getBairro() {
> return bairro;
> }
>
> ...
>
> }
>
> 
> 
> 
> 
>
> These is my configurations do validate data using annotations support.
> Something is wrong because the form is not validated.
>
> Someone can help me to solve this problem ?
>
> Thanks.
>
> --
> Att
> Guilherme Mello do Nascimento [http://guilhermemello.com]
> PortalJava.com - A maior comunidade Java do Brasil
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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.org/2.0.9/docs/freemarker.html

Zarar


On 10/5/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi,
>
>
>
> I hope someone can help me with this problem.
>
> I have a freemarker file where I need to use struts tags to create url.
>
>
>
> My problem is that I don't know what's the correct way to reference the
> struts taglib.
>
>
> My code:
>
>
>
> <#assign s=JspTaglibs["/META-INF/struts-tags.tld"]>
>
>
>
> ">Link here.
>
>
>
> I get this error message:
>
>
>
>
>
> [ WARN] 14:37:59  Can't generate HTML subscription mail; nested
> exception is freemarker.core.InvalidReferenceException: Expression
> JspTaglibs is undefined on line 1, column 12 in mail-html.ftl. []  at
> com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.doLog(Ex
> ceptionMappingInterceptor.java:230)
>
> org.springframework.mail.MailPreparationException: Can't generate HTML
> subscription mail; nested exception is
> freemarker.core.InvalidReferenceException: Expression JspTaglibs is
> undefined on line 1, column 12 in mail-html.ftl.
>
> Caused by:
>
> Expression JspTaglibs is undefined on line 1, column 12 in
> mail-html.ftl.
>
> The problematic instruction:
>
> --
>
> ==> assignment: s=JspTaglibs["/META-INF/struts-tags.tld"] [on line 1,
> column 1 in mail-html.ftl]
>
> --
>
>
>
> Java backtrace for programmers:
>
> --
>
> freemarker.core.InvalidReferenceException: Expression JspTaglibs is
> undefined on line 1, column 12 in mail-html.ftl.
>
> at
> freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
>
> at
> freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:7
> 5)
>
> at
> freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
>
> at freemarker.core.Assignment.accept(Assignment.java:90)
>
> at freemarker.core.Environment.visit(Environment.java:196)
>
> at freemarker.core.MixedContent.accept(MixedContent.java:92)
>
> at freemarker.core.Environment.visit(Environment.java:196)
>
> at freemarker.core.Environment.process(Environment.java:176)
>
> at freemarker.template.Template.process(Template.java:232)
>
> at
> no.finntech.cv.support.FreeMarkerTemplateMailerImpl$1.prepare(FreeMarker
> TemplateMailerImpl.java:93)
>
> at
> org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSender
> Impl.java:344)
>
> at
> org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSender
> Impl.java:336)
>
> at
> no.finntech.cv.support.FreeMarkerTemplateMailerImpl.mail(FreeMarkerTempl
> ateMailerImpl.java:119)
>
> at
> no.finntech.cv.support.EnquiryEmail.sendEnquireEmailToCandidate(EnquiryE
> mail.java:93)
>
> at
> no.finntech.cv.actions.CvListCandidatesAction.sendEnquireEmailToCandidat
> e(CvListCandidatesAction.java:118)
>
> at
> no.finntech.cv.actions.CvListCandidatesAction.enquireCv(CvListCandidates
> Action.java:106)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>
> at java.lang.reflect.Method.invoke(Method.java:597)
>
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActi
> onInvocation.java:404)
>
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(Default
> ActionInvocation.java:267)
>
>
>
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 instead of reloading your page by submitting to
the action again.

If you choose to call the action every time, you can have your action
implement the Preparable interface where you can do the collection
initialization in the prepare() method.

Zarar

On 10/3/07, Jose4u <[EMAIL PROTECTED]> wrote:
>
> In my jsp file i have threecombo boxes.  1 & 2 needs to be loaded
> from the db and the 3rd needs to loaded based on the (2)second combo box
> selection. I have implemented in such a way that in my action i have 3
> collection objects. Intially b4 moving to jsp iam loading two collection
> object values from the db and in the jsp on change event of the (2)second
> list  box i am calling the action class again and loading the third
> collection object with values but my problem is the previous two collection
> object is null. do i need to load the previous two collection objects every
> time on calling the action class? Please provide me the solution how to
> implement in struts2.
>
> Thanks in advance
> joseph
> --
> View this message in context: 
> http://www.nabble.com/struts2-%3Cs%3Aselect%3E-issue--not-retaining..-tf4565452.html#a13031516
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 represented via action annotations.  For
example, package interceptors, global results, multiple execute
methods in the same action etc. etc.

Even if you do manage to represent what you want in annotations as you
have, it quickly turns ugly and you end up wondering why you're even
bothering mucking up your nice and clean action bean with stuff like
contentType, text/xml and paths to FTLs.  struts.xml is a very
powerful little method of making your actions behave any which way you
want and I'd even prefer it over annotations unless you're doing
something very, very basic.

The other issue I think is the lack of the "convention over
configuration" philosophy being used.  For example, if you have have
an action called myAction, there's no reason why by default it
shouldn't look like for something like myAction_success.jsp and
myAction_input.jsp instead of having this specified by the user.  This
idea can be extended to interceptors, global results etc.  I'm just
blurting out what's on the top of my head but there are many more ways
to make Zero Config better.

Thanks,
Zarar


On 10/2/07, Sami Dalouche <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On http://struts.apache.org/2.x/docs/release-notes-209.html, I can
> read : "Please help us test these brave new features. Feedback
> appreciated".
>
> So, here is some feedback about Zero configuration :
>
> - the feature is pretty cool, though not much documented. For instance,
> it was not obvious to me what the "params" parameter meant in the
> @Result annotation, and I had to dig into the source code to understand
> that odd indexes where the keys and even ones where the values...
>
> So, a freemarker view that would return XML would be described as
> @Results( { @Result(name = "success", value =
> "/WEB-INF/views/blabla.ftl", type = FreemarkerResult.class, params = {
> "contentType", "text/xml" }) })
>
> - I have been looking for a way to specify the default package, but it
> looks like I have to manually copy / paste the following line for my
> actions to use the "default" package settings :
> @ParentPackage("default")
>
> - And last, I am experiencing some weird problems... Basically, 9 times
> out of 10, everything is fine, but sometimes, for no particular reason,
> the @ParentPackage("default") line in my actions seem to have no effect
> and the zero-conf Actions use the struts provided default stack, not the
> one that I defined in my default package.. (either the web application
> boots correctly and works for its whole uptime, or it doesn't work at
> all. When it doesn't work, the only way to get it working it by
> rebooting the web application).
>
> I have absolutely no idea about the reasons that could cause that...
> Have you heard of anything similar before ?
>
> Regards,
> Sami Dalouche
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OT, ajax form submission

2007-09-29 Thread Zarar Siddiqi
Well, just because it incorporates Dojo doesn't mean you have to use
it and are forbidden from trying something better.  By default dojo.js
isn't dumped into your JSP/Freemarker pages so it's not like it's
ever-present for him to use and could get in the way.   In all 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 Siddiqi wrote:
> > I really recommend using something like Prototype to do your Ajax
> > stuff.  There's no need to reinvent the wheel and introduce countless
>
> Struts2 incorporates DoJo, so there's not much sense
> adding another Ajax framework
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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, Jose4u <[EMAIL PROTECTED]> wrote:
>
> implementation: I have .jsp in which i have two text box and a Add button.
> whenever i enter something in the two text box and click on Add button the
> values  needs to be added to the html table which is right down the entry
> area with two text boxes. Whenver i Click on add i am calling a Action class
> where i have a colection object in which i add the two text box values to
> the collection object and on SUCCESS comming to .jsp i iterate the
> collection object and display it in the .jsp.
> Problem facing:  Whenever i call the action class and i am adding, its
> adding and displaying in the html table but the next time i add the previous
> values in the collection gets removed At a time only one object is there in
> the collection. The same implementation i did it in Struts 1 it was working
> fine, but in struts 2 its not retaining the values in the collection.Is it
> because for every call a new Action instance is created in Struts2? Is there
> any intercepto i need to use? Please provide me a solution to implement this
> functionality in struts 2
>
> Thanks in advance
> Jose
>
>
> --
> View this message in context: 
> http://www.nabble.com/how-to-avoid-creating-new-Action-class-instance-for-every-request-in-STRUTS2-tf4538022.html#a12952131
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: OGNL in JSP

2007-09-29 Thread Zarar Siddiqi
If the variable you're looking for is stored in the context you will
be able to retrieve it like this in a JSP:

${stack.context['com.opensymphony.xwork2.ActionContext.name']}

If you're using Freemarker then you can simply go:

stack.findString("com.opensymphony.xwork2.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?
>
> On 9/28/07, Zarar Siddiqi <[EMAIL PROTECTED]> wrote:
> >
> > 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".
> >
> > Zarar
> >
> > On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > > Hell, I give up!  Can someone show me how to fetch the action context
> > name
> > > off the value stack from inside a jsp?  This works fine from an action
> > but
> > > doesn't quite follow the java beans convention!
> > >
> > > invocation.getStack().findString("
> > com.opensymphony.xwork2.ActionContext.name
> > > ")
> > >
> > > --
> > > Scott
> > > [EMAIL PROTECTED]
> > >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Scott
> [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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.prototypejs.org/api/ajax/request
http://www.prototypejs.org/api/ajax/options

Good luck,
Zarar

On 9/27/07, Henry Park <[EMAIL PROTECTED]> wrote:
>
>
> I could not get the packaged struts2 ajax implementation to work, so I am 
> trying to go at it with plain javascript. A problem that I am having is that 
> whenever I submit the form, all of my form fields keep getting appended over 
> and over. If I click submit enough, it causes an overflow error. Can you take 
> a look at my code? Thanks.
>
> 
> function retrieveURL(url, target, submitFormFlag, nameOfFormToPost) {
>   var req = getXmlHttpRequest();
>   var method = "GET";
>   if (submitFormFlag) {
> url = url + getFormAsString(nameOfFormToPost);
> method = "POST";
>
>
>   req.setRequestHeader("Content-Type", 
> "application/x-www-form-urlencoded");
>}
>
>
>   req.onreadystatechange = function() {
>   if (req.readyState == 4) {
> if (req.status == 200) {
>   if (req.responseText.length > 0) {
> target.innerHTML = "";
> target.innerHTML = req.responseText;
>   }
> } else {
>   alert("Error encountered. Please contact support.");
> }
>   }
>   req.open(method, url, true);
>   req.send(null);
>   return false;
> }
>
> function getFormAsString(formName){
>   var x = document[formName];
>   returnString = "?1=1";
>   formElements = document[formName].elements;
>   for(var i = formElements.length-1; i >= 0; --i) {
> returnString = returnString + "&" + encodeURI(formElements[i].name) + "=" 
> + encodeURI(formElements[i].value);
>   }
>   return returnString;
> }
>
> function do_submit() {
>   retrieveURL('NameOfAction!list.action', sometarget, true, 'aform');
> }
> 
>
> 
>   
>   
>   
>   
>   
>   
> 
>
> 
>
>
> _
> Connect to the next generation of MSN Messenger
> http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 tried just using *.jsp like the following and see how far you
get?


   action
   *.jsp
   

Zarar


On 9/28/07, Jennie Moeller <[EMAIL PROTECTED]> wrote:
> Thank much Mark,
>
> I talked with a colleague and we're going to give the urlrewrite a try.
> Thanks!
> -Original Message-
> From: Mark McLaren [mailto:[EMAIL PROTECTED]
> Sent: 28 September 2007 12:02
> To: Struts Users Mailing List
> Subject: Re: Mapping a jsp to an action
>
> Hi Jennie,
>
> I am fairly new to Struts 2 but you can certainly do action wildcard
> mappings with it, such as:
>
> 
>   /{1}.jsp
> 
>
> where foo.action would map to foo.jsp.
>
> However, my guess is that what you are asking for is a little bit more
> advanced (and judging by the "*.do" you are not using Struts 2).  You
> might be better to look at using mod_rewrite on apache if you can.
> Alternatively you could create or use something like the URL rewriting
> servlet filter below.
>
> 
>
> A very simple URL mapping servlet would do the trick and look something
> like the servlet below.  I'm sure that  other other here would be able
> to improve on this with some clever one line regular expression but at
> least it gives you an idea of how to do it:
>
> public class UrlMappingServlet extends HttpServlet {
>
> public void doGet(HttpServletRequest req, HttpServletResponse
> resp) throws ServletException, IOException {
> String path=req.getServletPath();
> String queryString = req.getQueryString();
>
> // cut off the extension and leading slash
> int end = path.lastIndexOf(".jsp");
> path = path.substring(1, end);
>
> // split the path into components
> String[] pathcomponents = path.split("/");
>
> // 0 -recipes
> // 1 - number
> String number = pathcomponents[1];
> // 2 - recipe name
> String name = pathcomponents[2];
>
> String destination = "/recipeDetails.jsp"?number="
>+ number + "&name=" + name + "&" + queryString;
> RequestDispatcher rd;
> rd = req.getRequestDispatcher(destination);
> rd.forward(req, resp);
> }
>
> }
>
> Of course, best practice states you should never go directly to a JSP
> url in a Struts app.  You should always go via an action.
>
> HTH
>
> Mark
>
> On 9/28/07, Jennie Moeller <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I'm trying to map a jsp page to an action. When any jsp gets loaded
> > with the recipe path on it I want it to go to an action.
> >
> > for example:
> >
> > This uri: recipes/4735/steak-with-barbecue-sauce.jsp
> >
> > I want it to hit my
> >
> > recipeDetails action
> >
> > My struts action looks like this:
> >
> >  > type="com.pub.actions.RecipeDetailsAction"
> > name="recipeDetailsForm"
> > scope="request"
> >   validate="false">
> >
> >  > path="/WEB-INF/jsp/recipeDetails.jsp" />
> > 
> >
> >
> >
> > My web.xml looks like this:
> >
> > 
> >   action
> >   /recipes/*/*.jsp
> >  
> >
> > 
> > action
> > *.do
> > 
> >
> >
> > any ideas?
> >
> > thanks,
> > Jennie
> >
> >
> > This e-mail (and any attachments) is confidential and may contain
> > personal views which are not the views of the BBC unless specifically
> > stated.
> > If you have received it in error, please delete it from your system.
> > Do not use, copy or disclose the information in any way nor act in
> > reliance on it and notify the sender immediately. Please note that the
>
> > BBC monitors e-mails sent or received.
> > Further communication will signify your consent to this.
> >
>
>
> --
> "Paradoxically, the more time saving abstractions you are using the more
> you actually have to know." - Simon Willison
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
> This e-mail (and any attachments) is confidential and may contain
> personal views which are not the views of the BBC unless specifically
> stated.
> If you have received it in error, please delete it from your system.
> Do not use, copy or disclose the information in any way nor act in
> reliance on it and notify the sender immediately. Please note that the
> BBC monitors e-mails sent or received.
> Further communication will signify your consent to this.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-ma

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".

Zarar

On 9/28/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hell, I give up!  Can someone show me how to fetch the action context name
> off the value stack from inside a jsp?  This works fine from an action but
> doesn't quite follow the java beans convention!
>
> invocation.getStack().findString("com.opensymphony.xwork2.ActionContext.name
> ")
>
> --
> Scott
> [EMAIL PROTECTED]
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 of control (textbox, combobox n all.) in my page..what I want
> is... when user logs in he shud be able to see contorls in editable
> format or noneditable format depending upon his role.
>
> Now in non struts ie. simple jsp page i wud hav done this way
>
> String jsEdit="";
> if(sCurrentUserRoleName.equalsIgnoreCase("Admin")
> {
> jsEdit="class='nonedit' " //nonedit is defined by me!
> }
> else
> {
>jsEdit="class='edit' "
> }
>  <%=jsEdit%>/>
>
> if same thing i wanna do it in struts then ...
>
> /> //yes
> incase of struts i m using styleClass and not class attribute of the
> html:text field
>  above snippet flashes error mark ..saying unterminated html:text tag...m
> sure its not reg. terminating html tag...but there's some way to display
> this control with variable ...please guide me best way..
>
>
> Thanks.:working:
> --
> View this message in context: 
> http://www.nabble.com/style-display-for-html%3Atext-or-any-control-tf4535191.html#a12942693
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 you want to get access to the FreemarkerManager instance in an
action try using the @Inject tag on a setFreeMarkerManager(..) method
in the action.

Zarar

On 9/22/07, Kenton <[EMAIL PROTECTED]> wrote:
>
> If I want to configure Freemarker within Struts 2, how do I access the
> FreemarkerManager instance? Ideally, I would do this one time on startup to
> set global settings for my application.
>
> I see there are some settings that can be configured via
> freemarker.properties, but other options can not.
> --
> View this message in context: 
> http://www.nabble.com/-S2--Freemarker-Configuration--tf4499866.html#a12833400
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 tried this:
>
> 
>
> and I tried this:
>
> 
>  
> 
>
> I know I could do this:
>
> 
> 
>
> but it's not nice. The docs allude to the mechanism but I haven't figured it
> out. I have the constant struts.custom.i18n.resources set in my struts.xml.
>
>
> Regards
> Adam
>
>
> PS for the record, I think it's just that I'm not finding the documentation
> intuitive. For instance I figured out how to prevent the struts form tags from
> outputting HTML table tags but I had to use a search engine. I tried setting 
> the:
>
> struts.ui.theme=""
>
> but that was obviously not the solution. My problem was that I wanted to turn
> the 'themes' feature off. But you don't turn it 'off' - you just turn it 
> down. It's:
>
> struts.ui.theme="simple"
>
> Maybe a line in the taglib docs would make it more obvious?
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Simple Question about FreeMarker + Struts 2

2007-09-08 Thread Zarar Siddiqi
Freemarker considers null references errors.  When
myActionProperty.subProperty is referenced in the Struts tag, it is
printed regardless of its value.  However, when Freemarker encounters
${myActionProperty.subProperty}, it will give you an error if
subProperty is null.  When trying to print 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 a newbie trying learn how to use FreeMarker for Struts result pages.
>
> This code works: <@s.property value="myActionProperty.subProperty" />
> This code triggers a FreeMarker error (expression undefined):
> ${myActionProperty.subProperty}
>
> Obviously, I'm missing something very simple. But what is it?
>
> Is there any way to dump the tree of EL variables so that I can undertand
> better?
>
> Is there any good documentation on using FreeMarker in Struts? I can find
> great documentation on FreeMarker by itself and Struts by itself, but I
> can't find any docs or tutorials on using the two together. Any suggestions?
> --
> View this message in context: 
> http://www.nabble.com/Simple-Question-about-FreeMarker-%2B-Struts-2-tf4394620.html#a12531237
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 API.  Is there a way to get the IP address another way. 
> The RequestAware interface seems to map to only request attributes.
> 
> Thanks,
> S
> 

-- 
View this message in context: 
http://www.nabble.com/ServletRequestAware-tf4369669.html#a12481104
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 like.

Zarar

On 8/30/07, Lane, Ron <[EMAIL PROTECTED]> wrote:
> We're having a problem with Struts2 running under Jrun.
> The 'web application class loader' in Jrun is not finding struts.xml in
> WEB-INF/classes.
> We can put struts.xml in the overall classpath of the Java application
> server, but then that means only one per Java app server.
>
> 1. Has anyone else experienced this problem and have a solution or
> workaround?
> 2. In Struts-1, one could specify a name of the struts config file - is
> there a way in web.xml to specify an alternative name of struts.xml?
> That way each of the web apps can specify its unique name, and even
> though all the config files are in the overall classpath, they can be
> unique per web app by having a unique name.
>
> Ron Lane
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Reload combo option if validation fail.

2007-08-26 Thread Zarar Siddiqi
That would do it too.  But you could've used the info in ActionProxy
in the prepare() method to differentiate between actions.

Later,
Zarar

On 8/20/07, Boon Leng <[EMAIL PROTECTED]> wrote:
>
> Hi Zarar,
>
> I managed to solve the problem by using PreResultListener and find 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()
> > method.
> >
> > http://struts.apache.org/2.x/struts2-core/apidocs/com/opensymphony/xwork2/Preparable.html
> >
> > Zarar
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> View this message in context: 
> http://www.nabble.com/Reload-combo-option-if-validation-fail.-tf4297263.html#a12247320
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 populated from
> database.
> But when validation fail and return to input page (jsp page), I get the
> error where the option value cannot be found.
>
> I know this is because the method (e.g search) is not called to retrieve
> data from database. I tried to use "chain" result type to forward back to
> the main action (e.g list) but I get "Infinite recursion detected" error.
> May I know what is the best way to return to input page and at the sametime
> retrieve data for the select box?
>
> I don't want to store the option value in http session coz this way I need
> to find a way to clean up unuse option value and might get problem is user
> spore multiple tab on browser.
>
> Appreciate is someone can give some guidelines. Thanks.
>
>
> The following is my config and code.
> struts.xml
> -
> 
> /pages/{1}_search.jsp
> /pages/{1}_search.jsp
> welcome.html
> 
>
> Sample_search.jsp
> -
> 
>label="%{getText('user.country')}"
>   list="countryOptions"
>   headerKey="-1"
>   headerValue="%{getText('messages.select')}"/>
>
> 
> 
> 
>
> SampleAction
> -
> public class SampleAction extends ActionSupport {
> 
>
> @SkipValidation
> public String list() throws Exception {
> this.countryOptions = lookupManager.getCountries();
> return SUCCESS;
> }
>
> public String search() throws Exception {
> List results = userManager.findByValueBean(user);
> this.listHolder = new PagedListHolder(results);
>
> return SUCCESS;
> }
>
> 
> }
> --
> View this message in context: 
> http://www.nabble.com/Reload-combo-option-if-validation-fail.-tf4297263.html#a12231644
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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://berkano.codehaus.org/

Zarar


On 8/20/07, Roberto Nunnari <[EMAIL PROTECTED]> wrote:
> Hi all.
>
> I need to implement Authentication and Authorization in
> a S2 web application, and before reinventing the wheel, I'd
> like to ask the list for hints and advice.
>
> 1) Is there built-in support in Struts2 for Authentication and
> Authorization?
>
> 2) What are the best practices for AA in S2?
>
> 3) Is JAAS be a practical way in S2?
>
> More details:
> - The application lets the users dynamically register as members
> - In the application, the members can be part of one of two or three
> groups (roles)
> - unauthenticated users can only view some global data
> - authenticated users can change some of their own data
> - authenticated users can view some of other members data
> - the authenticated users can add global content
> - authenticated users in more privileged roles can change some global data
> - authenticated users in the admin role, can do anything
>
> Thank you.
>
> --
> Robi
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 asking Struts to "intercept" an exception called
somepackage.CustomException but are throwing java.lang.Exception.  So
Struts will just ignore it since the thrown exception is not a
CustomException.  Try throwing CustomException instead of Exception OR
change your Struts config to look for java.lang.Exception.

Zarar

On 8/13/07, Marek Cupak <[EMAIL PROTECTED]> wrote:
>
> i need to configure struts to display user a errpage.jsp, when runtime
> exception CustomException occur anywhere in the application. i've added to
> struts-config:
>
> 
>  type="somepackage.CustomException"
> path="/ErrorPage.jsp"/>
> 
>
> and to web.xml:
>
> 
> 500
> /ErrorPage.jsp
> 
>
> when i browse page _spikeScriptletThrowingEx.jsp:
>
> <%@ page language="java" contentType="text/html; charset=UTF-8"
> pageEncoding="UTF-8"%>
> 
> 
> 
> 
> 
> <% throw new Exception(); %>
> 
> 
>
> i receive only "The website cannot display the page, HTTP 500...". why is
> the ErrorPage.jsp not displayed?
>
> --
> View this message in context: 
> http://www.nabble.com/global-exception-handling---struts-sometimes-ignores-my-setting-in-struts-config%2C-what%27s-wrong--tf4261735.html#a12127828
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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.xml is mapped to myMethod().

Zarar

On 8/9/07, j alex <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a way to declaratively restrict validations depending on the method
> within the Action? - this could be useful for wizard-like forms where each
> step of the wizard has a set of fields ; corresponds to a different method
> but all of them share the same Action.
>
> I can think of having an expression validator based on currentstep added to
> every field short-circuited ; but that's more of a workaround rather than
> the right way to do it.
>
> Thanks,
> Joseph
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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... *hint* *hint* :)
>

Am I crazy or would this be as simple as having a setTextProvider()
method in ActionSupport that would (take a guess..) set the
textProvider which is currently private in ActionSupport.  Then when
you're configuring your actions with say Spring, you could pass your
own TextProvider singleton bean.

Zarar

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 type of
that object is and go from there.  It's simple debugging really.

Zarar



On 8/2/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
>
> Hi all,
> I'm having big trouble while trying to acces to the parameters values.
> I'm simply trying to retrieve a parameter value from my interceptor class.
> The Action class that is intercepted implements the ParameterAware
> interface and has getter and setter method
> related to parameters attribute which is a Map.
> Here is the sample code.
>
> public String intercept(ActionInvocation invocation) throws Exception
> {
>  ActionSupport action = (ActionSupport)
> invocation.getAction();
>  Map session =
> invocation.getInvocationContext().getSession();
>  Map parameters =
> invocation.getInvocationContext().getParameters();
>  String loginAttempt =
> (String)parameters.get(Constants.LOGIN_ATTEMPT_KEY);
>
>
>  return invocation.invoke ();
> }
>
> When the line in bold is reached, I' getting a ClassCastException.
>
> Here is an extract of the stacktrace
>
>
> java.lang.ClassCastException: [Ljava.lang.String; at
> com.natixis.media.interceptors.AuthenticationInterceptor.intercept(AuthenticationInterceptor.java:42)
> at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> at
> com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:221)
> at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:223)
> at
> com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
> at
> com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:221)
> at
> com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:150)
> at
> org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:48)
> at
> com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:86)
> at
> com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling(DefaultActionInvocation.java:224)
> at com.opensymphony.xwork2.DefaultActionInvocation$2.doProfiling
>
> Can someone tells me what I'm missing.
> Thank in advance.
> Meissa
>
> L'integrite de ce message n'etant pas assuree sur internet, Natixis ne peut 
> etre tenu responsable de son contenu. Toute utilisation ou diffusion non 
> autorisee est interdite. Si vous n'etes pas destinataire de ce message, merci 
> de le detruire et d'avertir l'expediteur.
> Ensemble, faisons un geste pour l'environnement : n'imprimons nos mails que 
> si necessaire
>
> The integrity of this message cannot be guaranteed on the Internet. Natixis 
> can not therefore be considered responsible for the contents. Any 
> unauthorized use or dissemination is prohibited. If you are not the intended 
> recipient of this message, then please delete it and notify the sender.
> Let us mind the environment : let's print our mails only when necessary.
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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,
>
> How should I go about obtaining a user's selection in an s:select element 
> from my action's code?
>
> Thanks,
> Session
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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
does all the crazy stuff you need.  

Zarar





Asaf Paris Mandoki wrote:
> 
> On the tutorial says that the framework automatically populates the
> action beans. How does the framework do this? Is there a way to tweak
> the way it populates the the beans?
> 
> For example if a user sends a number and I, for a strange reason would
> like to pupulate the bean with twice that number, how could I do it on
> this level?
> 
> Thanks in andvance,
> Asaf
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Bean-population-tf4002466.html#a11370925
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 follows :
>   name="sessionScope.headerfooterList" sort="list" pagesize="10"
> requestURI="../../../../../displayHeaderFooter.do?actionRequested=displa
> yHeaderFooter" export="true" >
>  
> Everything is working fine except the pdf export. The document keeps
> opening indefinitely even upto around 200MB when the data is very small
> and still does not open.
> All the other exports are working perfectly fine.
> Please help me out.
> Thanks
> Abhi
> 
> 

-- 
View this message in context: 
http://www.nabble.com/display-table-tf3976433.html#a11289299
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 interpreted as a relative path.  Actually, you could even do
that, just make sure all your actions are only one level deep (can't use
/user/blah.action etc.)

If you find a better way, do post the solution. I'm curious.

Zarar



maxmil wrote:
> 
> Thanks for the respones.
> 
> Perhaps i didn't explain myself properly. What i'm really looking for is 
> a way to define the context root url as the base url.
> 
> My motives for doing this is to allow me to share code across my 
> application. An example would be referencing a style sheet in a header 
> include. For examples i could use the line
> 
> 
> 
> in any jsp, irrespective of the request url that i am calling it from.
> 
> Up till now the only solution that i've found is to generate all href 
> values using a combination of s:url and s:properties, like so.
> 
> 
> " />
> 
> This generates a context relative url and works fine but is a bit 
> cumbersome if i have to do it every time i need to generate a url 
> outside struts tags.
> 
> max
> 
> 
> This works fine but h 
> 
> Musachy Barroso wrote:
>> Or the scriptletless version:
>>
>> 
>>
>> musachy
>>
>> On 6/21/07, Van Riper <[EMAIL PROTECTED]> wrote:
>>>
>>> On 6/21/07, Max Pimm <[EMAIL PROTECTED]> wrote:
>>> > I am used to defining a base element in my pages but can't find the 
>>> way
>>> > to define this with struts 2. All suggestions welcome.
>>>
>>> I don't think you need struts 2 support to do this. I'm using webwork
>>> 2.2 currently and starting to monitor this list again in preparation
>>> for migrating our webapp codebase to struts 2. We also use Sitemesh
>>> for response decoration. So, our Sitemesh decorator sets the base
>>> element for our response during the execution of sitemesh response
>>> filter. The way we do it in JSP land is:
>>>
>>> 
>>>
>>> No webapp framework support required. We give the base element an "id"
>>> because we have some javascript functions that need to access the base
>>> document  URL dynamically. This makes it easy to do the element lookup
>>> by id via Javascript elsewhere.
>>>
>>> Cheers, Van
>>>
>>> Mike Van Riper
>>> [EMAIL PROTECTED]
>>>
>>> Silicon Valley Web Developer JUG
>>> https://sv-web-jug.dev.java.net
>>>
>>> -
>>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>>> For additional commands, e-mail: [EMAIL PROTECTED]
>>>
>>>
>>
>>
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/s2%3A-Base-url-in-jsp%27s-tf3958382.html#a11279336
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 your struts.xml that complicated.  

Having it like this:


/jsp/login.jsp


and calling 

Authentification!myMethod.action

is good enough.

Zarar



Cyril Gambis wrote:
> 
> Hi everybody!
> 
> I have a strange behavior while using Struts 2, s:form, and action with
> wildcard. Can you please help me?
> 
> Here is my struts.xml file, with a wildcard mapping, very straightforward:
> 
>  class="com.authentification.AuthentificationAction">
>   /jsp/login.jsp
> 
> 
> When I go to http://localhost:8080/Authentification.action, I got a "no
> action found" error.
> 
> 
> If I change struts.xml file like:
>  class="com.authentification.AuthentificationAction">
>   /jsp/login.jsp
> 
> 
> (I removed the wildcard mapping)
> everything goes fine, the action is found.
> 
> It's surprising since I have another action with a wildcard:
> 
> 
>   /bannersAdministration.jsp
> 
> 
> and it works fine!
> 
> 
> And here is the mysterious part:
> when I have the struts xml version without the wildcard mapping, like:
>  class="com.authentification.AuthentificationAction">
>   /jsp/login.jsp
> 
> 
> and if I have the following in my jsp:
>  >
>   
> 
> 
> everything work perfectly! It calls the action, and the displayQuestion
> method (not the execute method), as if I put a wildcard mapping for this
> action (but I did not, since the action is not found when I put one).
> 
> Isn't all of this very strange?
> 
> My action is:
> 
> public class AuthentificationAction extends ActionSupport {
> 
>   private AuthentificationService loginService = new
> AuthentificationServiceWebServiceImpl();
> 
>   private String alias = "";
>   private String question = "";
>   
>   public String execute() {
>   return display();
>   }
>   public String display() {
>   return SUCCESS;
>   }
>   public String displayQuestion() {
>   
>   question = loginService.getQuestion(alias);
>   
>   return display();
>   }
>   public String getAlias() {
>   return alias;
>   }
>   public void setAlias(String alias) {
>   this.alias = alias;
>   }
>   public String getQuestion() {
>   return question;
>   }
>   public void setQuestion(String question) {
>   this.question = question;
>   }
> }
> 
> Do you have an idea about that?
> 
> Thanks!
> Cyril
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--Action-with-wildcard-not-found-and-strange-behavior-of-s%3Aform-tf3964495.html#a11277516
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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.getRequiredWebApplicationContext(servletContext) 

Zarar


Shibing.Chen wrote:
> 
> Let your Action implements ApplicationContextAware interface.
> 
> On 6/22/07, Paul <[EMAIL PROTECTED]> wrote:
>> Probably a dumb question but does anyone have an example of the best way
>> of obtaining the web application context within a Struts 2 action?
>>
>> I need to lookup and get a bean that I've configured in my spring
>> context.
>>
>> Thanks in advance!
>> Regards,
>> Paul
> 
> 
> -- 
> Think different.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/-S2--%2B-Spring---WebApplicationContext--tf3965475.html#a11277442
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 folders from the
jar file and onto your file system that you give it a different name than
what was in the jar.  If the classloader sees two identical template/theme
folders it will load the first one it sees and if they are named the same it
might be loading the one in the jar and not the one on you want (the one on
the file system).

Does that make sense?

Zarar

On 6/24/07, Mansour <[EMAIL PROTECTED]> wrote:


I am not sure if that's what I need. As I mentioned in my original post,
I have extracted the ajax them to /template/ajax  and modified the
template submit.ftl. The problem now is how to reference this template
from my JSP.

I DON'T want to change the theme. I need it to be ajax for this page.

Musachy Barroso wrote:
> http://cwiki.apache.org/WW/extending-themes.html
>
> musachy
>
> On 6/23/07, Mansour <[EMAIL PROTECTED]> wrote:
>>
>> Hello every one:
>> I couldn't find an answer to this simple question on struts doc site.
>> I need to modify the template for the submit button and remove the 
>> tag surrounding it in ajax theme.
>> I extracted submit.ftl from struts jar (I am using 2.0.6). Did the
>> modification I need, and now can not refrence it from my JSP. I tried
>> using template and templateDir attributes but no luck.
>>
>> The modified template file is in /template/ajax/submit.ftl of my WEBAPP
>> ROOT. Then I moved this directory to WEB-INF and no luck.
>>
>> I tried this template="/template/ajax/submit.ftl" and tried
>> templateDir="/template/ajax" and templateDir="template" but no luck.
>>
>> can some one point out, how to do this.
>>
>>
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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 wrote:
> 
> It appears as though I am not getting a new Action instance created for
> each
> request!  I have placed a logging statement in the constructor of my
> Action
> class and it is not emitting output.  The Bean inside the Action *is*
> emitting log statements from its constructor so I must have the Spring
> beans
> wired correctly.  I am injecting both the Actions and Action Beans via
> Spring.  I have scope=prototype on them both.
> 
> Any ideas?
> 
> Thanks,
> Scott
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Spring-Action-Instantiation-tf3948840.html#a11205652
Sent from the Struts - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 Configuration
http://arsenalist.com/2007/04/04/struts-2-and-zero-configuration-for-actions-and-results/

Form Control Templates
http://arsenalist.com/2007/04/11/struts-2-form-control-templates/

Thanks.
Zarar


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 ′ into an html:text tag



Hi,

I need to show the character "'" (′) inside an html:text tag.

The problem is that the tag html:text renders an html text field 
substituting the escape sequence with the following sequence: ′


It seems that the amperseand is substituted with the sequence &.

Why?

The jstl core tag c:out has the attribute escapeXml="false". Is there 
something similar for html:text/textarea?


Thanks

LuKe


--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
Ab king pro l'unico attrezzo che ti permette di ottenere addominali piatti 
e scolpiti in poche sedute.

* Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=2844&d=21-7

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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


> With this approach, most JSP pages could have a single Java class --
> a SimpleActionForm subclass that handles both validation and
> processing for the page:

Well they certainly wouldn't have a 'single' java class, you
would have
a LOT of them.


Sorry -- I meant a single Java class per JSP page, instead of _two_ Java 
classes (an Action and an ActionForm) per JSP page.



I don't think you meant for that to be abstract. But notice you know
have an execute in all your ActionForms? How is that different than
simply the processing done in different Actions as Struts is now? All
you've done is pushed down the processing to a different place..
ActionForm vs Action.


Yes -- it is supposed to be abstract -- each ActionForm subclass must 
define an execute() method to perform the processing for that form. You're 
right in saying that All I've done is push the processing to a different 
place -- but it's for the purpose of combining the Action and the 
ActionForm to reduce the number of separate Java classes needed for a 
typical Struts app, hopefully reducing complexity.



If you like this approach definitely check out  StrutsDialog.


Thanks for the tip. I took a brief look, but I don't see how StrutsDialogs 
corresponds to what I'm suggesting. It appears to maintain a separation of 
Action and ActionForm, which I am proposing to combine.


Stephen

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 my .jsp say me same (I'm using eclipe)... what should be the troubble?

--
Mariano G. Petrakovsky
Programmer · Software Factory
AXG Tecnonexo -  www.tecnonexo.com

Development facilities:Av. Maipú 1252 8º (C1006ACT) · Buenos Aires ·
Argentina.
Tel.: (54-11) 4878-0005 - Fax: (54-11) 4878-0065.

Headquarters: 1604 Spring Hill Road, Suite 160 Vienna · VA 22182 · USA.
Tel.: (202) 986-7541 - Fax: (202) 787-3891.


· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 
·
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · 
·

· · · ·




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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, and want to access just the
> first object in that Collection.

How about...
   <%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %>
   

--
Wendy Smoak

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning:
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than 
the recipient.  This e-mail may contain information proprietary to Safeway 
and is intended only for the use of the intended recipient(s).  If the 
reader of this message is not the intended recipient(s), you are notified 
that you have received this message in error and that any review, 
dissemination, distribution or copying of this message is strictly 
prohibited.  If you have received this message in error, please notify the 
sender immediately.


==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 using this hacksaw since he had 
used it all his life.  Just as he was about to start cutting the tree 
another woodcutter who had just cut a similar tree walked by with a powerful 
chainsaw and said to him, "Use this to cut your tree, I cut a similar tree 
in five minutes", offering him his chainsaw.   The old woodcutter gave him a 
dirty look and brushed him off saying, "No thanks idiot, I'm a REAL 
woodcutter, I prefer the hacksaw even if it takes me a day"


Which woodcutter is smarter?





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 
bound to a bean in any scope. Also, the 'name' attribute is looking for 
the name of a bean, not a value.


You'll need to bind the request parameter map to a name in some scope 
first I think, something like:





(not tested)

L.

Jose María wrote:


Hi, I think that I do not explained too good.
My idea is pass a Map with multiple keys and values, the html:link
documentation says that you can pass multiple params to an action with a
Map Object in name attribute.

I want to pass the object implicit "param" (Map) defined in Jstl, but I
obtain the error "Can not find bean in any scope".

Well, nothing else, if anyone knows how to do it, please response.

Sample:

http://url/action/show?date=&type=

I want to pass this parameters to other action:


 ...




Thank you in advance¡¡



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 
> preferred way.
> I would like to format it like:
> 
>   DateFormat df = DateFormat.getDateTimeInstance(DateFormat.MEDIUM,
>   DateFormat.MEDIUM, getLocale());
> 
> But how to do that in a JSP?
> 
> thanks,
>Arno
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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:


   
   
   
   Link 
Text.


This will pass name and age to your action.  But this is just appending to 
the querystring.  Save yourself the headache and use a button.


Zarar


- Original Message - 
From: "Rafael Taboada" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Monday, June 20, 2005 12:22 PM
Subject: Re: HTML:LINK


I noticed when I'm using 

Re: HTML:LINK

2005-06-17 Thread Zarar Siddiqi

Let's give credit where credit is due:

http://www.michaelmcgrady.com/button/


- Original Message - 
From: "Michael Jouravlev" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Friday, June 17, 2005 1:57 PM
Subject: Re: HTML:LINK



Yep, a lot 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 Something

When you load the method Map, make sure something like this happens:

public Map getKeyMethodMap() {
  // stuff
  map.put("whatever.dispatch", "Do Something");
  // stuff
  return map;
}

Zarar


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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");
 // stuff
 return map;
}

Zarar



- Original Message - 
From: "Rafael Taboada" <[EMAIL PROTECTED]>

To: "Struts List" 
Sent: Friday, June 17, 2005 10:29 AM
Subject: HTML:LINK


Hi folks I'm programming a module.
This Action class extend LookupDispatchAction and the jsp has several 
button in order to do something. Because it extends LookupDispatchAction 
each time I click on any button I can save the form elements in a session 
var.

All work fine...
But what about if I have a html:link... When user click on the link, I'd 
like to do the same what I do clicking on the button..
If there any possibility to do that???.. I notices when I click on the 
link, the reset method of the ActionForm is called...

Thanks in advance

--
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 html:radio??? Why doesn't work if I use html:radio
instead of input type='radio'
Please... Could u share ur xperiencie in this kind of problem???
Thanks


--
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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 Siddiqi


- Original Message - 
From: "Nitesh" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, June 16, 2005 1:20 AM
Subject: Re: another newbie



Map the action class in the struts config and have the link point to the
action
i.e. - Original Message - 
From: "Anand Vijay" <[EMAIL PROTECTED]>

To: "Nitesh" <[EMAIL PROTECTED]>
Sent: Thursday, June 16, 2005 10:34 AM
Subject: Re: another newbie



Hi

Thanks for the help ...

How to invoke an action class if it is a link ?


Nitesh said the following on 16/06/2005 10:33 AM:


You could populate the combo independently using a logic:iterate tag in
the
JSP
Use a bean/helper to get the values as a collection and pass the same to
the
iterator.

alternate method is to have an action class before the control comes to
the
JSP where in you could get the collection. (Here also you need to use 
the

logic:iterate tag in the JSP)

HTH

Regards

Nitesh

- Original Message - From: "Anand Vijay" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, June 15, 2005 4:00 PM
Subject: another newbie



Hi All

I have a link in my application for user registration form . Form has
combo box that needs to be populated from database. How to achieve 
this?

Where do we write our bean to fetch the data?

Thanks in advance

Regards
Vijay

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



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. 
I had to store the values in session scope (because the ActionForward had 
redirect=true) and then clean up the session in my receiving code.


So you store the values that you are passing in session scope for a quick 
millisecond while you forward and then clean up once you're in the called 
method.


Zarar


- Original Message - 
From: "Frank W. Zammetti" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Cc: "Struts Users Mailing List" 
Sent: Tuesday, June 14, 2005 9:27 AM
Subject: Re: Sending dynamic parameters to a forward



You can, IIRC, append a query string to the URL returned by your
forward... off the top of my head, it would look something like this... in
Action 1:

String param1Val = "someValue1";
String param2Val = "someValue2";
String queryString = "?param1=" + param1Val + "¶m2 = " + param2Val;
ActionForward af = new
ActionForward(mapping.findForward("ForwardToAction2"));
af.setURL(af.getURL() + queryString);
return af;

You'll probably want to encode the parameter values, I'd suggest Commons
Codec for that.

--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Tue, June 14, 2005 7:52 am, tarek.nabil said:

Hi Everyone,

I have an action (Action1) which when completed successfully, forwards
to another action (Action2). I need to be able to send dyanamic
parameters to Action2. I thought about putting the parameters as request
attributes, but the problem here is that Action2 can be called directly
using a link from some pages and this case, the parameters will be send
as request parameters rather than attributes.

I can write code to look in the request attributes and if not found, it
can check the request parameters, but I was hoping there's another way
to do it. I thought about setting the redirect attribute to true on this
forward but I still wouldn't know how to append parameters with dynamic
values to the forward while forwarding to it from Action1.

Any ideas?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]