Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 7 Apr 2008 20:18:02 -0000 Issue 7968

user-digest-help

2008-04-07


Author LoginPost Reply

user Digest 7 Apr 2008 20:18:02 -0000 Issue 7968

Topics (messages 185124 through 185145):

Re: Ognl expressions in Struts 2.1
 185124 by: Márcio Gurgel
 185125 by: Márcio Gurgel
 185144 by: Eric Nelson

Re: Multiple Result in one Page
 185126 by: Frans Thamura

Re: [OT] What do you code today?
 185127 by: Antonio Petrelli
 185131 by: mgainty.hotmail.com
 185132 by: Antonio Petrelli
 185133 by: Randy Burgess
 185135 by: Kropp, Henning
 185138 by: Roger Ye

[Very OT] Telecom Italia's manager knowledge of history
 185128 by: Antonio Petrelli

Vencent wants to keep up with you on Twitter
 185129 by: Vencent

Re: [S2] checkboxes in each row of table - set values in action
 185130 by: lbastil

[OT] Re: [OT] What do you code today?
 185134 by: Dave Newton

Struts 1.1 final/weblogic 9.2 java.lang.ClassCastException: org.apache.struts.upload.MultipartRequestWrapper
 185136 by: Bhattacharya, Mousami

Re: The requested resource (/struts2-blank-2.0.11.1/emsitem/index.jsp) is not available.
 185137 by: Eric Nelson
 185141 by: Dave Newton

Re: Url-Parameters only set once
 185139 by: Eric Nelson
 185140 by: Dave Newton

ajax upload file - error message [Object] when returning a div.
 185142 by: xianwinwin

interesting proxy + action chain issue
 185143 by: Brad A Cupit
 185145 by: Brad A Cupit

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_185124.ezm (zipped)
Jeromy,

I tried as you said, but now I have the following exception:

