Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 10 Jul 2009 20:08:33 -0000 Issue 8744

user-digest-help

2009-07-10


Author LoginPost Reply

user Digest 10 Jul 2009 20:08:33 -0000 Issue 8744

Topics (messages 200578 through 200598):

Re: preselect value for radio tag
 200578 by: Dale Newfield
 200579 by: Bhaarat Sharma

Avoiding param in URL when action-redirect....
 200580 by: anand nandu
 200590 by: Musachy Barroso

Re: Actions are not Garbage Collected
 200581 by: Musachy Barroso
 200582 by: Martin Gainty
 200583 by: Anselmo
 200584 by: Dale Newfield
 200585 by: Musachy Barroso
 200586 by: Martin Gainty
 200587 by: Anselmo
 200588 by: Dale Newfield

Re: For s:textfield tag how to get value for title attribute from resource bundle.
 200589 by: wkbutler

Re: Passing runtime exp into tag
 200591 by: Peter Bliznak

Re: Help with JSP and javascript
 200592 by: Security Management
 200593 by: Wes Wannemacher
 200597 by: Martin Gainty

Re: Stripping Out Characters (Parenthesis)
 200594 by: Ratner Glenn A
 200596 by: Avlesh Singh

assigning a JSP variable a value coming from <s: property>
 200595 by: Farshad Rabbani
 200598 by: Musachy Barroso

Administrivia:

---------------------------------------------------------------------
To post to the list, e-mail: user@(protected)
To unsubscribe, e-mail: user-digest-unsubscribe@(protected)
For additional commands, e-mail: user-digest-help@(protected)

----------------------------------------------------------------------


Attachment: user_200578.ezm (zipped)
Bhaarat Sharma wrote:
> I have a very simple radio tag like following
> <s:radio label="correctOption" name="correctAnswer" id="correctOption"
> list=" #{'1':'1','2':'2','3':'3','4':'4'}"
> value="questionVo.correctAnswer"/>
>
> questionVo.correctAnswer returns 2. So I want the second radio button to be
> preselected but it is not happening. I even tried:
>
> <s:radio label="correctOption" name="correctAnswer" id="correctOption"
> list=" #{'1':'1','2':'2','3':'3','4':'4'}" value="%{1}"/>
>
> but that does not work either.
>
> what am I doing wrong?

http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
Also, "%{1}" evaluates to a number, whereas "%{'1'}" evaluates to a char
and '%{"1"}' evaluates to a string.

-Dale


Attachment: user_200579.ezm (zipped)
ah HAA
thats was my problem. the datatypes were different.

Thanks

On Fri, Jul 10, 2009 at 12:37 PM, Dale Newfield <dale@(protected):

> Bhaarat Sharma wrote:
>
>> I have a very simple radio tag like following
>> <s:radio label="correctOption" name="correctAnswer" id="correctOption"
>> list=" #{'1':'1','2':'2','3':'3','4':'4'}"
>> value="questionVo.correctAnswer"/>
>>
>> questionVo.correctAnswer returns 2. So I want the second radio button to
>> be
>> preselected but it is not happening. I even tried:
>>
>> <s:radio label="correctOption" name="correctAnswer" id="correctOption"
>> list=" #{'1':'1','2':'2','3':'3','4':'4'}" value="%{1}"/>
>>
>> but that does not work either.
>>
>> what am I doing wrong?
>>
>
>
> http://struts.apache.org/2.1.6/docs/why-wont-the-if-tag-evaluate-a-one-char-string.html
> Also, "%{1}" evaluates to a number, whereas "%{'1'}" evaluates to a char
> and '%{"1"}' evaluates to a string.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_200580.ezm (zipped)

I have a mapping like this.
<result name="input" type="redirectAction" >
dispAcctTypePage
${accBean.zipCode}
</result>

But the param come in url which is a security risk. please help how to
eliminate param in browser URL.
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_200590.ezm (zipped)
you can chain to the next action, in that case the url will not change.

musahcy

