Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 22 Jul 2008 22:59:59 -0000 Issue 8154

user-digest-help

2008-07-22


Author LoginPost Reply

user Digest 22 Jul 2008 22:59:59 -0000 Issue 8154

Topics (messages 189163 through 189192):

Re: <s:property> and <s:if> tag
 189163 by: Kibo

Using the iterator to list results from a hibernate join
 189164 by: Brian Daddino
 189165 by: Dave Newton

Re: Dojo javascript errors with ajax theme. please help
 189166 by: Pranav
 189169 by: Miguel
 189184 by: Markus Stauffer
 189192 by: Pranav

Re: [SPAM] - Re: Using the iterator to list results from a hibernate join - Email has different SMTP TO: and MIME TO: fields in the email addresses
 189167 by: Brian Daddino
 189168 by: Dave Newton
 189170 by: Brian Daddino
 189171 by: Brian Daddino
 189172 by: Dave Newton

Re: [S2] Unable to access passed parameters in an included file
 189173 by: Becky.L.O'Sullivan.mhn.com

[s2] Formatting input textfields
 189174 by: Milan Milanovic
 189178 by: Jishnu Viswanath
 189182 by: jkoutr.proton.gr

Generate a ActionForm for a dynamically generated list of Properties
 189175 by: Ransika de Silva

Re: [S2] Conversion validation issue
 189176 by: Gabriel Belingueres
 189177 by: Dave Newton

Tile controller class
 189179 by: Zhang, Larry (L.)
 189181 by: Lukasz Lenart

[S2] devMode + Maven2 + recompile classes
 189180 by: Lukasz Lenart
 189183 by: Nils-Helge Garli Hegvik
 189185 by: Markus Stauffer
 189186 by: Lukasz Lenart
 189188 by: Nils-Helge Garli Hegvik
 189189 by: Lukasz Lenart

[S2] Why there is no support for client side date validator?
 189187 by: Gabriel Belingueres

Re: need some help regarding Display List and Update In Struts2
 189190 by: hisameer
 189191 by: Dave Newton

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_189163.ezm (zipped)

<s:iterator id="comp" value="%{components}">
       
       <s:set name="sort" value="%{sort + ''}" />
                   
       <s:if test="%{#sort eq 'PRODUCT'}">
          OK
       </s:if>
       
    </s:iterator>
--------------------------------------------------


-----
Tomas Jurman
Czech Republic
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_189164.ezm (zipped)
Hi,

I'm new to Struts 2.  I have searched the web but can not find anything
on my issue.



Basically I have a many to 1 relationship between 2 objects, Contact and
contactmethod (contact being the 1).

Contacts objects contain a person's name and contact method is basically
just a name value pair.

What I would like to display is the name and all contactmethods in 1
list....

Example:

John Smith phone 555-1212

John Smith fax 555-2323 <mailto:Johnsmith@(protected)>



My hibernate query returns a list.