01:02:36,640 WARN OgnlValueStack:46 - Could not find property [templateDir]
01:02:36,640 WARN OgnlValueStack:46 - Could not find property [templateDir]
01:02:36,640 WARN OgnlValueStack:46 - Could not find property
[#attr.templateDir]
01:02:36,656 WARN OgnlValueStack:46 - Could not find property [templateDir]
01:02:36,656 WARN OgnlValueStack:46 - Could not find property [templateDir]
01:02:36,671 WARN OgnlValueStack:46 - Could not find property
[#attr.templateDir]
01:02:36,718 ERROR FreemarkerTemplateEngine:24 - Could not load template
/template/item/checkbox
01:02:36,765 ERROR UIBean:28 - error when rendering
java.io.FileNotFoundException: Template /template/item/checkbox.ftl not
found.

Tanks for your attention!



2008/4/7, Jeromy Evans <jeromy.evans@(protected)>:
>
> In addition to Wes' comment, as you're using display:table and have used
> the uid attribute, the current row of the table is placed into the
> PageContext.
>
> You can access the page context in OGNL via #attr, so your expression
> becomes this:
>
> <s:checkbox name="checkBox" id="checkBox" value="cdUsuario"
> fieldValue="%{#attr.item.id}" theme="simple" onclick="confirmAllChecked()"
> />
>
>
> Wes Wannemacher wrote:
>
> > Your problem isn't OGNL in parameters, you are using EL in your
> > examples. By default, EL expressions are disabled, but you could easily
> > switch your expressions to OGNL. I'm guessing that if you use '%'
> > instead of '$' it will probably work. If your action has a getItem(),
> > and the returned object has a getId(), then %{item.id} should work, and
> > if the %{ and } may not even be necessary.
> > ${ triggers EL expression parsing, but this is done by the app server,
> > if the TLD specifies that the attribute accepts EL (which struts tags do
> > not by default, unless you change the TLD which isn't advisable).
> > %{ forces OGNL expression. OGNL expression evaluation happens within the
> > tag's code, so the app server knows nothing about this step. Thus, the
> > TLD file's directives have nothing to do with this parsing. Many of the
> > Struts 2 tag's attributes will attempt to parse parameters as OGNL by
> > default, but %{ will force parsing.
> >
> > -Wes
> >
> >
> > On Sun, 2008-04-06 at 21:19 -0300, Márcio Gurgel wrote:
> >
> >
> > > Hi all,
> > >
> > > I was using struts 2.0.9, then I resolved to upgrade to 2.1.0.
> > > I was setting a value in a checkbox like this:
> > > <s:checkBox value="${currentRow.id}"/> inside a displayTag iterator.
> > >
> > > I read this link https://issues.apache.org/struts/browse/WW-2107 and
> > > understood the situation.
> > > But, is there another way to set a value in my checkBox?
> > >
> > > <display:table requestURI="/usuario/pesquisar.action"
> > > name="listUsuPesquisa"
> > > list="listUsuPesquisa" export="false" class="list" pagesize="15"
> > > uid="item">
> > >
> > > <display:column title='<input type="checkbox" name="selectAll"
> > > id="selectAll" value="" onclick="checkAll()"/>'>
> > > <s:checkbox name="checkBox" id="checkBox" value="cdUsuario"
> > > fieldValue="${
> > > item.id}" theme="simple" onclick="confirmAllChecked()" />
> > > </display>
> > >
> > > *Exception*
> > > According to TLD or attribute directive in tag file, attribute
> > > fieldValue
> > > does not accept any expressions
> > >
> > > Tanks a lot!
> > > Have a nice week!
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > 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_185125.ezm (zipped)
Sorry guys, my mistake.
I don't know how, but the "theme" attribute of s:checkBox was "item", then I
changed to "simple" (:

Jeromy it works! The generated checkBox has value!
Tanks for your help.
Tanks also Wes!


2008/4/7, Márcio Gurgel <marcio.rga@(protected)>:
>
> Jeromy,
>
> I tried as you said, but now I have the following exception:
>
> 01:02:36,640 WARN OgnlValueStack:46 - Could not find property
> [templateDir]
> 01:02:36,640 WARN OgnlValueStack:46 - Could not find property
> [templateDir]
> 01:02:36,640 WARN OgnlValueStack:46 - Could not find property
> [#attr.templateDir]
> 01:02:36,656 WARN OgnlValueStack:46 - Could not find property
> [templateDir]
> 01:02:36,656 WARN OgnlValueStack:46 - Could not find property
> [templateDir]
> 01:02:36,671 WARN OgnlValueStack:46 - Could not find property
> [#attr.templateDir]
> 01:02:36,718 ERROR FreemarkerTemplateEngine:24 - Could not load template
> /template/item/checkbox
> 01:02:36,765 ERROR UIBean:28 - error when rendering
> java.io.FileNotFoundException: Template /template/item/checkbox.ftl not
> found.
>
> Tanks for your attention!
>
>
>
> 2008/4/7, Jeromy Evans <jeromy.evans@(protected)>:
> >
> > In addition to Wes' comment, as you're using display:table and have used
> > the uid attribute, the current row of the table is placed into the
> > PageContext.
> >
> > You can access the page context in OGNL via #attr, so your expression
> > becomes this:
> >
> > <s:checkbox name="checkBox" id="checkBox" value="cdUsuario"
> > fieldValue="%{#attr.item.id}" theme="simple"
> > onclick="confirmAllChecked()" />
> >
> >
> > Wes Wannemacher wrote:
> >
> > > Your problem isn't OGNL in parameters, you are using EL in your
> > > examples. By default, EL expressions are disabled, but you could
> > > easily
> > > switch your expressions to OGNL. I'm guessing that if you use '%'
> > > instead of '$' it will probably work. If your action has a getItem(),
> > > and the returned object has a getId(), then %{item.id} should work,
> > > and
> > > if the %{ and } may not even be necessary.
> > > ${ triggers EL expression parsing, but this is done by the app server,
> > > if the TLD specifies that the attribute accepts EL (which struts tags
> > > do
> > > not by default, unless you change the TLD which isn't advisable).
> > > %{ forces OGNL expression. OGNL expression evaluation happens within
> > > the
> > > tag's code, so the app server knows nothing about this step. Thus, the
> > > TLD file's directives have nothing to do with this parsing. Many of
> > > the
> > > Struts 2 tag's attributes will attempt to parse parameters as OGNL by
> > > default, but %{ will force parsing.
> > >
> > > -Wes
> > >
> > >
> > > On Sun, 2008-04-06 at 21:19 -0300, Márcio Gurgel wrote:
> > >
> > >
> > > > Hi all,
> > > >
> > > > I was using struts 2.0.9, then I resolved to upgrade to 2.1.0.
> > > > I was setting a value in a checkbox like this:
> > > > <s:checkBox value="${currentRow.id}"/> inside a displayTag iterator.
> > > >
> > > > I read this link https://issues.apache.org/struts/browse/WW-2107 and
> > > > understood the situation.
> > > > But, is there another way to set a value in my checkBox?
> > > >
> > > > <display:table requestURI="/usuario/pesquisar.action"
> > > > name="listUsuPesquisa"
> > > > list="listUsuPesquisa" export="false" class="list" pagesize="15"
> > > > uid="item">
> > > >
> > > > <display:column title='<input type="checkbox" name="selectAll"
> > > > id="selectAll" value="" onclick="checkAll()"/>'>
> > > > <s:checkbox name="checkBox" id="checkBox" value="cdUsuario"
> > > > fieldValue="${
> > > > item.id}" theme="simple" onclick="confirmAllChecked()" />
> > > > </display>
> > > >
> > > > *Exception*
> > > > According to TLD or attribute directive in tag file, attribute
> > > > fieldValue
> > > > does not accept any expressions
> > > >
> > > > Tanks a lot!
> > > > Have a nice week!
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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_185144.ezm (zipped)
I ran into this too once I upgraded to 2.0.11. I understand their concern for allowing expressions, but I know that I'm using them correctly and so I decided to modify the TLD and allow all expressions, then just re-jared everything up and all is working fine. That's one solution. The other is to avoid EL expressions. The value field in <s:checkbox> can be set off the value stack, so this should work:

<s:checkBox value="currentRow.id"/>

You could also try:

<s:checkBox value="%{currentRow.id}"/>

--Eric

-----Original Message-----
From: Márcio Gurgel [mailto:marcio.rga@(protected)]
Sent: Sunday, April 06, 2008 6:20 PM
To: user@(protected)
Subject: Ognl expressions in Struts 2.1

Hi all,

I was using struts 2.0.9, then I resolved to upgrade to 2.1.0.
I was setting a value in a checkbox like this:
<s:checkBox value="${currentRow.id}"/> inside a displayTag iterator.

I read this link https://issues.apache.org/struts/browse/WW-2107 and
understood the situation.
But, is there another way to set a value in my checkBox?

<display:table requestURI="/usuario/pesquisar.action" name="listUsuPesquisa"
list="listUsuPesquisa" export="false" class="list" pagesize="15" uid="item">

<display:column title='<input type="checkbox" name="selectAll"
id="selectAll" value="" onclick="checkAll()"/>'>
<s:checkbox name="checkBox" id="checkBox" value="cdUsuario" fieldValue="${
item.id}" theme="simple" onclick="confirmAllChecked()" />
</display>

*Exception*
According to TLD or attribute directive in tag file, attribute fieldValue
does not accept any expressions

Tanks a lot!
Have a nice week!

Attachment: user_185126.ezm (zipped)
take a look of this

http://farm3.static.flickr.com/2018/2394469980_a9984272d8.jpg?v=0

this is our current approach, a s2 action for form, and another action for
value

i use the ExtJS, and run well here :)

thx to the ExtJs GUI Designer team

but i am seeking another cool stuff that beter.


Frans

On Mon, Apr 7, 2008 at 10:08 AM, Jeromy Evans <
jeromy.evans@(protected):

> I'm not completely sure what you mean but two things come to mind:
> - the s:action tag is useful for pages that need to be assembled using the
> results from multiple actions. If each each outputs a component of the
> view, you can uses Tiles or Sitemesh to assemble a page on the server-side
> that invokes numerous actions. You can then reuse the components and design
> actions around each data model instead of each page.
> - as you're using ExtJS, you can use the same pattern as described above,
> but invoke each action XHR. The page can be assembled via ExtJS on the
> client-side with your actions returning data or html fragments as
> appropriate.
>
>
>

Attachment: user_185127.ezm (zipped)
Currently I'm a sub-sub-contractor (pretty typical in Italy :-D ) in a
big reengineering project in a social security institute in Italy,
where I can see applications built from the ground up, involving all
aspects of the institute.
In particular, I am working on a project separated in two parts: one
is a web-based J2EE application, the other is a batch application. It
is a configurable communication system between:
- a system that can take variations to anagraphical and social
security status of a subscriber;
- the systems that enable employees to work on those statuses.

Well, in fact currently I am not coding (for work, I am excluding
Tiles :-) ) but creating diagrams, documents, etc. (I am a computer
engineer after all...), but it's interesting seeing a complete system
with different groups that collaborate to create a unique environment.

Antonio

Attachment: user_185131.ezm (zipped)
what is the term 'anagraphical data' ?

Molte Grazie
Martin
----- Original Message -----
Wrom: PEGAUTFJMVRESKPNKMBIPBARHDMNNSKVFVWRKJVZCMHVIBG
To: "Struts Users Mailing List" <user@(protected)>
Sent: Monday, April 07, 2008 3:04 AM
Subject: Re: [OT] What do you code today?


> Currently I'm a sub-sub-contractor (pretty typical in Italy :-D ) in a
> big reengineering project in a social security institute in Italy,
> where I can see applications built from the ground up, involving all
> aspects of the institute.
> In particular, I am working on a project separated in two parts: one
> is a web-based J2EE application, the other is a batch application. It
> is a configurable communication system between:
> - a system that can take variations to anagraphical and social
> security status of a subscriber;
> - the systems that enable employees to work on those statuses.
>
> Well, in fact currently I am not coding (for work, I am excluding
> Tiles :-) ) but creating diagrams, documents, etc. (I am a computer
> engineer after all...), but it's interesting seeing a complete system
> with different groups that collaborate to create a unique environment.
>
> Antonio
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185132.ezm (zipped)
2008/4/7, mgainty@(protected)>:
>
> what is the term 'anagraphical data' ?



Sorry wrong translation.
I meant personal information like name, address, telephone number, etc.

Antonio

Attachment: user_185133.ezm (zipped)
I'm working on an external and internal facing portal application using BEA
AquaLogic UI (ALUI), plugging some holes with S2 based portlets, mainly
dealing with moving our customers from DB based auth to LDAP through the
portal.

With ALUI you can use either JSR-168 portlets or plain old web apps so we
have taken the plain old web app course and have not used the portlet
plugin. One of my co-workers has created some portlets using the JSF plugin
with good results.

These portlets are mainly customer self service for our many service
offerings and oriented towards customer support on the internal facing
stuff.

Overall we love the framework, much better than S1!

Regards,
Randy Burgess
Sr. Web Applications Developer
Nuvox Communications



> From: Ted Husted <husted@(protected)>
> Reply-To: Struts Users Mailing List <user@(protected)>
> Date: Fri, 4 Apr 2008 07:14:33 -0400
> To: Struts Users Mailing List <user@(protected)>
> Subject: [OT] What do you code today?
>
> While outward facing web application get the most publicity, I know
> that most of us are heads-down on internally-facing applications
> designed for fellow employees to use over the corporate intranet.
>
> I'm trying to put together a list of the typical types of applications
> that enterprise developer write in real life. For example, my last
> project involved a system to track drafting, granting, monitoring, and
> enforcing water permits administered by a government agency. We would
> create an initial record for a permit, and then add child records to
> track progress through the workflow, and also update the master record
> along the way. For management, a key item here is a tracking report,
> which we exported to Word (using a third-party tool) for better
> formatting. For engineers, a key item was a flexible search system to
> quickly find a master or child record. Other interesting features are
> workflows where one task leads to another. When we completed one task
> (child record), the next is often implied, and so we had a workflow
> that would default the next task to work on when a current task was
> closed. Another interesting requirement was that sometimes master
> items were merged under another uber-master-item, becoming, in effect,
> child items themselves. In most cases, the application simply exposed
> business models that we designed into the database, so the application
> has little business logic of its own. Most of the workflows were
> designed to find, list, edit, or view one database entity or the
> other.
>
> So, if anyone else is up for sharing, I'd be interested in hearing
> what sort of things other people are doing these days. (If your not
> comfortable posting the list, feel free to mail me direct.)
>
> -Ted.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>



This email and any attachments ("Message") may contain legally privileged and/or confidential information. If you are not the addressee, or if this Message has been addressed to you in error, you are not authorized to read, copy, or distribute it, and we ask that you please delete it (including all copies) and notify the sender by return email. Delivery of this Message to any person other than the intended recipient(s) shall not be deemed a waiver of confidentiality and/or a privilege.

Attachment: user_185135.ezm (zipped)
Wes Wannemacher schrieb:
> I've been quiet on this one, but since I finally had a breakthrough
> today, I feel like talking about it :)
>
> I started a pet project that I've been toying around in my head for a
> while. As a parent, I coach a few elementary and junior high sports. It
> is a volunteer thing, and if offered pay, I would refuse it (the schools
> need the money more than I do). The biggest complaint that parents have
> though is that they feel like we don't provide enough information, etc.
> Sometimes I want to tell the parents that complain to shove it :), but
> as a parent myself, I feel the same way about teachers, so I try to do a
> better job each season. Since I setup a wordpress/phpBB site a while
> back (which I haven't been too diligent about updating), I thought about
> doing something similar. Having dealt once with wordpress/phpBB, I have
> vowed to never do it again.
>
> In an attempt to "eat-my-own-dog-food," I decided to do this all from
> scratch with s2 and friends. So, I'm creating a site that is centered
> around managing a team. The goal is to make a resource for parents and
> fans to discuss the teams and athletes. It will mostly be a knock-off of
> other blogs and forums, but it will provide some extra functionality for
> whichever sport is being managed. So, stats, pictures and videos can be
> uploaded. A schedule can be viewed (and managed by coaches). Coaches can
> blog about the various events (matches, tournaments, etc.). And, users
> can post in a forum (polls, regular forums).
>
> The fun part - The site is struts 2.1.?-SNAPSHOT based using Maven,
> Spring, Hibernate (JPA), SiteMesh, Acegi, and Prototype/JQuery (haven't
> decided yet). I'm using the codebehind plugin and other than acegi, I've
> hardly written any configuration at all! It's wonderful. The
> breakthrough I had was that I've created something like 40 entities so
> far and just began work on s2 actions. I was crossing my fingers that my
> generic dao, codebehind and spring autowire would allow me to code by
> convention and that things would work properly. Imagine my surprise when
> I had my first action working in less than a few hours! When I'm done, I
> may yank the guts out and post an integrated blog/forum project to
> sourceforge as an example of s2/spring/sitemesh/jpa with hints of AJAX,
> but that's a ways out...
>
> -Wes
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>  
Fans are the best coach. Did you know that!?

As I understand your project I it sounds close to what certain
'low-level' European soccer clubs are doing to raise money for their
club. For a little fee every fan owns part of the club and over the web
they can decide over the formation, the training schedule and what else.
In some case the coach has to do what the people say in other case he
simply has to justify if not doing so.
The one soccer club I know of is Ebbsfleet
(http://www.ebbsfleetunited.co.uk/) with their project MyFootballClub
(http://www.myfootballclub.co.uk/).

Just wanted to share this perspective.

greetz

Attachment: user_185138.ezm (zipped)
My little dirty pet project is a small web bug planted into the corporate
intranet websites to collect internal user access statistics and generate
report,

The logon user is taken from IIS integrated Windows authentication,
which is connected to Tomcat using ajp connector, and the user details
are taken from corporate LDAP server

I use Maven, Hibernate, Spring, Generic DAO, and displaytag, wonderful
combination :)

Roger

On 4/7/08, Wes Wannemacher <wesw@(protected):
>
> I've been quiet on this one, but since I finally had a breakthrough
> today, I feel like talking about it :)
>
> I started a pet project that I've been toying around in my head for a
> while. As a parent, I coach a few elementary and junior high sports. It
> is a volunteer thing, and if offered pay, I would refuse it (the schools
> need the money more than I do). The biggest complaint that parents have
> though is that they feel like we don't provide enough information, etc.
> Sometimes I want to tell the parents that complain to shove it :), but
> as a parent myself, I feel the same way about teachers, so I try to do a
> better job each season. Since I setup a wordpress/phpBB site a while
> back (which I haven't been too diligent about updating), I thought about
> doing something similar. Having dealt once with wordpress/phpBB, I have
> vowed to never do it again.
>
> In an attempt to "eat-my-own-dog-food," I decided to do this all from
> scratch with s2 and friends. So, I'm creating a site that is centered
> around managing a team. The goal is to make a resource for parents and
> fans to discuss the teams and athletes. It will mostly be a knock-off of
> other blogs and forums, but it will provide some extra functionality for
> whichever sport is being managed. So, stats, pictures and videos can be
> uploaded. A schedule can be viewed (and managed by coaches). Coaches can
> blog about the various events (matches, tournaments, etc.). And, users
> can post in a forum (polls, regular forums).
>
> The fun part - The site is struts 2.1.?-SNAPSHOT based using Maven,
> Spring, Hibernate (JPA), SiteMesh, Acegi, and Prototype/JQuery (haven't
> decided yet). I'm using the codebehind plugin and other than acegi, I've
> hardly written any configuration at all! It's wonderful. The
> breakthrough I had was that I've created something like 40 entities so
> far and just began work on s2 actions. I was crossing my fingers that my
> generic dao, codebehind and spring autowire would allow me to code by
> convention and that things would work properly. Imagine my surprise when
> I had my first action working in less than a few hours! When I'm done, I
> may yank the guts out and post an integrated blog/forum project to
> sourceforge as an example of s2/spring/sitemesh/jpa with hints of AJAX,
> but that's a ways out...
>
>
> -Wes
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185128.ezm (zipped)
Sorry for this *very* OT thread, but in Italy a YouTube video is
becoming more and more popular: a manager of Telecom Italia shows his
knowledge of history:

http://www.youtube.com/watch?v=Kb5T18v81E0

Now with English translation :-D

Antonio

Attachment: user_185129.ezm (zipped)
To find out more about Twitter, visit the link below:

http://twitter.com/i/f327651c00cf424e4e1e8f79af0ee6654ad1bd9c

Thanks,
-The Twitter Team

About Twitter

Twitter is a unique approach to communication and networking based on the simple concept of status. What are you doing? What are your friends doing—right now? With Twitter, you may answer this question over SMS, IM, or the Web and the responses are shared between contacts.

Attachment: user_185130.ezm (zipped)

Thank you for the help.

But I could not get it to work.

Here is a code sample from the Action Class:

...
private Set<TraegerPermission> traegerPermissions;
...

The class TraegerPermissions itself have another collection:
...
private Collection<EinrichtungPermission> einrichtungen;
...

In jsp I have successful read access:
...
<s:iterator value="traegerPermissions" id="item">
         <tr id="row_<s:property value="id"/>">
           <td>  
             Träger - id <s:property value="%{#item.id}"/>
           </td>
           <td>
             <s:property value="%{number}" />
           </td>
           <td>
             <s:property value="%{name}" />
           </td>            
           <s:checkbox cssClass="chkbox" theme="eud_xhtml" name="writepermission"
id="%{'traeger_write_'+id}" value="%{writePermission}"/>
           <s:checkbox cssClass="chkbox" theme="eud_xhtml"
name="reportPermission" id="%{'traeger_report_'+id}"
value="%{reportPermission}"/>
         </tr>
         <s:iterator value="%{einrichtungen}">
         <tr id="row_<s:property value="id"/>">
           <td>  
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Einrichtung
           </td>
           <td>
             <s:property value="%{number}" />
           </td>
           <td>
             <s:property value="%{name}" />
           </td>
           <s:checkbox cssClass="chkbox" theme="eud_xhtml" name="writePermission"
id="%{'einrichtung_write_'+id}" value="%{writePermission}"/>
           <s:checkbox cssClass="chkbox" theme="eud_xhtml"
name="reportPermission" id="%{'einrichtung_report_'+id}"
value="%{reportPermission}"/>
...

what shall I save in order to can write back changes in the Checkboxes
to the model by struts2 out of box approach?

I tries several settings without success ...

thank you,
Basti



Laurie Harper wrote:
>
> Provided the checkbox is properly bound to the collection entry, yes.
> You need to specify the name of the s:checkbox (or any other input type)
> as userCollection[index].userProperty where 'userCollection' is the name
> of the Collection property on your action, index comes from the iterator
> and userProperty is the property to bind to.
>
> L.
>
> lbastil wrote:
>> Thank you for reply!
>>
>> I just wonder:
>>
>> I understand it would work out of box for 1 User-Object, if I bound
>> checkbox
>> to permission property of this user.
>> But I wonder it should work out of box if I use (as I described)
>> Collection
>> of Users in Action
>> and on jsp side iterator tag, and checkbox tag within iterator is bound
>> to
>> permission properties of users in the iterated Collection.
>>
>> This does not matter, it should work the same as for single user object?
>>
>>
>> Thank you,
>> Basti
>>
>>
>> Laurie Harper wrote:
>>> lbastil wrote:
>>>> Hello,
>>>>
>>>> I have the following problem:
>>>>
>>>> in action i have a collection of class User
>>>> each class User have different attributes, one is: boolean permission
>>>>
>>>> in JSP I use struts 2 iterator tag to iterate the User Objects.
>>>> For each User entry I create one row in table.
>>>> for displaying/changing the boolean permission value I use S2 checkbox
>>>> tag
>>>>
>>>> so far it works fine and show all data in collection of Users correct.
>>>>
>>>> But how can I set changed checkbox values (the permission attribute)
>>>> back
>>>> to
>>>> action?
>>> If your checkbox is bound the the permission property of the user,
>>> submitting the form should update the property. If that's not happening,
>>> you need to give more details: what your JSP code looks like, and the
>>> relevant bits of your action and User code, at least.
>>>
>>> L.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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)
>
>
>

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


Attachment: user_185134.ezm (zipped)
--- Wes Wannemacher <wesw@(protected):
> [...] Prototype/JQuery (haven't decided yet).

JQuery, but be wary of memory leaks in IE5/6; haven't tested as much under 7
yet.

Fairly substantial leaks, too, like upwards of a couple megs-per-request
under some circumstances, which I haven't had time to fully track down :(

Dave


Attachment: user_185136.ezm (zipped)
Hi,
I am getting this ClassCastException in
org.apache.struts.upload.MultipartRequestWrapper . I have debugged the
code and it looks like the error is coming in
org.apache.struts.tiles.UrlController.
UrlController's perform method has these lines of code. The exception is
happening at rd.include(...
On checking the previous archives, I found this was a bug in struts 1.1
but had been fixed in the final releases , but the fix was in the
RequestProcessor class.

 RequestDispatcher rd = servletContext.getRequestDispatcher( url );
 if( rd == null )
  throw new ServletException( "Controller can't find url '" + url +
"'." );

 rd.include( request, response );

Please help. Thanks.

Exception stack Trace
java.lang.ClassCastException:
org.apache.struts.upload.MultipartRequestWrapper
 at
weblogic.servlet.internal.ServletRequestImpl.getOriginalRequest(ServletR
equestImpl.java:1316)
 at
weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatche
rImpl.java:345)
 at
org.apache.struts.tiles.UrlController.perform (UrlController.java:111)
 at
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(Til
esRequestProcessor.java:243)
 at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(Tiles
RequestProcessor.java:309)
 at
org.apache.struts.action.RequestProcessor.process (RequestProcessor.java:
279)
 at
org.apache.struts.action.ActionServlet.process (ActionServlet.java:1482)
 at
org.apache.struts.action.ActionServlet.doPost (ActionServlet.java:525)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:763)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:856)





Attachment: user_185137.ezm (zipped)
Hi Ghan. You're not trying to directly access the JSP are you? For
instance, browsing to http://host/emsitem/emsList.jsp? You need to go
through the action: http://host/context/list.action, and then make sure
that your action bean returns a result string of "SUCCESS", and it will
automatically navigate to your resulting JSP page.

--Eric

-----Original Message-----
From: ghan_java [mailto:ghanshyam_ambah@(protected)]
Sent: Sunday, April 06, 2008 2:14 AM
To: user@(protected)
Subject: The requested resource
(/struts2-blank-2.0.11.1/emsitem/index.jsp) is not available.


hi , i tried to add new jsp in struts2-blank application, iand i have
configer it into sturts.xml
but it's

<package name="ems" extends="struts-default" namespace="/ems">
   <default-interceptor-ref name="crudStack" />

   <action name="list" class="action.EmsAction"
method="list">
     <result>/emsitem/emsList.jsp</result>
     <interceptor-ref name="basicStack" />
   </action>
   <action name="edit" class="action.EmsAction">
     <result>/emsitem/editItem.jsp</result>
     <interceptor-ref name="params" />
     <interceptor-ref name="basicStack" />
   </action>


but when i try run these jsp on server , it not responded me ..

--
http://www.nabble.com/The-requested-resource-%28-struts2-blank-2.0.11.1-
emsitem-index.jsp%29-is-not-available.-tp16521956p16521956.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)


Attachment: user_185141.ezm (zipped)
--- Eric Nelson <eric.nelson@(protected):
> Hi Ghan. You're not trying to directly access the JSP are you? For
> instance, browsing to http://host/emsitem/emsList.jsp? You need to go
> through the action: http://host/context/list.action, and then make sure
> that your action bean returns a result string of "SUCCESS", and it will
> automatically navigate to your resulting JSP page.

Navigating directly to the JSP, if the JSP isn't in the /WEB-INF hierarchy,
shouldn't return anything like "not available". Any issues would be data-
and/or tag-related.

It's more likely that either: the app or JSP isn't being deployed, or there's
a configuration issue.

With no real error message provided in the original post it's impossible to
say, though.

Dave


Attachment: user_185139.ezm (zipped)
You CAN set the property to a different value every time. Most of my
action beans implement this behavior just fine. Did you make sure your
action bean implements the ParameterAware interface? This binds your
action bean properties to the current values in the request scope.

--Eric

-----Original Message-----
From: Marc Ende [mailto:mlists@(protected)]
Sent: Sunday, April 06, 2008 1:19 PM
To: Struts Users Mailing List
Subject: Re: Url-Parameters only set once

Hello Dave,

I've found a solution for that. The spring-action was standard-scoped
and in cause of that it didn't accept the
id parameter a second time.

I think it's a little bit strange that it's impossible to set an
property again when it's done before.

Marc




Dave Newton schrieb:
> --- Marc Ende <mlists@(protected):
>  
>> I've got a list with several items which are linked to a
details-action.
>> If I klick on an item after the restart of the webapp a link like
>> http://.../details.action?id=123
>> is called. Everything is fine. I can see the correct details site.
>> When I go back and klick on another item (with another id)
>> the old id is called from the database and shown.
>>  
>
> Without any further info it's hard to say what the problem might be.
>
> Actions are instantiated per-request, unless you've mis-configured a
> Spring-defined action.
>
> Depending on how you're creating the links (and how your application
is laid
> out) you may be getting URL parameters you're not expecting in your
link;
> <s:url...> has an "includeParams" attribute you might want to look at.
>
> I'm sure there are more possibilities, but we might need more info in
order
> to help.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> 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_185140.ezm (zipped)
--- Eric Nelson <eric.nelson@(protected):
> You CAN set the property to a different value every time. Most of my
> action beans implement this behavior just fine. Did you make sure your
> action bean implements the ParameterAware interface? This binds your
> action bean properties to the current values in the request scope.

Just for completeness, ParameterAware is for getting the map of parameters,
not for binding those parameters to action properties.

Dave


Attachment: user_185142.ezm (zipped)

Hi there,

can anyone adivse how to return a 'Success message' to a div after a file
was uploaded?
For some reason, I get this annoying message [Object] after a file was
successfully uploade. This is caused because I return a message to a div
(without it, it works ok - but the page is refreshed)

code:
<%@(protected)" %>

<%
  request.setAttribute("decorator", "none");
  response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
  response.setHeader("Pragma","no-cache"); //HTTP 1.0
  response.setDateHeader ("Expires", 0); //prevents caching at the proxy
server
%>
<head>
  <s:head theme="ajax" debug="true"/>
</head>


<s:form action="files_insertFile" method="POST"
enctype="multipart/form-data" cssStyle="font-size :  8pt; font-family:
verdana" >
     
     <s:file size="33" name="upload" label="File"/>      
     
  <s:submit action="files_insertFile" theme="ajax"
targets="id_result_success_file" showLoadingText="false"
indicator="loadingImage"/>  
   
</s:form>

<s:div id="id_result_success_file" theme="ajax"></s:div>

* the code runs smoothly and return a jsp page with a confirmation (success)
* using both IE7 and FireFox - same error
* no error on the javascript [fireBug]
--
Sent from the Struts - User mailing list archive at Nabble.com.


Attachment: user_185143.ezm (zipped)
Hi! I'm having a very interesting issue with CGLIB proxies. I'm proxying
my actions with Spring AOP (to get declarative transactions on each
Action).

Everything is working great, except when I try action chaining, I get a
class cast exception that Action2 can't be cast to Action1 (Action1 is
first in the chain).

This was very unusual, so I investigated. Here's what I found:

OgnlUtil.copy() is calling all of the getters in Action1 and pumping
that data into setters on Action2. With CGLIB, it calls getCallbacks()
and setCallbacks(), two methods created by CGLIB. This results in
Action2 having Action1's callbacks. Basically, it's similar to the
Action2 proxy referencing the Action1 target!

I can't use JDK proxies because the getters on my action (whose values
will be part of the value stack) are not defined on any interfaces, so
reflection on a JDK proxy will not find those getters.