On Fri, Jul 10, 2009 at 9:51 AM, anand nandu<anand8412@(protected):
>
> I have a mapping like this.
> <result name="input" type="redirectAction" >
> dispAcctTypePage
> ${accBean.zipCode}
> </result>
>
> But the param come in url which is a security risk. please help how to
> eliminate param in browser URL.
> --
> View this message in context: http://www.nabble.com/Avoiding-param-in-URL-when-action-redirect....-tp24431097p24431097.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Attachment: user_200581.ezm (zipped)
Thank you Martin for yet another text wall,random, off topic, and
uninformative post. I am starting to appreciate the advantages of
having forums instead of mailing lists...captcha.

musachy

On Fri, Jul 10, 2009 at 9:33 AM, Martin Gainty<mgainty@(protected):
>
> web.xml configuration for Spring
> /* The ContextLoaderListener listener should be registered after
>  Log4jConfigListener
>  in web.xml, if the latter is used.
> */
>    <listener>
>        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
>    </listener>
>
> once thats configured you'll want to use MethodInvokingFactoryBean for FactoryBean which returns a value which is the result of a static or instance
>  method invocation
>
> http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/beans/factory/config/MethodInvokingFactoryBean.html
>
> as mentioned singleton="true" assures you will load,instantiate and store a cached bean
>
> static factory methods:
> An example (in an XML based bean factory definition) of a bean definition
>  which uses this class to call a STATIC factory method:
> <bean id="myObject" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
>   <property name="staticMethod"><value>com.whatever.MyClassFactory.getInstance</value></property>
> </bean>
>
> <!-- this example will acquire a (target) instance specific version of System defined (version) property -->
>  <bean id="sysProps" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
>   <property name="targetClass"><value>java.lang.System</value></property>
>   <property name="targetMethod"><value>getProperties</value></property>
>  </bean>
>  <bean id="javaVersion" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
>   <property name="targetObject"><ref local="sysProps"/></property>
>   <property name="targetMethod"><value>getProperty</value></property>
>   <property name="arguments">
>     <list>
>       <value>java.version</value>
>     </list>
>   </property>
>  </bean>Since your question addresses GarbageCollection it would be good to know the difference
> between Spring's Beans loader between ApplicationContext (a load class which implements ApplicationContextAware) and BeanFactory (a class which implements BeanFactoryAware)
> BeanFactory:
> 1a)Container locates beans definition (usually derivation of *beans.xml)
> 1b)Container Loads beans into Container
> 2)is instantiated LATER with getBean() method
>
> ApplicationContext:
> 1a)Container locates beans definition depeding on invoking class
> -ClassPathXMLApplicationContext-Loads XML from Classpath
> -FileSystemXMLApplicationContext-Loads context from XML file in filesystem
> -XMLWebApplicationContext-Loads Context from XML(beans.xml/ApplicationContext.xml) contained with webApplication
> 1b)Container loads and instantiates all beans into Container
>
> so if you see alot of GC activity from jheap or J2EE Server logs you will probably want to consider using BeanFactoryAware implementor class instead of default ApplicationContextAware implementor class
>
> hope this helps
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
>
>
>
>
>
>> Date: Fri, 10 Jul 2009 11:10:17 -0400
>> From: dale@(protected)
>> To: user@(protected)
>> Subject: Re: Actions are not Garbage Collected
>>
>> Musachy Barroso wrote:
>> > On Fri, Jul 10, 2009 at 7:53 AM, Musachy Barroso<musachy@(protected):
>> >> If your actions are singletons (and they shouldn't be!) then they
>> >> are not likely to be collected.
>> >
>> > because a reference to them will be held by spring, or whatever
>> > container you are using.
>>
>> Or maybe clickstream?  http://www.opensymphony.com/clickstream
>>
>> A brief look at the source
>> https://svn.opensymphony.com/svn/clickstream/trunk appears to indicate
>> that it only saves stuff extracted from the request object, but maybe I
>> missed where it's also saving a reference to the request (and therefore
>> the action) itself?
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
> _________________________________________________________________
> Lauren found her dream laptop. Find the PC that’s right for you.
> http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290



--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Attachment: user_200582.ezm (zipped)

and the answer is?

Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.