List l = session.createQuery("FROM Contact c left join
c.contactmethodses").list();



It seems that the way the join is handled is to make each list entry
actually be an array of 2 objects (a contact object and a contactMethod
object).



Here is my JSP code...



<s:iterator value="contacts" status="status">

    <tr>

       <td class="nowrap"><s:property /></td>

       <td class="nowrap"><s:property value="<what do I put in
here???"/></td>

    </tr>



  </s:iterator>



I will get the correct # of lines, however, I can not figure out how to
read the values out of the array in this list item.

Using <s:property /> will get me gui.Contact@(protected)
actually read properties of that object or the 2nd object (contact
method)?

What do I put in the value field of my property tag?



Thanks,

Brian




This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL information intended only for the addressee(s). If you are not the intended recipient, or the employee or agent responsible for delivery to the intended recipient(s), please note that any review, dissemination, use, distribution or copying is strictly prohibited. If you receive this in error, please notify the sender immediately, destroy any paper copies and delete it from any computer. Thank you.


Attachment: user_189165.ezm (zipped)
--- On Tue, 7/22/08, Brian Daddino <brian.daddino@(protected):
> I'm new to Struts 2.  I have searched the web but can
> not find anything on my issue.

Did you look at the S2 documentation wiki? It answers these questions.

> What do I put in the value field of my property tag?

Here's some pseudo-code based loosely on your requirements.

<s:property "contact.name"/>
<s:iterator value="contact.contacts">
<s:property value="email"/>
<s:property value="phone"/>
</s:iterator>

The contact is exposed by the action.

The <s:property.../> tags call, in this example, getEmail() on each object being iterated over. An alternative way would be:

<s:iterator value="contact.contacts" id="aContact">
<s:property value="#aContact.email"/>
<s:property value="#aCotnact.phone"/>
</s:iterator>

I'd recommend looking over some of the basics on the S2 wiki.

Dave


Attachment: user_189166.ezm (zipped)
Hi Jerome,

You're a lifesaver. Thanks for your tips. I will try them out today. I fixed my issue temporarily yesterday by extracting the jar file, and manually creating copies of gregorian.js and gregorianExtras.js etc to appropriate locations and the problem did go away but I will surely put in this permanent fix to improve performance.

Thanks



----- Original Message ----
From: Jeromy Evans <jeromy.evans@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Tuesday, July 22, 2008 5:38:55 AM
Subject: Re: Dojo javascript errors with ajax theme. please help

Pranav wrote:
> Hi,
>
> I am using <s:head theme="ajax"/> in my jsp files. I have included everything as per struts2 docs. But when I launch the page in FireFox, they show me 404 errors for several javascript files.
> Example are:
> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
> ../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
> ../struts/dojo/src/widget/nls/en/TimePicker.js
> ../struts/dojo/src/widget/nls/en-us/TimePicker.js
> ../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
> ../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
>
> When I opened the struts2-core-2.0.11.jar file that my project is using, I did not find these files at all. I am not using any of these components like date-time picker or calendar objects but for some reason dojo plugin tries to GET these files. This gives a lot of problem in our pre-prod system where firewalls and proxies are installed. Can someone please help me get rid of these errors? What will I have to do? I will really appreciate help from experts.
>
> Thanks
> Pranav
>
>
>

In Struts 2.0.x, the files are bundled in the jar under
org/apache/struts/static or somewhere nearby.

The are served by the struts filter only if the filter path enables it
(eg. /*) and if the property struts.serve.static=true (default true).

In a production system, it's a very good idea to extract the files and
serve them directly from Apache or your container as there'll be a
significant performance improvement (very significant if apache serves
them).

I'm not sure why it would be loading the timepicker and date picker if
you're not using them - check the html to see why there's a Requires
statement.

In a production system, a good idea to create a custom dojo profile (in
this case, for example, to remove locale files). It makes a massive
performance improvement by reducing the large number of GETs.

http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html

Hope that helps.
Jeromy Evans

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


   

Attachment: user_189169.ezm (zipped)
Those files doesn't exist in the original Dojo source, because dojo
looks the files acording to your language preferences, but the en and
the en-us are the default. It's normal to have errors with those
encodings.

Si quieres ser más positivo, pierde un electrón
Miguel Ruiz Velasco S.


On Tue, Jul 22, 2008 at 10:57, Pranav <mehta_pranav@(protected):
> Hi Jerome,
>
> You're a lifesaver. Thanks for your tips. I will try them out today. I fixed my issue temporarily yesterday by extracting the jar file, and manually creating copies of gregorian.js and gregorianExtras.js etc to appropriate locations and the problem did go away but I will surely put in this permanent fix to improve performance.
>
> Thanks
>
>
>
> ----- Original Message ----
> From: Jeromy Evans <jeromy.evans@(protected)>
> To: Struts Users Mailing List <user@(protected)>
> Sent: Tuesday, July 22, 2008 5:38:55 AM
> Subject: Re: Dojo javascript errors with ajax theme. please help
>
> Pranav wrote:
>> Hi,
>>
>> I am using <s:head theme="ajax"/> in my jsp files. I have included everything as per struts2 docs. But when I launch the page in FireFox, they show me 404 errors for several javascript files.
>> Example are:
>> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
>> ../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
>> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
>> ../struts/dojo/src/widget/nls/en/TimePicker.js
>> ../struts/dojo/src/widget/nls/en-us/TimePicker.js
>> ../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
>> ../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
>>
>> When I opened the struts2-core-2.0.11.jar file that my project is using, I did not find these files at all. I am not using any of these components like date-time picker or calendar objects but for some reason dojo plugin tries to GET these files. This gives a lot of problem in our pre-prod system where firewalls and proxies are installed. Can someone please help me get rid of these errors? What will I have to do? I will really appreciate help from experts.
>>
>> Thanks
>> Pranav
>>
>>
>>
>
> In Struts 2.0.x, the files are bundled in the jar under
> org/apache/struts/static or somewhere nearby.
>
> The are served by the struts filter only if the filter path enables it
> (eg. /*) and if the property struts.serve.static=true (default true).
>
> In a production system, it's a very good idea to extract the files and
> serve them directly from Apache or your container as there'll be a
> significant performance improvement (very significant if apache serves
> them).
>
> I'm not sure why it would be loading the timepicker and date picker if
> you're not using them - check the html to see why there's a Requires
> statement.
>
> In a production system, a good idea to create a custom dojo profile (in
> this case, for example, to remove locale files). It makes a massive
> performance improvement by reducing the large number of GETs.
>
> http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html
>
> Hope that helps.
> Jeromy Evans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189184.ezm (zipped)

Thanks a lot Jermoy! This fixed my issue with ff3.

I created a custom dojo build andd disabled
struts.widget.StrutsTimePicker. I don't use the DateTimePickers.

The svn repo is here: http://svn.dojotoolkit.org/src/tags/release-0.4.0/

regards
--
Markus Stauffer

On Tuesday 22 July 2008 17.57:15 Pranav wrote:
> Hi Jerome,
>
> You're a lifesaver. Thanks for your tips. I will try them out today. I
> fixed my issue temporarily yesterday by extracting the jar file, and
> manually creating copies of gregorian.js and gregorianExtras.js etc to
> appropriate locations and the problem did go away but I will surely put
> in this permanent fix to improve performance.
>
> Thanks
>
>
>
> ----- Original Message ----
> From: Jeromy Evans <jeromy.evans@(protected)>
> To: Struts Users Mailing List <user@(protected)>
> Sent: Tuesday, July 22, 2008 5:38:55 AM
> Subject: Re: Dojo javascript errors with ajax theme. please help
>
> Pranav wrote:
> > Hi,
> >
> > I am using <s:head theme="ajax"/> in my jsp files. I have included
> > everything as per struts2 docs. But when I launch the page in
> > FireFox, they show me 404 errors for several javascript files.
> > Example are:
> > ../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
> > ../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
> > ../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
> > ../struts/dojo/src/widget/nls/en/TimePicker.js
> > ../struts/dojo/src/widget/nls/en-us/TimePicker.js
> > ../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
> > ../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
> >
> > When I opened the struts2-core-2.0.11.jar file that my project is
> > using, I did not find these files at all. I am not using any of these
> > components like date-time picker or calendar objects but for some
> > reason dojo plugin tries to GET these files. This gives a lot of
> > problem in our pre-prod system where firewalls and proxies are
> > installed. Can someone please help me get rid of these errors? What
> > will I have to do? I will really appreciate help from experts.
> >
> > Thanks
> > Pranav
>
> In Struts 2.0.x, the files are bundled in the jar under
> org/apache/struts/static or somewhere nearby.
>
> The are served by the struts filter only if the filter path enables it
> (eg. /*) and if the property struts.serve.static=true (default true).
>
> In a production system, it's a very good idea to extract the files and
> serve them directly from Apache or your container as there'll be a
> significant performance improvement (very significant if apache serves
> them).
>
> I'm not sure why it would be loading the timepicker and date picker if
> you're not using them - check the html to see why there's a Requires
> statement.
>
> In a production system, a good idea to create a custom dojo profile (in
> this case, for example, to remove locale files). It makes a massive
> performance improvement by reducing the large number of GETs.
>
> http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-strut
>s-20x.html
>
> Hope that helps.
> Jeromy Evans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)



Attachment: user_189192.ezm (zipped)
Hi Jerome,

I tried this but unfortunately their dojo's svn does not have the release 0.4.0 anymore. I could only get the source code for release 0.4.3 from their download section. Do you think that will work? If not, can you tell me the exact svn location from where I can get the release 0.4.0 of dojo?

Thanks
Pranav



----- Original Message ----
From: Pranav <mehta_pranav@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Tuesday, July 22, 2008 8:57:15 AM
Subject: Re: Dojo javascript errors with ajax theme. please help

Hi Jerome,

You're a lifesaver. Thanks for your tips. I will try them out today. I fixed my issue temporarily yesterday by extracting the jar file, and manually creating copies of gregorian.js and gregorianExtras.js etc to appropriate locations and the problem did go away but I will surely put in this permanent fix to improve performance.

Thanks



----- Original Message ----
From: Jeromy Evans <jeromy.evans@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Tuesday, July 22, 2008 5:38:55 AM
Subject: Re: Dojo javascript errors with ajax theme. please help

Pranav wrote:
> Hi,
>
> I am using <s:head theme="ajax"/> in my jsp files. I have included everything as per struts2 docs. But when I launch the page in FireFox, they show me 404 errors for several javascript files.
> Example are:
> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorian.js
> ../struts/dojo/src/i18n/calendar/nls/en/gregorianExtras.js
> ../struts/dojo/src/i18n/calendar/nls/en-us/gregorianExtras.js
> ../struts/dojo/src/widget/nls/en/TimePicker.js
> ../struts/dojo/src/widget/nls/en-us/TimePicker.js
> ../mcpages/struts/dojo/src/widget/nls/en/DropdownTimePicker.js
> ../struts/dojo/src/widget/nls/en-us/DropdownTimePicker.js
>
> When I opened the struts2-core-2.0.11.jar file that my project is using, I did not find these files at all. I am not using any of these components like date-time picker or calendar objects but for some reason dojo plugin tries to GET these files. This gives a lot of problem in our pre-prod system where firewalls and proxies are installed. Can someone please help me get rid of these errors? What will I have to do? I will really appreciate help from experts.
>
> Thanks
> Pranav
>
>
>

In Struts 2.0.x, the files are bundled in the jar under
org/apache/struts/static or somewhere nearby.

The are served by the struts filter only if the filter path enables it
(eg. /*) and if the property struts.serve.static=true (default true).

In a production system, it's a very good idea to extract the files and
serve them directly from Apache or your container as there'll be a
significant performance improvement (very significant if apache serves
them).

I'm not sure why it would be loading the timepicker and date picker if
you're not using them - check the html to see why there's a Requires
statement.

In a production system, a good idea to create a custom dojo profile (in
this case, for example, to remove locale files). It makes a massive
performance improvement by reducing the large number of GETs.

http://cwiki.apache.org/S2WIKI/creating-a-custom-dojo-profile-for-struts-20x.html

Hope that helps.
Jeromy Evans

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


   

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


   

Attachment: user_189167.ezm (zipped)
I did look, but I could not find it. Do you have a link?

-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Tuesday, July 22, 2008 11:34 AM
To: Struts Users Mailing List
Subject: [SPAM] - Re: Using the iterator to list results from a
hibernate join - Email has different SMTP TO: and MIME TO: fields in the
email addresses

--- On Tue, 7/22/08, Brian Daddino <brian.daddino@(protected):
> I'm new to Struts 2.  I have searched the web but can
> not find anything on my issue.

Did you look at the S2 documentation wiki? It answers these questions.

> What do I put in the value field of my property tag?

Here's some pseudo-code based loosely on your requirements.

<s:property "contact.name"/>
<s:iterator value="contact.contacts">
<s:property value="email"/>
<s:property value="phone"/>
</s:iterator>

The contact is exposed by the action.

The <s:property.../> tags call, in this example, getEmail() on each
object being iterated over. An alternative way would be:

<s:iterator value="contact.contacts" id="aContact">
<s:property value="#aContact.email"/>
<s:property value="#aCotnact.phone"/>
</s:iterator>

I'd recommend looking over some of the basics on the S2 wiki.

Dave


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



This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL information intended only for the addressee(s). If you are not the intended recipient, or the employee or agent responsible for delivery to the intended recipient(s), please note that any review, dissemination, use, distribution or copying is strictly prohibited. If you receive this in error, please notify the sender immediately, destroy any paper copies and delete it from any computer. Thank you.


Attachment: user_189168.ezm (zipped)
--- On Tue, 7/22/08, Brian Daddino <brian.daddino@(protected):
> I did look, but I could not find it. Do you have a link?

http://struts.apache.org/2.x/docs/home.html

Dave


Attachment: user_189170.ezm (zipped)
Thanks for the link. I did find a method that somewhat works in
there...
Instead of making my join in the query, I am just querying out my
contacts and using 2 iterators...
<s:iterator value="contacts" status="status">
   <s:iterator value="contactmethodses" status="status">
    <tr>
       <td class="nowrap"><s:property value="firstName"/></td>
       <td class="nowrap"><s:property value="lastName"/></td>
       <td class="nowrap"><s:property value="method"/></td>
...


This works fairly well, but loses my outer join (if there is no contact
method, the contact's name is not even displayed).
Am I missing something still?


-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Tuesday, July 22, 2008 12:09 PM
To: Struts Users Mailing List
Subject: RE: [SPAM] - Re: Using the iterator to list results from a
hibernate join - Email has different SMTP TO: and MIME TO: fields in the
email addresses

--- On Tue, 7/22/08, Brian Daddino <brian.daddino@(protected):
> I did look, but I could not find it. Do you have a link?

http://struts.apache.org/2.x/docs/home.html

Dave


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



This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL information intended only for the addressee(s). If you are not the intended recipient, or the employee or agent responsible for delivery to the intended recipient(s), please note that any review, dissemination, use, distribution or copying is strictly prohibited. If you receive this in error, please notify the sender immediately, destroy any paper copies and delete it from any computer. Thank you.


Attachment: user_189171.ezm (zipped)
I spoke too soon.
Thanks you're your help...
If anyone else needs the answer what I did was....




<s:iterator value="contacts2" status="status" id="test">
    <tr>
   <s:iterator value="test" status="status">

       <td class="nowrap"><s:property value="firstName"/></td>
       <td class="nowrap"><s:property value="lastName"/></td>
       <td class="nowrap"><s:property value="method"/></td>
       <td class="nowrap"><s:property value="value"/></td>
 <td> fill space </td>

  </s:iterator>
    </tr>
  </s:iterator>


-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Tuesday, July 22, 2008 12:09 PM
To: Struts Users Mailing List
Subject: RE: [SPAM] - Re: Using the iterator to list results from a
hibernate join - Email has different SMTP TO: and MIME TO: fields in the
email addresses

--- On Tue, 7/22/08, Brian Daddino <brian.daddino@(protected):
> I did look, but I could not find it. Do you have a link?

http://struts.apache.org/2.x/docs/home.html

Dave


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



This electronic transmission may contain PRIVILEGED AND CONFIDENTIAL information intended only for the addressee(s). If you are not the intended recipient, or the employee or agent responsible for delivery to the intended recipient(s), please note that any review, dissemination, use, distribution or copying is strictly prohibited. If you receive this in error, please notify the sender immediately, destroy any paper copies and delete it from any computer. Thank you.


Attachment: user_189172.ezm (zipped)
--- On Tue, 7/22/08, Brian Daddino wrote:
> Instead of making my join in the query, I am just querying
> out my contacts and using 2 iterators...
> <s:iterator value="contacts" status="status">
>  <s:iterator value="contactmethodses" status="status">
>   <s:property value="firstName"/>
>   <s:property value="lastName"/>
>   <s:property value="method"/>
> ...
>
> This works fairly well, but loses my outer join (if there
> is no contact method, the contact's name is not even displayed).
> Am I missing something still?

Most likely :)

First of all, you're iterating over two sets of things: contacts, and contact methods.

The iterator tag [1] works by pushing each object of iteration onto the top of the stack. The property tag [2] will call the getter on the object on the top of the stack (actually, I thought it'd keep going down the stack; I could be remembering incorrectly though).

You have two iterators; once you're inside the second iterator the contact is no longer on the top of the stack--the contact method is (if there *are* any contact methods). That can be solved by providing an "id" attribute, thus naming the object of iteration, and allowing you to refer to it regardless of stack depth. The pseudo-code I provided demonstrated this.

Second of all, your current implementation only displays properties if there are "contactmethodses" (your pluralizer needs help). The pseudo-code I provided printed the contact name *then* iterated over contactmethodses.

On a pedantic note, your outer join isn't being "lost", nor is data loading methodology relevant.

Dave

[1] Iterator tag: http://struts.apache.org/2.x/docs/iterator.html
[2] Property tag: http://struts.apache.org/2.x/docs/property.html


Attachment: user_189173.ezm (zipped)
Thanks for the catch Dave.

Isn't it funny that they provide two examples of parameter passing in [1]?
Don't expect to be able to access those using struts tags within the
included file, ha!

I (hacked | worked around | fixed) it by using JSTL <c:set> to place those
params into the page context (and therefore the value stack):

<c:set var="nav1" value="${param.nav1}"/>

<p>
Nav 1a: <s:property value="#attr.nav1"/><br />
Nav 1b: <s:property value="%{#attr.nav1}"/><br />
Nav 1c: <s:property value="#attr['nav1']"/><br />
Nav 1d: <s:property value="%{#attr['nav1']}"/>
</p>

Nav 1a: portalAdmin
Nav 1b: portalAdmin
Nav 1c: portalAdmin
Nav 1d: portalAdmin

Thanks,
-B




                                                 
        Dave Newton                                  
        <newton.dave@(protected)                              
        o.com>                                   To
                         Struts Users Mailing List      
        07/21/2008 05:56       <user@(protected)>        
        PM                                      cc
                                                 
                                            Subject
        Please respond to      Re: [S2] Unable to access passed  
         "Struts Users       parameters in an included file    
         Mailing List"                              
        <user@(protected)                              
           he.org>                                
                                                 
                                                 
                                                 




--- On Mon, 7/21/08, <Becky.L.O'Sullivan@(protected):
> Feels like I missed something obvious....

The note on [1] where it says that params aren't available on the stack, I
think.

I don't recall the reason at the moment, though.

Dave

[1] http://struts.apache.org/2.x/docs/include.html


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





---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

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

Attachment: user_189174.ezm (zipped)

Hi,

I need to format input in textfields that user can enter value like this:
204,05, but now it is like this 204.05.
I have defined this formatting for output already. How can I change this ?

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


Attachment: user_189178.ezm (zipped)
http://cwiki.apache.org/WW/ajax-validation.html
On the validate part, do put Regular expression to make to accept the
pattern you want.

Regards,

Jishnu Viswanath

Software Engineer

*(+9180)41190300 - 222(Ext) ll * ( + 91 ) 9731209330ll

Tavant Technologies Inc.,

www.tavant.com

PEOPLE :: PASSION :: EXCELLENCE


-----Original Message-----
From: Milan Milanovic [mailto:milanmilanovich@(protected)]
Sent: Tuesday, July 22, 2008 10:32 PM
To: user@(protected)
Subject: [s2] Formatting input textfields


Hi,

I need to format input in textfields that user can enter value like
this:
204,05, but now it is like this 204.05.
I have defined this formatting for output already. How can I change this
?

--
Thx, Milan
--
http://www.nabble.com/-s2--Formatting-input-textfields-tp18593985p185939
85.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)

Any comments or statements made in this email are not necessarily those of Tavant Technologies.
The information transmitted is intended only for the person or entity to which it is addressed and may
contain confidential and/or privileged material. If you have received this in error, please contact the
sender and delete the material from any computer. All e-mails sent from or to Tavant Technologies
may be subject to our monitoring procedures.


Attachment: user_189182.ezm (zipped)
I had the same problem. I solved it by creating a custom type conversion
for bigdecimal fields.

Take a look <a
href="http://struts.apache.org/2.0.11.2/docs/type-conversion.html#TypeConversion-ApplyingaTypeConverterforanapplication">here</a>

By creating your own converter you can have fields were the user write
number with the #.###,## format and the bigdecimals are displayed with the
same format

>
> Hi,
>
> I need to format input in textfields that user can enter value like this:
> 204,05, but now it is like this 204.05.
> I have defined this formatting for output already. How can I change this ?
>
> --
> Thx, Milan
> --
> View this message in context:
> http://www.nabble.com/-s2--Formatting-input-textfields-tp18593985p18593985.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)
>
>


John Koutros
Technology

PROTONBANK
20 Amaliados & Eslin Str., 115 23 Athens, Greece
Tel.: +30 210 6970677, +30 211 1081677
Mob.: +30 693 6104677 FAX: +30 210 90025299
eMail: j.koutros@(protected)

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


This message may contain confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute, alter or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and then delete this e-mail from your system. E-mail transmissions cannot be guaranteed to be secure, or error-free or virus-free. Any liability for all the above is excluded to the fullest extent permitted by law.

Αυτό το μήνυμα πιθανόν να περιέχει εμπιστευτικές πληροφορίες και προορίζεται μόνο για το άτομο που κατονομάζεται. Εάν δεν είστε ο κατονομαζόμενος παραλήπτης, δεν πρέπει να διαδώσετε, να διανείμετε, να αλλάξετε ή να αντιγράψετε αυτό το ηλεκτρονικό μήνυμα. Παρακαλώ ειδοποιήστε τον αποστολέα αμέσως με ηλεκτρονικό ταχυδρομείο εάν έχετε λάβει αυτό το ηλεκτρονικό μήνυμα από λάθος και εν συνεχεία διαγράψτε το από το σύστημά σας. Η μετάδοση μέσω ηλεκτρονικού ταχυδρομείου δεν παρέχει εγγυήσεις ως προς την ασφάλεια, την έλλειψη λαθών ή τη μετάδοση ιών. Οποιαδήποτε ευθύνη σχετικά με τα ανωτέρω αποκλείεται κατά το μέγιστο δυνατό μέτρο που επιτρέπει ο νόμος.

Attachment: user_189175.ezm (zipped)
Hello all,

I have to create a JSP which gets a list of questions from the database with
the possible answers. The number of questions may vary from time to time.
The questions might request the user to select 1 answer or some times it can
be more than 1 selection.

My problem is, how to capture these selected answers for each question when
the user hits the submit button. The normal scenario for html:form is to
have the properties hardcoded with names which are there in the ActionForm
corresponding to that Action. But the problem here is, I can't specify the
properties for the ActionForm cause the properties change.

I hope the problem is clear for you and anticipating a response.

Thanks and regards

--
Ransika De Silva
SCMAD 1.0, SCJP 1.4,
BSc.(Hons) Information Systems

Attachment: user_189176.ezm (zipped)
But then again, eliminating the "conversionError" interceptor from the
stack would prevent conversion errors to appear as fieldErrors in the
input form, but this would force to use the conversion validator
everywhere a non String object is setted by the ParametersInterceptor
to show the error?

Is there any way to configure S2 so that when a conversion error
happens on a field, it does NOT try to validate later that specific
field in the Validator interceptor?

2008/7/21 Lukasz Lenart <lukasz.lenart@(protected)>:
>> Does this means eliminating the "conversionError" interceptor from the
>> default stack?
>
> Yes ;-)
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189177.ezm (zipped)
--- On Tue, 7/22/08, Gabriel Belingueres <belingueres@(protected):
> But then again, eliminating the "conversionError"
> interceptor from the stack would prevent conversion
> errors to appear as fieldErrors in the input form,
> but this would force to use the conversion validator
> everywhere a non String object is setted by the
> ParametersInterceptor to show the error?

In my experience most conversion errors also result in validation errors, at least for simple cases.

> Is there any way to configure S2 so that when a conversion
> error happens on a field, it does NOT try to validate later
> that specific field in the Validator interceptor?

Not at the moment, AFAIK.

Dave


Attachment: user_189179.ezm (zipped)
I am using a tile controller class to render the tile on the page. Say
if my main action rendering the page is called myAction.do and when I
send the request like https://wwww.../myWeb/myAction.do, myAction.do
will do something and then forward to the page containing the tile.(then
the tile controller comes to the picture). My tile controller have the
following method:

public class MyTileController implements Controller {
 public void execute(ComponentContext arg0, HttpServletRequest
request,
     HttpServletResponse arg2, ServletContext arg3)
throws Exception {
   
   // how to the the path myAction.do??
   
   // process business logic

 }
}
My question is that how to get the path info like myAction.do in the
above method? Thanks.

Attachment: user_189181.ezm (zipped)
HttpServletRequest.getRequestURI() [1] should meet your requirements

[1] http://java.sun.com/webservices/docs/1.5/api/javax/servlet/http/HttpServletRequest.html#getPathInfo()


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_189180.ezm (zipped)
Hi,

I'm using Maven2 to develop my Struts2 application, as I discovered,
it's possible to configure Maven2 to recompile modified classes and
also update resource files, but I don't know how to setup that. I'm
also using Jetty plugin with Maven2 and IntelliJ IDEA 7. Can someone
help me?


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_189183.ezm (zipped)
Are you asking how to set up reloading of the webapp with the maven
jetty plugin? Did you check out the maven-jetty-plugin docs [1] and
the "scanIntervalSeconds" configuration element [2]?

Nils-H

[1] - http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
[2] - http://jetty.mortbay.org/jetty-6/maven-plugin/run-mojo.html#scanIntervalSeconds

On Tue, Jul 22, 2008 at 9:17 PM, Lukasz Lenart
<lukasz.lenart@(protected):
> Hi,
>
> I'm using Maven2 to develop my Struts2 application, as I discovered,
> it's possible to configure Maven2 to recompile modified classes and
> also update resource files, but I don't know how to setup that. I'm
> also using Jetty plugin with Maven2 and IntelliJ IDEA 7. Can someone
> help me?
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189185.ezm (zipped)

Can i do this with tomcat as well. I think it's called hot-deploy or
something. Someone got it working with netbeans 6.1+ and maven2 project?

regards
--
Markus Stauffer

On Tuesday 22 July 2008 22.36:51 Nils-Helge Garli Hegvik wrote:
> Are you asking how to set up reloading of the webapp with the maven
> jetty plugin? Did you check out the maven-jetty-plugin docs [1] and
> the "scanIntervalSeconds" configuration element [2]?
>
> Nils-H
>
> [1] - http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
> [2] -
> http://jetty.mortbay.org/jetty-6/maven-plugin/run-mojo.html#scanInterva
>lSeconds
>
> On Tue, Jul 22, 2008 at 9:17 PM, Lukasz Lenart
>
> <lukasz.lenart@(protected):
> > Hi,
> >
> > I'm using Maven2 to develop my Struts2 application, as I discovered,
> > it's possible to configure Maven2 to recompile modified classes and
> > also update resource files, but I don't know how to setup that. I'm
> > also using Jetty plugin with Maven2 and IntelliJ IDEA 7. Can someone
> > help me?
> >
> >
> > Regards
> > --
> > Lukasz
> > http://www.lenart.org.pl/
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)



Attachment: user_189186.ezm (zipped)
Hi,

2008/7/22 Nils-Helge Garli Hegvik <nilsga@(protected)>:
> Are you asking how to set up reloading of the webapp with the maven
> jetty plugin? Did you check out the maven-jetty-plugin docs [1] and
> the "scanIntervalSeconds" configuration element [2]?
>
> Nils-H
>
> [1] - http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
> [2] - http://jetty.mortbay.org/jetty-6/maven-plugin/run-mojo.html#scanIntervalSeconds

Yas, I read them, but the problem is that the Jetty is monitoring
target/ not src/main and Maven2 has to recompile class and copy it to
target/


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_189188.ezm (zipped)
Yes, that it's how it's supposed to be I guess. What exactly is the
problem? Is it that the webapp won't reload when you edit classes or
resources when you edit them in your IDE? Is your IDE set up with
correct output build paths? Does it help to touch the web.xml file?

Nils-H

On Tue, Jul 22, 2008 at 10:44 PM, Lukasz Lenart
<lukasz.lenart@(protected):
> Hi,
>
> 2008/7/22 Nils-Helge Garli Hegvik <nilsga@(protected)>:
>> Are you asking how to set up reloading of the webapp with the maven
>> jetty plugin? Did you check out the maven-jetty-plugin docs [1] and
>> the "scanIntervalSeconds" configuration element [2]?
>>
>> Nils-H
>>
>> [1] - http://docs.codehaus.org/display/JETTY/Maven+Jetty+Plugin
>> [2] - http://jetty.mortbay.org/jetty-6/maven-plugin/run-mojo.html#scanIntervalSeconds
>
> Yas, I read them, but the problem is that the Jetty is monitoring
> target/ not src/main and Maven2 has to recompile class and copy it to
> target/
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_189189.ezm (zipped)
> Yes, that it's how it's supposed to be I guess. What exactly is the
> problem? Is it that the webapp won't reload when you edit classes or
> resources when you edit them in your IDE? Is your IDE set up with
> correct output build paths? Does it help to touch the web.xml file?

That's the point, I don't know why I disabled this functionality in
IntelliJ IDEA, right now it's working as charm ;-)
Thanks for the tip!


Regards
--
Lukasz
http://www.lenart.org.pl/

Attachment: user_189187.ezm (zipped)
Hi,

Seeing the file form-close-validate.ftl (in xhtml theme) I see that
there is no javascript code for the date validator.
Seems like a straightforward addition.
Or is there some error condition or limitation that I'm not aware of?

Regards,
Gabriel

Attachment: user_189190.ezm (zipped)

Thanks for your help Lukasz!

The code you gave me was really really helpful and I was able to popup the
usr list. But I got some error when I added the update and delete link into
the same page.

Here is the snapshot of my userList.jsp:

<table class="userTable">
 <tr>
   <th><s:text name="User Name:" /></th>
   <th><s:text name="City:" /></th>
   <th><s:text name="State:" /></th>
   <th><s:text name="Description:" /></th>
 </tr>
 <s:iterator value="userList" status="userTable_stat">
   <s:url var="updateUrl" action="updateUser" namespace="user">
     <s:param name="userId" value="id" />
   </s:url>
   <s:url var="deleteUrl" action="deleteUser" namespace="user">
     <s:param name="userId" value="id" />
   </s:url>
   <tr
     class="<s:if test="#userTable_stat.odd ==
true">odd</s:if><s:else>even</s:else>">
     <td><s:property value="name" /></td>
     <td><s:property value="city" /></td>
     <td><s:property value="state" /></td>
     <td><s:property value="description" /></td>
     <td><s:a href="%{updateUrl}">
       <s:property value="id"/><s:textfield>Update</s:textfield>
     </s:a></td>
     <td><s:a href="%{deleteUrl}">
       <s:property value="id" /><s:textfield>Delete</s:textfield>
     </s:a></td>
   </tr>
 </s:iterator>
</table>

and my struts.xml mappings are:


<action name="userList" class="UserAction"
     method="userList">
     <result>/pages/userList.jsp</result>
   </action>
   <action name="updateUser" class="UserAction"
     method="updateUser">
     <result name="failure">/login.jsp</result>
     <result>/pages/updateUser.jsp</result>
   </action>
   <action name="deleteUser" class="UserAction"
     method="deleteUser">
     <result>/confirmation.jsp</result>
   </action>

But when I tried to call the userList after adding the update and delete
links the following error came up:
   
SEVERE: Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: /pages/userList.jsp(47,2) Attribute var
invalid for tag url according to TLD
 at
org.apache.jasper.compiler.DefaultErrorHandler.jspError (DefaultErrorHandler.java:40)
 at
org.apache.jasper.compiler.ErrorDispatcher.dispatch (ErrorDispatcher.java:407)
 at
org.apache.jasper.compiler.ErrorDispatcher.jspError (ErrorDispatcher.java:236)
 at
org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:1198)
 at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:819)
 at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
 at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
 at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
 at
org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:838)
 at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1512)
 at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
 at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2393)
 at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2399)
 at org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
 at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2343)
 at org.apache.jasper.compiler.Validator.validate (Validator.java:1737)
 at org.apache.jasper.compiler.Compiler.generateJava (Compiler.java:165)
 at org.apache.jasper.compiler.Compiler.compile (Compiler.java:314)
 at org.apache.jasper.compiler.Compiler.compile (Compiler.java:294)
 at org.apache.jasper.compiler.Compiler.compile (Compiler.java:281)
 at
org.apache.jasper.JspCompilationContext.compile (JspCompilationContext.java:566)
 at
org.apache.jasper.servlet.JspServletWrapper.service (JspServletWrapper.java:317)
 at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:337)

I really don't know what should I do. Also please tell me whether the
struts.xml snapshot is good or not.

Thanx for your help in advance.






Lukasz Lenart wrote:
>
>      <table>
>         <tr>
>           <td><s:text name="label.user.id"/></td>
>           <td><s:text name="label.user.login"/></td>
>           <td><s:text name="label.user.firstname"/></td>
>           <td><s:text name="label.user.lastname"/></td>
>         </tr>
>         <s:iterator value="userList" var="user">
>           <s:url var="editUrl" action="edit">
>              <s:param name="userId" value="id"/>
>           </s:url>
>           <tr>
>              <td><s:a href="%{editUrl}"><s:property
> value="id"/></s:a></td>
>              <td><s:property value="logon"/></td>
>              <td><s:property value="firstName"/></td>
>              <td><s:property value="lastName"/></td>
>           </tr>
>         </s:iterator>
>      </table>
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

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


Attachment: user_189191.ezm (zipped)
--- On Tue, 7/22/08, hisameer <cool_sameer_for_u@(protected):
> userList.jsp(47,2) Attribute var invalid for tag url according to TLD

The {{id}} attribute is deprecated in Struts 2.1.x, and has been replaced by the {{var}} attribute. So if you're using S2.0.x use "id".

Dave

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