I have a few ideas for workarounds, but I'd like to ask: has anyone else
seen this? Am I the first to try CGLIB proxies and Action chaining?

I've also read that action chaining is discouraged, but I don't
understand why. Maybe a completely different approach would work better?

Thanks!

Brad Cupit
Louisiana State University - UIS


Attachment: user_185145.ezm (zipped)
ServletActionRedirectResult worked when I used it instead of the
ActionChainResult. This performs an extra round trip back to the
browser, which isn't terrible unless I want to pass data from one Action
to another, and herein lies some concern.

Here's my design, and if you guys think it's flawed I'm certainly
willing to take criticism!

GETs are simple: just an Action that does some work and forwards to the
view.

POSTS should each have their own Action (which may write the data to the
DB). This Action should only process the POST. Afterwards, it forwards
(chains) to another Action, which sits in front of the view. If the view
needs data from the DB, it goes in the Action for that view (not the
POST-handling Action). If the view doesn't need data, then the Action is
dumb and just forwards to the view.

No direct links are made to JSPs, instead they link to the associated
Action. We can make exceptions for very simple views that are tied to
the POST (like a confirmation page), maybe it wouldn't need two Actions.

The advantage of this is two-fold:
a) if we ever need to make a 'dumb' action do DB lookups, we don't have
to change any links, just the dumb Action
b) we can reuse any JSP easily since all DB operations for it are
performed by its associated Action