> Date: Fri, 10 Jul 2009 10:09:30 -0700
> Subject: Re: Actions are not Garbage Collected
> From: musachy@(protected)
> To: user@(protected)
>
> Thank you Martin for yet another text wall,random, off topic, and
> uninformative post. I am starting to appreciate the advantages of
> having forums instead of mailing lists...captcha.
>
> musachy
>
> On Fri, Jul 10, 2009 at 9:33 AM, Martin Gainty<mgainty@(protected):
> >
> > web.xml configuration for Spring
> > /* The ContextLoaderListener listener should be registered after
> > Log4jConfigListener
> > in web.xml, if the latter is used.
> > */
> >   <listener>
> >     <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
> >   </listener>
> >
> > once thats configured you'll want to use MethodInvokingFactoryBean for FactoryBean which returns a value which is the result of a static or instance
> > method invocation
> >
> > http://static.springsource.org/spring/docs/1.2.x/api/org/springframework/beans/factory/config/MethodInvokingFactoryBean.html
> >
> > as mentioned singleton="true" assures you will load,instantiate and store a cached bean
> >
> > static factory methods:
> > An example (in an XML based bean factory definition) of a bean definition
> > which uses this class to call a STATIC factory method:
> > <bean id="myObject" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
> >  <property name="staticMethod"><value>com.whatever.MyClassFactory.getInstance</value></property>
> > </bean>
> >
> > <!-- this example will acquire a (target) instance specific version of System defined (version) property -->
> > <bean id="sysProps" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
> >  <property name="targetClass"><value>java.lang.System</value></property>
> >  <property name="targetMethod"><value>getProperties</value></property>
> > </bean>
> > <bean id="javaVersion" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
> >  <property name="targetObject"><ref local="sysProps"/></property>
> >  <property name="targetMethod"><value>getProperty</value></property>
> >  <property name="arguments">
> >   <list>
> >     <value>java.version</value>
> >   </list>
> >  </property>
> > </bean>Since your question addresses GarbageCollection it would be good to know the difference
> > between Spring's Beans loader between ApplicationContext (a load class which implements ApplicationContextAware) and BeanFactory (a class which implements BeanFactoryAware)
> > BeanFactory:
> > 1a)Container locates beans definition (usually derivation of *beans.xml)
> > 1b)Container Loads beans into Container
> > 2)is instantiated LATER with getBean() method
> >
> > ApplicationContext:
> > 1a)Container locates beans definition depeding on invoking class
> > -ClassPathXMLApplicationContext-Loads XML from Classpath
> > -FileSystemXMLApplicationContext-Loads context from XML file in filesystem
> > -XMLWebApplicationContext-Loads Context from XML(beans.xml/ApplicationContext.xml) contained with webApplication
> > 1b)Container loads and instantiates all beans into Container
> >
> > so if you see alot of GC activity from jheap or J2EE Server logs you will probably want to consider using BeanFactoryAware implementor class instead of default ApplicationContextAware implementor class
> >
> > hope this helps
> > Martin Gainty
> > ______________________________________________
> > Verzicht und Vertraulichkeitanmerkung
> >
> > Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> >
> >
> >
> >
> >
> >> Date: Fri, 10 Jul 2009 11:10:17 -0400
> >> From: dale@(protected)
> >> To: user@(protected)
> >> Subject: Re: Actions are not Garbage Collected
> >>
> >> Musachy Barroso wrote:
> >> > On Fri, Jul 10, 2009 at 7:53 AM, Musachy Barroso<musachy@(protected):
> >> >> If your actions are singletons (and they shouldn't be!) then they
> >> >> are not likely to be collected.
> >> >
> >> > because a reference to them will be held by spring, or whatever
> >> > container you are using.
> >>
> >> Or maybe clickstream? http://www.opensymphony.com/clickstream
> >>
> >> A brief look at the source
> >> https://svn.opensymphony.com/svn/clickstream/trunk appears to indicate
> >> that it only saves stuff extracted from the request object, but maybe I
> >> missed where it's also saving a reference to the request (and therefore
> >> the action) itself?
> >>
> >> -Dale
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@(protected)
> >> For additional commands, e-mail: user-help@(protected)
> >>
> >
> > _________________________________________________________________
> > Lauren found her dream laptop. Find the PC that’s right for you.
> > http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_WL_BR_life_in_synch_062009

Attachment: user_200583.ezm (zipped)

Hi guys, thanks for your answers.

Atually I'm not using the spring framework. I use hibernate and have a lot
of entity beans in the actions.

If I call 50 actions i have 50 of them in the memory and every action has
e.g. 50 products, so i have 2500 of the same products in my memory. Is der a
possibility to somehow cache the instances of the entities?

Thx
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_200584.ezm (zipped)
Anselmo wrote:
> If I call 50 actions i have 50 of them in the memory and every action has
> e.g. 50 products, so i have 2500 of the same products in my memory. Is der a
> possibility to somehow cache the instances of the entities?

look into ehcache

If you're not using spring, what's instantiating the actions in the
first place?

-Dale


Attachment: user_200585.ezm (zipped)
Using any decent profiler will tell you who is holding the references
to the actions.

musachy

On Fri, Jul 10, 2009 at 10:23 AM, Anselmo<anselm.bauer@(protected):
>
> Hi guys, thanks for your answers.
>
> Atually I'm not using the spring framework. I use hibernate and have a lot
> of entity beans in the actions.
>
> If I call 50 actions i have 50 of them in the memory and every action has
> e.g. 50 products, so i have 2500 of the same products in my memory. Is der a
> possibility to somehow cache the instances of the entities?
>
> Thx
> --
> View this message in context: http://www.nabble.com/Actions-are-not-Garbage-Collected-tp24425128p24431582.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



--
"Hey you! Would you help me to carry the stone?" Pink Floyd


Attachment: user_200586.ezm (zipped)

yes that's true
how about the delta between implementing BeanFactory vs ApplicationContext?
for Bean instantiation?

i admit this is off-topic for Struts but ontopic for Spring
and we dont have a m/l yet!

Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.





> Date: Fri, 10 Jul 2009 10:32:23 -0700
> Subject: Re: Actions are not Garbage Collected
> From: musachy@(protected)
> To: user@(protected)
>
> Using any decent profiler will tell you who is holding the references
> to the actions.
>
> musachy
>
> On Fri, Jul 10, 2009 at 10:23 AM, Anselmo<anselm.bauer@(protected):
> >
> > Hi guys, thanks for your answers.
> >
> > Atually I'm not using the spring framework. I use hibernate and have a lot
> > of entity beans in the actions.
> >
> > If I call 50 actions i have 50 of them in the memory and every action has
> > e.g. 50 products, so i have 2500 of the same products in my memory. Is der a
> > possibility to somehow cache the instances of the entities?
> >
> > Thx
> > --
> > View this message in context: http://www.nabble.com/Actions-are-not-Garbage-Collected-tp24425128p24431582.html
> > Sent from the Struts - User mailing list archive at Nabble.com.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Attachment: user_200587.ezm (zipped)

The only references I have to my action are

localeProvider of com.opensymphony.xwork2.TextProviderSupport

which has references from the action again. Is this maybe running in
circles?
--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_200588.ezm (zipped)
Anselmo wrote:
> The only references I have to my action are
>
> localeProvider of com.opensymphony.xwork2.TextProviderSupport
>
> which has references from the action again. Is this maybe running in
> circles?

A circular reference could explain why one type of GC sweep would not
free that, but another more costly one run when only when the JVM needs
more space (instead of periodically, just because) would.

-Dale


Attachment: user_200589.ezm (zipped)

Is this still the only way to get i18n translatations into a struts tag from
the resource bundle?

I'm trying to get a label on some struts fields, i.e.

          <s:textfield
           
name="userResponses[%{#loop.index}].userResponseValues[0].value"
            label="%{getText('q.client.name.first')}"
            value="%{userResponseValues[0].value}"
            required="%{formQuestion.required}"
            maxlength="%{formQuestion.maxLength}"
            cssStyle="width:%{fieldSize}px"
            cssClass="text medium"/>

with a messageSource defined as

 <bean id="messageSource"
class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
    <property name="basenames">
      <list>
        <value>classpath:/form</value>
      </list>
    </property>
    <property name="cacheSeconds" value="7200"/>
 </bean>

I've never seen the getText() work successfully, but the following do work:

<fmt:setBundle basename="form"/>
<fmt:message key="q.client.name.first" />

<i18n:bundle baseName="form" id="b1">
  <i18n:message key="q.client.name.first" bundle="${b1}" />
</i18n:bundle>

I also have the JSTL message source defined in web.xml still, but removing
that doesn't help the getText succeed.