Seems like a nice design, but Action chaining isn't recommended, and
isn't working with CGLIB proxies :-(

p.s. the codebehind plugin makes it so we don't have to write those dumb
actions. Nice!!

Brad Cupit
Louisiana State University - UIS

-----Original Message-----
From: Brad A Cupit
Sent: Monday, April 07, 2008 11:10 AM
To: 'user@(protected)'
Subject: interesting proxy + action chain issue

Hi! I'm having a very interesting issue with CGLIB proxies. I'm proxying
my actions with Spring AOP (to get declarative transactions on each
Action).

Everything is working great, except when I try action chaining, I get a
class cast exception that Action2 can't be cast to Action1 (Action1 is
first in the chain).

This was very unusual, so I investigated. Here's what I found:

OgnlUtil.copy() is calling all of the getters in Action1 and pumping
that data into setters on Action2. With CGLIB, it calls getCallbacks()
and setCallbacks(), two methods created by CGLIB. This results in
Action2 having Action1's callbacks. Basically, it's similar to the
Action2 proxy referencing the Action1 target!

I can't use JDK proxies because the getters on my action (whose values
will be part of the value stack) are not defined on any interfaces, so
reflection on a JDK proxy will not find those getters.

I have a few ideas for workarounds, but I'd like to ask: has anyone else
seen this? Am I the first to try CGLIB proxies and Action chaining?

I've also read that action chaining is discouraged, but I don't
understand why. Maybe a completely different approach would work better?

Thanks!

Brad Cupit
Louisiana State University - UIS

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