Any ideas on getting getText() to work? Or alternatives ways of getting an
i18n label on the s:textfield? Thanks for any ideas -




LEONARD Julien (Consulting for ACCOR Hotels) wrote:
>
> Try this :
>
> <s:textfield theme="xhtml" label="" key="categoryName"
> cssClass="fieldGreen validate-alpha " value=""
> title="%{getText('category.categoryName')}" id="categoryName"/>
>
> http://struts.apache.org/2.0.11/docs/localization.html
>
> Julien
>
> -----Message d'origine-----
> De : VJ22 [mailto:Vijay.Nair@(protected)]
> Envoyé : vendredi 22 février 2008 16:26
> À : user@(protected)
> Objet : For s:textfield tag how to get value for title attribute from
> resource bundle.
>
>
> For s:textfield tag how to get value for title attribute from resource
> bundle.
> I tried using <fmt:message> but seems the struts2 is not recognising this
> inside the title tag and considering it as plain text.
> Please let me know if there exists a way to do the same For eg i tried
> <td width="80%"<s:textfield theme="xhtml" label="" key="categoryName"
> cssClass="fieldGreen validate-alpha " value="" title="<fmt:message
> key='category.categoryName'/>" id="categoryName"/>
>
> Here category.categoryName is refering to resouce bundle property.
>
> --
> View this message in context:
> http://www.nabble.com/For-s%3Atextfield-tag-how-to-get-value-for-title-attribute-from-resource-bundle.-tp15634305p15634305.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
> ----------------------------------------------------------------------------------------
>
>

--
Sent from the Struts - User mailing list archive at Nabble.com.



Attachment: user_200591.ezm (zipped)
Figured it out, forget it.




________________________________
From: Peter Bliznak <bliznak@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Friday, July 10, 2009 11:23:15 AM
Subject: Passing runtime exp into tag

Hi all,
translating portion of old code which was using S1 and Tiles and
ran into problem.

There is one tile representing form which is being used on almost all screens.
One doesn't want to write same tile over and over again since only name
of the action differs.

Existing code used this:

// define name of the action to be a passed from parent tile
<tiles:useAttribute name="formAction" />

then it was used like this:

<html:form action="<%= formAction.toString() %>" ......


I've changed this to use S2 tags:

<s:form action="<%= formAction.toString() %>" .........

and jsp compilers complains:


JSPG0227E: Exception caught while translating /layout/formLayout.jsp:
/layout/formLayout.jsp(11,1) --> JSPG0124E: Custom tag attribute action
cannot be runtime expression. value: "[%= formAction.toString() %]"

Any ideas how to solve it?

Thanks,

Peter.

Attachment: user_200592.ezm (zipped)
OK, thanks Wes, I'm making progress:

This:

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick="%{'$(' + #foo + ').request(); return false;'}"/>


Generates:

<input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
/images/unlocked.png" id="door3_0" value="Submit"
onclick="$(door3).request(); return false
;" alt="Unlocked"/>

If I use single-quotes inside, I get errors. Double quotes as well.
Escaped double quotes give me &quot;, but what I really need is:

onclick="$('door3').request(); return false;"

Note the single quotes around 'door3', which is what #foo is.


-----Original Message-----
From: Wes Wannemacher [mailto:wesw@(protected)]
Sent: Friday, July 10, 2009 12:09 PM
To: Struts Users Mailing List
Subject: Re: Help with JSP and javascript

On Friday 10 July 2009 11:49:04 Security Management wrote:
> Can someone suggest a way to do this:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick='$("<s:property value="#foo"/>").request(); return false;'/>
>
> I have tried a bunch of ways, but always wind up with the &lts:property...
> in the resulting HTML, rather than '$("form1").submit()' like I need.
>
> Thanks
>

Try this -

<s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



Attachment: user_200593.ezm (zipped)
There is a way to escape quotes in OGNL... I thought I had a sample sitting
around somewhere but I am not finding it. Check google. I would guess that you
could just escape the single quotes you need and the rest will fall into
place.

-Wes

On Friday 10 July 2009 14:54:30 Security Management wrote:
> OK, thanks Wes, I'm making progress:
>
> This:
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(' + #foo + ').request(); return false;'}"/>
>
>
> Generates:
>
> <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> /images/unlocked.png" id="door3_0" value="Submit"
> onclick="$(door3).request(); return false
> ;" alt="Unlocked"/>
>
> If I use single-quotes inside, I get errors. Double quotes as well.
> Escaped double quotes give me &quot;, but what I really need is:
>
> onclick="$('door3').request(); return false;"
>
> Note the single quotes around 'door3', which is what #foo is.
>
>
> -----Original Message-----
> From: Wes Wannemacher [mailto:wesw@(protected)]
> Sent: Friday, July 10, 2009 12:09 PM
> To: Struts Users Mailing List
> Subject: Re: Help with JSP and javascript
>
> On Friday 10 July 2009 11:49:04 Security Management wrote:
> > Can someone suggest a way to do this:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> >
> > I have tried a bunch of ways, but always wind up with the
> > &lts:property... in the resulting HTML, rather than '$("form1").submit()'
> > like I need.
> >
> > Thanks
>
> Try this -
>
> <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> onclick="%{'$(' + #foo + ').request(); return false;}'}"/>

--
Wes Wannemacher
Author - Struts 2 In Practice
Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
http://www.manning.com/wannemacher


Attachment: user_200597.ezm (zipped)

onclick="$(&#146;door3&#146;).request(); return false;"

apologies for short response
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung

Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.





> From: wesw@(protected)
> To: user@(protected)
> Subject: Re: Help with JSP and javascript
> Date: Fri, 10 Jul 2009 15:03:08 -0400
>
> There is a way to escape quotes in OGNL... I thought I had a sample sitting
> around somewhere but I am not finding it. Check google. I would guess that you
> could just escape the single quotes you need and the rest will fall into
> place.
>
> -Wes
>
> On Friday 10 July 2009 14:54:30 Security Management wrote:
> > OK, thanks Wes, I'm making progress:
> >
> > This:
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick="%{'$(' + #foo + ').request(); return false;'}"/>
> >
> >
> > Generates:
> >
> > <input type="image" alt="Submit" src="/smc-appsuite/pages/door-control
> > /images/unlocked.png" id="door3_0" value="Submit"
> > onclick="$(door3).request(); return false
> > ;" alt="Unlocked"/>
> >
> > If I use single-quotes inside, I get errors. Double quotes as well.
> > Escaped double quotes give me &quot;, but what I really need is:
> >
> > onclick="$('door3').request(); return false;"
> >
> > Note the single quotes around 'door3', which is what #foo is.
> >
> >
> > -----Original Message-----
> > From: Wes Wannemacher [mailto:wesw@(protected)]
> > Sent: Friday, July 10, 2009 12:09 PM
> > To: Struts Users Mailing List
> > Subject: Re: Help with JSP and javascript
> >
> > On Friday 10 July 2009 11:49:04 Security Management wrote:
> > > Can someone suggest a way to do this:
> > >
> > > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > > onclick='$("<s:property value="#foo"/>").request(); return false;'/>
> > >
> > > I have tried a bunch of ways, but always wind up with the
> > > &lts:property... in the resulting HTML, rather than '$("form1").submit()'
> > > like I need.
> > >
> > > Thanks
> >
> > Try this -
> >
> > <s:submit type="image" alt="Unlocked" src="%{unlocked_image}"
> > onclick="%{'$(' + #foo + ').request(); return false;}'}"/>
>
> --
> Wes Wannemacher
> Author - Struts 2 In Practice
> Includes coverage of Struts 2.1, Spring, JPA, JQuery, Sitemesh and more
> http://www.manning.com/wannemacher
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

_________________________________________________________________
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

Attachment: user_200594.ezm (zipped)
Nobody can tell me why struts removes the parenthesis characters out of
string entered into a text box?

We have a work around but I've got to think somebody knows what I'm
doing wrong here.



-----Original Message-----
From: Ratner Glenn A
Sent: Thursday, July 09, 2009 10:39 AM
To: 'Struts Users Mailing List'
Subject: Stripping Out Characters

I'm new to struts and work on an application with existing struts code.

I have a text field in a .jsp and when doing the post struts seems to be
automatically removing certain special characters from the string in the
text field.

In particular, it's removing these non-alpha characters: "(" and ")"

Is there some configuration at the struts level to declare which
characters to allow or not allow? I searched but could not find any
info.

Thanks,
Glenn



The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. Although we attempt to sweep e-mail and attachments for viruses, we do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of viruses.

Please refer to http://disclaimer.bnymellon.com/eu.htm for certain disclosures relating to European legal entities.


Attachment: user_200596.ezm (zipped)
Sounds weird. Can you post your form code in the jsp?

Cheers
Avlesh

On Sat, Jul 11, 2009 at 12:46 AM, Ratner Glenn A <glenn.ratner@(protected)
> wrote:

> Nobody can tell me why struts removes the parenthesis characters out of
> string entered into a text box?
>
> We have a work around but I've got to think somebody knows what I'm
> doing wrong here.
>
>
>
> -----Original Message-----
> From: Ratner Glenn A
> Sent: Thursday, July 09, 2009 10:39 AM
> To: 'Struts Users Mailing List'
> Subject: Stripping Out Characters
>
> I'm new to struts and work on an application with existing struts code.
>
> I have a text field in a .jsp and when doing the post struts seems to be
> automatically removing certain special characters from the string in the
> text field.
>
> In particular, it's removing these non-alpha characters: "(" and ")"
>
> Is there some configuration at the struts level to declare which
> characters to allow or not allow? I searched but could not find any
> info.
>
> Thanks,
> Glenn
>
>
>
> The information contained in this e-mail, and any attachment, is
> confidential and is intended solely for the use of the intended recipient.
> Access, copying or re-use of the e-mail or any attachment, or any
> information contained therein, by any other person is not authorized. If you
> are not the intended recipient please return the e-mail to the sender and
> delete it from your computer. Although we attempt to sweep e-mail and
> attachments for viruses, we do not guarantee that either are virus-free and
> accept no liability for any damage sustained as a result of viruses.
>
> Please refer to http://disclaimer.bnymellon.com/eu.htm for certain
> disclosures relating to European legal entities.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_200595.ezm (zipped)

Hi Everyone,



         
I am trying to create a java variable in the jsp scriplet and assign it a value coming from <s: property> tag

so for example

<%

      int id = <s: property value="userId"/> ;

%>



I know the above is completely incorrect, but essentially, that is what I want to accomplish. Can anyone give me any idea how this can be done? Thanks.





My action class looks like:
public class UserAction extends ActionSupport implements SessionAware, DataSourceAware, UserAware, Preparable, ModelDriven
{


private User loggedInUser;

private Map session;
private DataSource dataSource;
private int userId;




public int getUserId()
{
return userId;
}

public void setUserId(int userId)
{
this.userId = userId;
}



_________________________________________________________________
Hotmail® has ever-growing storage! Don’t worry about storage limits.
http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009

Attachment: user_200598.ezm (zipped)
do something like:

<s:set var="myId" value="..." scope="page"/>

then in your scriplet, get a reference to the page context (cant
remember the API) and do a getAttribute("myId") on it.

musachy

On Fri, Jul 10, 2009 at 12:20 PM, Farshad
Rabbani<farshadrabbani@(protected):
>
> Hi Everyone,
>
>
>
>
> I am trying to create a java variable in the jsp scriplet and assign it a value coming from <s: property> tag
>
> so for example
>
> <%
>
>          int id = <s: property value="userId"/> ;
>
> %>
>
>
>
> I know the above is completely incorrect, but essentially, that is what I want to accomplish.  Can anyone give me any idea how this can be done?  Thanks.
>
>
>
>
>
> My action class looks like:
> public class UserAction extends ActionSupport implements SessionAware, DataSourceAware, UserAware, Preparable, ModelDriven
> {
>
>
>  private User loggedInUser;
>
>  private Map session;
>  private DataSource dataSource;
>  private int userId;
>
>
>
>
>  public int getUserId()
>  {
>  return userId;
>  }
>
>  public void setUserId(int userId)
>  {
>  this.userId = userId;
>  }
>
>
>
> _________________________________________________________________
> Hotmail® has ever-growing storage! Don’t worry about storage limits.
> http://windowslive.com/Tutorial/Hotmail/Storage?ocid=TXT_TAGLM_WL_HM_Tutorial_Storage_062009



--
"Hey you! Would you help me to carry the stone?" Pink Floyd

©2008 gg3721.com - Jax Systems, LLC, U.S.A.