Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 4 Apr 2008 05:04:23 -0000 Issue 7963

user-digest-help

2008-04-04


Author LoginPost Reply

user Digest 4 Apr 2008 05:04:23 -0000 Issue 7963

Topics (messages 185026 through 185045):

Re: <s:iterator> tag help
 185026 by: Musachy Barroso
 185028 by: Musachy Barroso
 185029 by: Dustin S.
 185035 by: Eric Nelson

Simple question in <s:tabbedPanel>
 185027 by: sharath karnati

Re: rrrrr...why my field returns null????
 185030 by: Laurie Harper

s:include ou jsp:include
 185031 by: Pedro Herrera

s:include or jsp:include
 185032 by: Pedro Herrera

Re: Default JSP content type
 185033 by: Laurie Harper

Re: clearFieldErrors() - where is it ?
 185034 by: Laurie Harper

Re: Struts 2.1 TabbedPanel scenario
 185036 by: Laurie Harper

[S2] Struts with Web Services
 185037 by: Kelly.Graus
 185039 by: Lukasz Lenart
 185043 by: Wes Wannemacher

Re: Freemarker (old version that struts2 uses) disappearing pages
 185038 by: Jeromy Evans

Hi / Question - TabbedPanel with DisplayTag
 185040 by: Márcio Gurgel
 185042 by: Jeromy Evans

Re: struts.xml
 185041 by: Adam Hardy

Re: <s:radio> issue
 185044 by: Niral Trivedi

Tiles in 1.3.9
 185045 by: balaji.m.cs

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_185026.ezm (zipped)
Use the "id" attribute in the for tag, like id="currInt".

musachy

On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson <eric.nelson@(protected):
> Hi. This question may be very simple to answer, but it's driving me
> crazy. If I have code similar to:
>
>
>
> <s:iterator value="intList">
>
> </s:iterator>
>
>
>
> Where intList is of type List<Integer>, how do I reference to current
> Integer on the value stack without using <s:property />? So I want to
> reference the current Integer with OGNL or EL expression language like:
>
>
>
> <select>
>
> <s:iterator value="intList">
>
>         <option value="${currInt}" <s:if test="${currInt ==
> 1}">selected</s:if>>${currInt}</option>
>
> </s:iterator>
>
> </select>
>
>
>
> Here, currInt is the reference to the current Integer on the value
> stack. I hope this makes sense. Any help would be greatly appreciated.
>
>
>
> Thanks,
>
>
>
> Eric Nelson
>
> Software Engineer Program Manager
>
>
>
>



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

Attachment: user_185028.ezm (zipped)
I meant "iterator" tag ;)

musachy

On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso <musachy@(protected):
> Use the "id" attribute in the for tag, like id="currInt".
>
> musachy
>
>
>
> On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson <eric.nelson@(protected):
> > Hi. This question may be very simple to answer, but it's driving me
> > crazy. If I have code similar to:
> >
> >
> >
> > <s:iterator value="intList">
> >
> > </s:iterator>
> >
> >
> >
> > Where intList is of type List<Integer>, how do I reference to current
> > Integer on the value stack without using <s:property />? So I want to
> > reference the current Integer with OGNL or EL expression language like:
> >
> >
> >
> > <select>
> >
> > <s:iterator value="intList">
> >
> >         <option value="${currInt}" <s:if test="${currInt ==
> > 1}">selected</s:if>>${currInt}</option>
> >
> > </s:iterator>
> >
> > </select>
> >
> >
> >
> > Here, currInt is the reference to the current Integer on the value
> > stack. I hope this makes sense. Any help would be greatly appreciated.
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Eric Nelson
> >
> > Software Engineer Program Manager
> >
> >
> >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



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

Attachment: user_185029.ezm (zipped)
Not sure I understand your question ... but

Are you aware of the "status" attribute in the iterator tag?

Something like:

<s:iterator value="intList" status="rowstatus">
 <option value="rowstatus.count">...etc
</s:iterator>
On Thu, Apr 3, 2008 at 2:54 PM, Musachy Barroso <musachy@(protected):

> I meant "iterator" tag ;)
>
> musachy
>
> On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso <musachy@(protected):
> > Use the "id" attribute in the for tag, like id="currInt".
> >
> > musachy
> >
> >
> >
> > On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson <
> eric.nelson@(protected):
> > > Hi. This question may be very simple to answer, but it's driving me
> > > crazy. If I have code similar to:
> > >
> > >
> > >
> > > <s:iterator value="intList">
> > >
> > > </s:iterator>
> > >
> > >
> > >
> > > Where intList is of type List<Integer>, how do I reference to
> current
> > > Integer on the value stack without using <s:property />? So I want
> to
> > > reference the current Integer with OGNL or EL expression language
> like:
> > >
> > >
> > >
> > > <select>
> > >
> > > <s:iterator value="intList">
> > >
> > >         <option value="${currInt}" <s:if test="${currInt ==
> > > 1}">selected</s:if>>${currInt}</option>
> > >
> > > </s:iterator>
> > >
> > > </select>
> > >
> > >
> > >
> > > Here, currInt is the reference to the current Integer on the value
> > > stack. I hope this makes sense. Any help would be greatly
> appreciated.
> > >
> > >
> > >
> > > Thanks,
> > >
> > >
> > >
> > > Eric Nelson
> > >
> > > Software Engineer Program Manager
> > >
> > >
> > >
> > >
> >
> >
> >
> > --
> > "Hey you! Would you help me to carry the stone?" Pink Floyd
> >
>
>
>
> --
> "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)
>
>

Attachment: user_185035.ezm (zipped)
I'm such an idiot. This works great. Thanks Musachy.

--Eric

-----Original Message-----
From: Musachy Barroso [mailto:musachy@(protected)]
Sent: Thursday, April 03, 2008 2:54 PM
To: Struts Users Mailing List
Subject: Re: <s:iterator> tag help

I meant "iterator" tag ;)

musachy

On Thu, Apr 3, 2008 at 4:52 PM, Musachy Barroso <musachy@(protected)>
wrote:
> Use the "id" attribute in the for tag, like id="currInt".
>
> musachy
>
>
>
> On Thu, Apr 3, 2008 at 4:38 PM, Eric Nelson
<eric.nelson@(protected):
> > Hi. This question may be very simple to answer, but it's driving
me
> > crazy. If I have code similar to:
> >
> >
> >
> > <s:iterator value="intList">
> >
> > </s:iterator>
> >
> >
> >
> > Where intList is of type List<Integer>, how do I reference to
current
> > Integer on the value stack without using <s:property />? So I
want to
> > reference the current Integer with OGNL or EL expression language
like:
> >
> >
> >
> > <select>
> >
> > <s:iterator value="intList">
> >
> >         <option value="${currInt}" <s:if test="${currInt ==
> > 1}">selected</s:if>>${currInt}</option>
> >
> > </s:iterator>
> >
> > </select>
> >
> >
> >
> > Here, currInt is the reference to the current Integer on the value
> > stack. I hope this makes sense. Any help would be greatly
appreciated.
> >
> >
> >
> > Thanks,
> >
> >
> >
> > Eric Nelson
> >
> > Software Engineer Program Manager
> >
> >
> >
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>



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


Attachment: user_185027.ezm (zipped)
Hi All,
 
  I'm having following tabbedpanel,whenever I select a tabbed pane I'd like to call a javascript method. I tried onselect/onclick but these are not working.
 
 
<s:tabbedPanel id="tabContainer" cssStyle="valign:top; height: 500px;" doLayout="true" >
 
<s:div id="Panel1" label="Admin" theme="ajax" labelposition="top" onselect="javascript:loading('Panel1');">
This is Panel1<br/>
</s:div>
 
<s:div id="Panel2" label="Detail" theme="ajax" labelposition="top" onselect="javascript:loading('Panel2');">
This is Panel2<br/>
</s:div>
</s:tabbedPanel>
 
Thanks for your help in advance.
 
Regards,
Sharath.

   
---------------------------------
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.

Attachment: user_185030.ezm (zipped)
If it works without theme set to ajax, it's probably a client-side
issue. What browser are you using? Are there any Javascript errors reported?

L.

xianwinwin wrote:
> thank you Laurie for your reply.
>
> I made a type - its str not the Note. so the str is null :-(
>
> when I remove the theme="ajax" it works fine. BUT I need it there (the idea
> that the form will disappear once the action is completed).
>
> how do I get the value of the str? rrrrrr :-(
> I've been trying different variation - nothing!
>
> thanks for any pointer!
>
>
>
> Laurie Harper wrote:
>> Your action doesn't have a bean of name/type Note, it only has a single
>> String property 'str'. Did you mean this property is not being set? From
>> the code you've included, it should be set from the textfield so you
>> must have something configured wrong. What does your action mapping look
>> like? Are you using the default interceptor stack or have you specified
>> a different one?
>>
>> L.
>>
>> xianwinwin wrote:
>>> Can anyone advise why my bean is null.
>>>
>>> I have the following jsp page:
>>>
>>> <html>
>>> <head>
>>>   <s:head theme="ajax"/>
>>> </head>
>>> <body>
>>>  
>>> <s:form    
>>>    theme="ajax"
>>>    id="myForm"
>>>    cssStyle="font-size :  8pt; font-family: verdana"
>>>    action="notes_insert"
>>>    method="post" >
>>>
>>>  <s:textarea rows="5" cols="60" name="str" label="Add Note"
>>> required="true"/>
>>>
>>>  
>>>  <s:submit align="center" targets="myForm" theme="ajax"/>  
>>>  
>>> </s:form>
>>>
>>> when the user cllicks submit - the action 'insert' kicksin but the bean
>>> (Note) is null (yes, i have getter and setter)
>>>
>>>
>>>
>>>
>>> //action
>>> @Validation
>>> public class NoteAction extends BaseSupport implements Serializable
>>> {    
>>>  private String str;
>>>  
>>>  
>>>  @SkipValidation
>>>  public String insert()
>>>  {      
>>>    System.out.println("the value is "+ str);
>>>  }
>>>
>>>
>>>  public String getStr()
>>>  {
>>>    return str;
>>>  }
>>>
>>>  public void setStr(String str)
>>>  {
>>>    this.str = str;
>>>  }
>>> }
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>


Attachment: user_185031.ezm (zipped)

Hi,
 What´s diference of use between s:include and jsp:include.


Thanks

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


Attachment: user_185032.ezm (zipped)

Hi,
 What´s diference of use between s:include and jsp:include.


Thanks

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


Attachment: user_185033.ezm (zipped)
Page encoding yes; content type, not sure:

http://java.sun.com/javaee/5/docs/tutorial/doc/bnajg.html

L.

Matthew Seaborn wrote:
> Does anyone know if it is possible to override the default JSP page content type and/or page encoding either for an entire web-app or as part of Struts 2?
>
> Many thanks.
>
>
>
>
>
> Matthew Seaborn
> Software Architect
> t   +44(0) 208 484 0729
> m +44(0) 7949 465 142
> e  matthew.seaborn@performgroup.com<mailto:matthew.seaborn@(protected)>
>
> [cid:image001.jpg@(protected)]
> Sussex House
> Plane Tree Crescent
> Feltham, Middlesex, TW13 7HE
> United Kingdom
> http://www.performgroup.com/
>
>
>
>
> ________________________________________________________________________
>
> CONFIDENTIALITY - This email and any files transmitted with it, are confidential, may be legally privileged and are intended solely for the use of the individual or entity to whom they are addressed. If this has come to you in error, you must not copy, distribute, disclose or use any of the information it contains. Please notify the sender immediately and delete them from your system.
>
> SECURITY - Please be aware that communication by email, by its very nature, is not 100% secure and by communicating with Perform Group by email you consent to us monitoring and reading any such correspondence.
>
> VIRUSES - Although this email message has been scanned for the presence of computer viruses, the sender accepts no liability for any damage sustained as a result of a computer virus and it is the recipient’s responsibility to ensure that email is virus free.
>
> AUTHORITY - Any views or opinions expressed in this email are solely those of the sender and do not necessarily represent those of Perform Group.
>
> COPYRIGHT - Copyright of this email and any attachments belongs to Perform Group, Companies House Registration number 6324278.



Attachment: user_185034.ezm (zipped)
it@(protected):
> Hi guys,
>
> in struts2 i have a class that extends ActionSupport.
>
> In my validate method i can use clearErrorsAndMessages(); but when i try
> clearFieldErrors() eclipse can not find it .

It looks like clearFieldErrors() was introduced in the (not yet
released) 2.1.x stream; there's no such method in 2.0.11.1.

> Should i put setFieldErrors(null); or extend another class ?

That might work. It might be safer to use getFieldErrors().clear() though.

L.


Attachment: user_185036.ezm (zipped)
Have you looked at the s:action tag? It sounds like that could solve at
least part of your problem. I'm still not clear how you expect two
actions designed in isolation to suddenly be able to work in tandem
without modification. As I say, you can't submit a request to more than
one action at once -- at least, not without creating a third action to
delegate to the other two...

L.

Shoaib Gauhar wrote:
> First of all, thanks for replying. I really appreciate it. Making a single
> action class will make the classes very bulky and complex. I dont want to
> have that. I used the remote tabs functionality in tabbed panel but all it
> does is that it goes into a infinite recursive loop. It adds infinite number
> of tabs and the page hangs. Maybe its an implementation error.
>
> I dont know how to make the dataset common other than make one action class
> which in my case is certainly achievable but not acceptable.
>
> Let me make the scenario a bit more understandable.
>
> I am working on a product which generates jsp pages and action classes in
> struts 2. Lets suppose that the user has built two different jsps and action
> classes. They work separately perfectly. Now, we are giving him the option
> to make a tabbed pane by using those two sets of jsps and action classes.
> One way would be to merge them and make one jsp and one action class. Which
> in my case is again achievable but very complex and the code will not be
> readable. The next idea which came to my mind (i dont know if it is
> achievable or not) is to make one jsp but have two separate action classes.
> Each tab remotely accessing the dataset of each action class.
>
> There is no other idea which is coming to my mind at the moment. So, any
> other idea will be highly appreciated. The worst thing is that the solution
> must be generic. :,(
>
> Thanks again,
>
> Shoaib Ahmad Gauhar
>
>
>
> Laurie Harper wrote:
>> Shoaib Gauhar wrote:
>>> Hello,
>>>
>>> Here is the scenrio. I have two action classes. ClassA and ClassB. There
>>> is
>>> no relationship among these classes. You might say that if there is no
>>> relationship then why i have to put them in one single jsp. Well its a
>>> client's requirement.
>> That's an implementation detail, not a functional requirement. Why does
>> the client care how you structure your actions?
>>
>>> In a single jsp there are two tabs. Tab1ForClassA and Tab2ForClassB.
>>>
>>> Each tab has fields concerned to their classes as defined above. Tab1 ->
>>> ClassA and Tab2 -> ClassB.
>>>
>>> Can we do it? I have tried this but what happens is that when i submit
>>> the
>>> data on Tab1, Tab2's data becomes empty.
>> A request is only processed by one action. If you need both actions to
>> be able to process all the input from both tabs, you'll have to have
>> them both aware of the full dataset. There are a number of ways you
>> might achieve that, depending on what you're trying to achieve.
>>
>>> So, any ideas will be highly appreciated. Furthermore, i am quite new to
>>> tabbed panel and would require clear tips and ideas.
>> I haven't used that widget in Struts 2 so can't offer specific tips.
>> However, if you start by defining the functional requirements (rather
>> than the implementation details), it'll be easier to offer advice.
>>
>> L.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>>
>


Attachment: user_185037.ezm (zipped)

Hello,

I've been spending the last couple months familiarizing myself with a few
java based web technologies, mainly Struts 2, Spring, and Hibernate. I have
a decent understanding of Struts, enough to make a few simple example
webapps that have helped me learn the concepts (along with a lot of help
from this message board!).

I'm now trying to design a "real" webapp that does more than one simple
task. The basic idea is that I want a single User database that contains
login and registration information (user name, password, name, address,
etc). When a user logs in, they are presented with a home page that shows
them all of the resources they are able to access (things like product
updates, product information, trial keys, etc).

Were I writing this webapp with what I know now, I would make a single
webapp that uses a database for user information, and a different database
that contains all of the information of the resources that the user is able
to access. Authentication and authorization would be handled using Acegi
(of which I have a very limited understanding of).

However, we also have other webapps that we would like to be able to access
the same user login information. One way (the only way I know of) would be
to have these other applications access the same user database and have all
of the same Acegi configuration. Each webapp would have all of the
configuration needed to allow users to login, manage their accounts, etc.
The vast majority of this configuration would be duplicated for each webapp.

It seems like a better way to handle this situation would be to have a
single "web service" that deals just with user login and registration. Then
any webapp that needs to have a user login would just redirect to this web
service and get back some sort of User object. Each individual webapp would
only need to configure Acegi for the specific resources that they provide.
So my above example would look up the user in a database and present user
specific resources. A webapp that allows a user to activate a product using
a product key would just have a database to map a user to the products they
have activated.

So finally my questions (sorry for the long winded explanation):

1. Is this login "web service" something that is actually commonly used?
2. Is this what a web service actually is, or am I applying that term where
it doesn't belong?
3. Is Acegi flexible enough to use in a setup like this?
4. Is there enough additional complexity in setting up a system like this
that it would also make sense to look into just duplicating the
configuration for each webapp?
5. Are there any good books, web tutorials, etc that talk about this?

I guess what I'm basically looking for is a little design direction,
possibly other technologies that provide these services so I'm not trying to
build an entire system from scratch.

Thanks in advance for your suggestions!

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


Attachment: user_185039.ezm (zipped)
Hi,

> 1. Is this login "web service" something that is actually commonly used?

Yes and no, mainly because WS is session-less and you have to manage
the session token by your self. We use such approach internally,
through ssl and we manage session expirations by hand.

> 2. Is this what a web service actually is, or am I applying that term where
> it doesn't belong?

In my opinion, if you don't have global SOA architecture /
specification / whatever it can be what ever you want, but without
clear path it can be mess in the near future.

> 3. Is Acegi flexible enough to use in a setup like this?

I think yes, you can extend almost everything / re-implement all the
classes and customize them to do what you want.

> 4. Is there enough additional complexity in setting up a system like this
> that it would also make sense to look into just duplicating the
> configuration for each webapp?

If you will have common template / approach / guideline there be
nothing more just to setup individual settings for each webapp. In
other case, you will all the time invite the wheel.

> 5. Are there any good books, web tutorials, etc that talk about this?

Google? IBM alfa works site ? ;-)

> I guess what I'm basically looking for is a little design direction,
> possibly other technologies that provide these services so I'm not trying to
> build an entire system from scratch.

I thing you should start building your SOA strategy and how to fit it
to your current projects / structure. It's better to thing twice.


Regards
--
Lukasz

http://www.linkedin.com/in/lukaszlenart

Attachment: user_185043.ezm (zipped)
I see that Lukasz already has a longer response, but if I am reading
your request properly, then I think you might be looking for CAS -

http://www.ja-sig.org/products/cas/

-Wes

On Thu, 2008-04-03 at 16:00 -0700, Kelly.Graus wrote:
> Hello,
>
> I've been spending the last couple months familiarizing myself with a few
> java based web technologies, mainly Struts 2, Spring, and Hibernate. I have
> a decent understanding of Struts, enough to make a few simple example
> webapps that have helped me learn the concepts (along with a lot of help
> from this message board!).
>
> I'm now trying to design a "real" webapp that does more than one simple
> task. The basic idea is that I want a single User database that contains
> login and registration information (user name, password, name, address,
> etc). When a user logs in, they are presented with a home page that shows
> them all of the resources they are able to access (things like product
> updates, product information, trial keys, etc).
>
> Were I writing this webapp with what I know now, I would make a single
> webapp that uses a database for user information, and a different database
> that contains all of the information of the resources that the user is able
> to access. Authentication and authorization would be handled using Acegi
> (of which I have a very limited understanding of).
>
> However, we also have other webapps that we would like to be able to access
> the same user login information. One way (the only way I know of) would be
> to have these other applications access the same user database and have all
> of the same Acegi configuration. Each webapp would have all of the
> configuration needed to allow users to login, manage their accounts, etc.
> The vast majority of this configuration would be duplicated for each webapp.
>
> It seems like a better way to handle this situation would be to have a
> single "web service" that deals just with user login and registration. Then
> any webapp that needs to have a user login would just redirect to this web
> service and get back some sort of User object. Each individual webapp would
> only need to configure Acegi for the specific resources that they provide.
> So my above example would look up the user in a database and present user
> specific resources. A webapp that allows a user to activate a product using
> a product key would just have a database to map a user to the products they
> have activated.
>
> So finally my questions (sorry for the long winded explanation):
>
> 1. Is this login "web service" something that is actually commonly used?
> 2. Is this what a web service actually is, or am I applying that term where
> it doesn't belong?
> 3. Is Acegi flexible enough to use in a setup like this?
> 4. Is there enough additional complexity in setting up a system like this
> that it would also make sense to look into just duplicating the
> configuration for each webapp?
> 5. Are there any good books, web tutorials, etc that talk about this?
>
> I guess what I'm basically looking for is a little design direction,
> possibly other technologies that provide these services so I'm not trying to
> build an entire system from scratch.
>
> Thanks in advance for your suggestions!
>
> Kelly


Attachment: user_185038.ezm (zipped)
Jonny Cavell wrote:
> I have a problem that seems to occur periodically.
>
> My freemarker templates, served by struts2, stop appearing - I get a blank
> page. There are no useful messages in the logs, other than saying that it
> couldn't find the template (which it could find previously).
>
> First question - does anybody know what this problem might be?
>
>  
No, other than a classpath/deployment problem.
> I would like to upgrade to the latest version of Freemarker. However,
> Struts2 in its wisdom has locked me down to version 2.3.8, and this was
> released way back in 2006. Are there any plans to resolve this issue?
>
>  
The 2.1.1 version of Struts uses FreeMarker 2.3.11  You may be able to
replace the 2.3.8 jar with the 2.3.11 jar without problems.

I doubt the problem is with FreeMarker. It's more likely to be the
FreeMarkerManager included with Struts 2 that's responsible for
searching for templates in the classpath.



Attachment: user_185040.ezm (zipped)
Hi All!

This is my first e-mail.
My name is Márcio Gurgel, I'm from Brasília (Brazil). My english isn't very
well, I hope you understand (:
There's 10 months that I'm working with J2EE.
I'll finish my graduation this semester, than I'm developing a final project
using Struts 2.

So, I have a question.. Hope you can help me.

My aplication uses displayTag for list rendering.
To make search's I use two tabs (Criteria and Results).
My problem is on the tab Results when it has paging.
When I click in the pagination, it just got lost.


I tried do resolve this doing:
1 - Seting requestURI="" to call the action that returns the jsp with my
tabbed panel.
This way, returns the tab of Criteria selected (I want the Results tab).
2 - Seting requestURI="" to call the action that returns the jsp with my
list (inside the Results tab).
This way my list opens in another frame.

Here's my code (I changed the Labels to english)
I atached a screen, as I sayd I dont trust in my english...


File UsuSeach.jsp (Contains tabbedPanel)
-----------------------------------------------------------------------------------------------------------------------

<%@(protected)" %>
<%@(protected)" %>
<%@(protected)" %>

<script type="text/javascript">
 function selectTab(id) {
  var tabContainer = dojo.widget.byId("panelUsu");
  tabContainer.selectTab(id);
 }

</script>

<sx:head />

<d:titleBar title="User's search"/>

<s:url id="urlOpenCriteria" action="OpenCriteria" namespace="/user"/>
<s:url id="urlSearch" action="search" namespace="/user"/>

<sx:tabbedpanel id="panelUsu" templateCssPath="/css/dojo/TabContainer.css">
  <sx:div label="Criteria" id="tabCriteria" href="%{urlOpenCriteria}"
loadingText="Carregando" />
  <sx:div label="Results" id="tabResults" href="%{urlSearch}"
loadingText="Carregando" refreshOnShow="false" preload="false"
executeScripts="true"/>
</sx:tabbedpanel>

File UsuSeachCriteria.jsp (Criteria)
-----------------------------------------------------------------------------------------------------------------------

<%@(protected)" %>
<%@(protected)" %>
<%@(protected)" %>

<sx:head/>
<s:div cssClass="errors">
    <s:actionerror />
   <s:fielderror />
</s:div>

<s:form action="search" namespace="/user">
  <s:textfield name="currentUsu.chv" id="currentUsu.chv" label="User's
name" />
  <s:textfield name="currentUsu.eMail" id="usu.eMail" label="E-mail" />
  <sx:datetimepicker name="currentUsu.dtGvr" id="currentUsu.dtGvr"
label="Data gravação" toggleType="fade" toggleDuration="500"/>
  <d:buttonBar>
    <sx:submit id="buttonSearch" name="buttonSearch" value="Search"
onclick="selectTab('tabResults')" targets="tabResults" />
  </d:buttonBar>
</s:form>

File UsuSeachResults.jsp (Results)
-----------------------------------------------------------------------------------------------------------------------
<%@(protected)"%>
<%@(protected)" %>
<%@(protected)"%>
<%@(protected)"%>

<sx:head />

<br/>
<sx:div cssClass="errors">
    <s:actionerror />
   <s:fielderror />
</sx:div>

<s:form action="exclude" namespace="/user">
    <display:table sort="page"
requestURI="/usuario/abrirPesquisa.action" cellpadding="0"
cellspacing="0" id="listUsu"
    class="list" name="listUsuPesquisa" pagesize="10">
       <display:column   title='<input type="checkbox"
name="selectAll" id="selectAll" value="" onclick="checkAll()"/>'>
          <s:checkbox name="checkBox" id="checkBox" value="idUsus"
theme="simple" onclick="confirmAllChecked()" />
       </display:column>
       <display:column sortProperty="chv" title="User"
property="chv"/>//It's gonna be a link..
       <display:column title="E-mail" property="EMail"/>
       <display:column title="Date" property="dtGvr"/>
       <display:column title="Access level" property="nvlAcso.dcr" />
       <display:footer />
    </display:table>
  <br>
  <d:buttonBar>
    <sx:submit id="buttonNew" name="buttonNew" value="New" />
    <sx:submit id="buttonExclude" name="buttonExclude" value="Exclude"/>
  </d:buttonBar>
</s:form>



Tanks all!!!
[]'s

Attachment: user_185042.ezm (zipped)
Hi Márcio,

First, check that the sort and pagination links rendered in the HTML
appear valid. I have seen cases where the URL is corrupt because it
includes the original request parameters, resulting in the action being
invoked with an unexpected result.

They should look like:
http://foo.bar.com/context/requestUri?sort=name&dir=asc&originalParameters=originalValues.

The next issue is that displaytag uses default links that cause a
complete page reload. By "got lost", I presume you mean you clicked on
the sort link and the resulting page did not show the current tag. This
is a complication of using complex widgets in html. The only
work-around with displaytag is to ensure all state about the page layout
(such as which tab is visible) is available as a request param or read
from a cookie on a reload so that when the page is redrawn with the
correct tab and content displayed.

Finally, an approach to avoid that issue is use an ajax table widget.
That is, one that can refresh it's data without performing a full page
reload. The AjaxTags library includes a direct implementation of the
displaytag table (ajax:displaytag) [1]. I've never used it. As you're
using Dojo tabs you may like to consider Dojo's datagrid as well. I use
YUI's version.

[1] http://ajaxtags.sourceforge.net/usage.html

Hope that helps!

regards,
Jeromy Evans

Márcio Gurgel wrote:
> Hi All!
>
> This is my first e-mail.
> My name is Márcio Gurgel, I'm from Brasília (Brazil). My english isn't very
> well, I hope you understand (:
> There's 10 months that I'm working with J2EE.
> I'll finish my graduation this semester, than I'm developing a final project
> using Struts 2.
>
> So, I have a question.. Hope you can help me.
>
> My aplication uses displayTag for list rendering.
> To make search's I use two tabs (Criteria and Results).
> My problem is on the tab Results when it has paging.
> When I click in the pagination, it just got lost.
>
>
> I tried do resolve this doing:
> 1 - Seting requestURI="" to call the action that returns the jsp with my
> tabbed panel.
> This way, returns the tab of Criteria selected (I want the Results tab).
> 2 - Seting requestURI="" to call the action that returns the jsp with my
> list (inside the Results tab).
> This way my list opens in another frame.
>
> Here's my code (I changed the Labels to english)
> I atached a screen, as I sayd I dont trust in my english...
>
>
> File UsuSeach.jsp (Contains tabbedPanel)
> -----------------------------------------------------------------------------------------------------------------------
>
> <%@(protected)" %>
> <%@(protected)" %>
> <%@(protected)" %>
>
> <script type="text/javascript">
>   function selectTab(id) {
>    var tabContainer = dojo.widget.byId("panelUsu");
>    tabContainer.selectTab(id);
>   }
>
> </script>
>
> <sx:head />
>
> <d:titleBar title="User's search"/>
>
> <s:url id="urlOpenCriteria" action="OpenCriteria" namespace="/user"/>
> <s:url id="urlSearch" action="search" namespace="/user"/>
>
> <sx:tabbedpanel id="panelUsu" templateCssPath="/css/dojo/TabContainer.css">
>   <sx:div label="Criteria" id="tabCriteria" href="%{urlOpenCriteria}"
> loadingText="Carregando" />
>   <sx:div label="Results" id="tabResults" href="%{urlSearch}"
> loadingText="Carregando" refreshOnShow="false" preload="false"
> executeScripts="true"/>
> </sx:tabbedpanel>
>
> File UsuSeachCriteria.jsp (Criteria)
> -----------------------------------------------------------------------------------------------------------------------
>
> <%@(protected)" %>
> <%@(protected)" %>
> <%@(protected)" %>
>
> <sx:head/>
> <s:div cssClass="errors">
>     <s:actionerror />
>     <s:fielderror />
> </s:div>
>
> <s:form action="search" namespace="/user">
>   <s:textfield name="currentUsu.chv" id="currentUsu.chv" label="User's
> name" />
>   <s:textfield name="currentUsu.eMail" id="usu.eMail" label="E-mail" />
>   <sx:datetimepicker name="currentUsu.dtGvr" id="currentUsu.dtGvr"
> label="Data gravação" toggleType="fade" toggleDuration="500"/>
>   <d:buttonBar>
>      <sx:submit id="buttonSearch" name="buttonSearch" value="Search"
> onclick="selectTab('tabResults')" targets="tabResults" />
>   </d:buttonBar>
> </s:form>
>
> File UsuSeachResults.jsp (Results)
> -----------------------------------------------------------------------------------------------------------------------
> <%@(protected)"%>
> <%@(protected)" %>
> <%@(protected)"%>
> <%@(protected)"%>
>
> <sx:head />
>
> <br/>
> <sx:div cssClass="errors">
>     <s:actionerror />
>     <s:fielderror />
> </sx:div>
>
> <s:form action="exclude" namespace="/user">
>      <display:table sort="page"
> requestURI="/usuario/abrirPesquisa.action" cellpadding="0"
> cellspacing="0" id="listUsu"
>      class="list" name="listUsuPesquisa" pagesize="10">
>         <display:column   title='<input type="checkbox"
> name="selectAll" id="selectAll" value="" onclick="checkAll()"/>'>
>           <s:checkbox name="checkBox" id="checkBox" value="idUsus"
> theme="simple" onclick="confirmAllChecked()" />
>         </display:column>
>         <display:column sortProperty="chv" title="User"
> property="chv"/>//It's gonna be a link..
>         <display:column title="E-mail" property="EMail"/>
>         <display:column title="Date" property="dtGvr"/>
>         <display:column title="Access level" property="nvlAcso.dcr" />
>         <display:footer />
>      </display:table>
>   <br>
>   <d:buttonBar>
>      <sx:submit id="buttonNew" name="buttonNew" value="New" />
>      <sx:submit id="buttonExclude" name="buttonExclude" value="Exclude"/>
>   </d:buttonBar>
> </s:form>
>
>
>
> Tanks all!!!
> []'s
>
>  
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 7.5.519 / Virus Database: 269.22.5/1358 - Release Date: 3/04/2008 6:36 PM
>  


Attachment: user_185041.ezm (zipped)
Brian, thanks for the low-down. It works well.

Regards
Adam


Relph,Brian on 03/04/08 15:53, wrote:
>
> Copy paste error, you need to initialize the Dispatcher with your testConfig map:
>
>      Map<String, String> testConfig = new HashMap<String, String>();
>      testConfig.put("config", "struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml");
>      dispatcher = new Dispatcher(servletContext,
>           testConfig);
>      dispatcher.init();
>      Dispatcher.setInstance(dispatcher);
>
>
> -----Original Message-----
> From: Relph,Brian [mailto:Brian.Relph@(protected)]
> Sent: Thursday, April 03, 2008 9:48 AM
> To: Struts Users Mailing List
> Subject: RE: struts.xml
>
>
> You need to have access to the Dispatcher and the ServletContext in your tests, but you could do something like this for per-unit test configurations:
>
>      ConfigurationProvider provider = new StrutsXmlConfigurationProvider(
>           "struts-test.xml", true, servletContext);
>      dispatcher.getConfigurationManager().addConfigurationProvider(provider);
>      dispatcher.getConfigurationManager().reload();
>
> If you set devMode = true for your tests, you might be able to avoid the reload() call.
>
> If you have a just a single "struts-test.xml" for all of your tests, you could do something like this in your setUp():
>
>      Map<String, String> testConfig = new HashMap<String, String>();
>      testConfig.put("config", "struts-default.xml,struts-plugin.xml,struts.xml,struts-test.xml");
>      dispatcher = new Dispatcher(servletContext,
>           new HashMap<String, String>());
>      dispatcher.init();
>      Dispatcher.setInstance(dispatcher);
>
>
> -----Original Message-----
> From: Adam Hardy [mailto:ahardy.struts@(protected)]
> Sent: Thursday, April 03, 2008 5:00 AM
> To: Struts Users Mailing List
> Subject: Re: struts.xml
>
> Adam Hardy on 02/04/08 12:23, wrote:
>> Can I have a second struts.xml in my test directory, and if so, how do
>> I configure it?
>>
>> I'm testing some stuff using HttpUnit which launches the whole webapp
>> in my tests. Having a test-only struts.xml will keep the test mappings
>> out of the real webapp, allow me to drop stuff I don't need for the
>> tests, and make the tests faster.
>
> From the lack of replies, I assume the answer is 'No, you cannot have an alternative struts.xml'.
>
> I was checking the low-down on the wiki, where I found that the struts configuration xml can be in multiple files listed by the property in the
> struts.properties:
>
> ### A list of configuration files automatically loaded by Struts struts.configuration.files=struts-default.xml,struts-plugin.xml,struts.xml
>
> Using this property, I can set up my maven environment to filter struts.properties as a resource and set that property explicitly, so in testing I can have 'struts-test.xml'
>
> This works to a limited extent, i.e. one struts.xml for all testing, another for in-container deployment.
>
> It's not quite ideal though, as I would prefer to choose the struts.xml on a per-test basis.
>
> Does anyone know of something I've missed that allows this?


Attachment: user_185044.ezm (zipped)
Hi Dave,

Thanks for the reply. I've actually tried with #keepRemoveRadio as well but
got same result. In fact, I got it working by putting "john" or "doe" as
below for <s:param> property:

<s:param name="*Keep*" value="%{'john}"/>

Moving ahead, now stuck with a different issue. Actually, I want to create
name of the param dynamically by concatenating two strings. One is already a
struts2 <s:set> property and other is a static value. For example, I want to
do something like this:

Line 1: <s:set name="prop1" value="%{someActionProp}"/>

<s:bean name="java.util.HashMap" id="keepRemoveRadioMap">
*       <s:param name="%{prop1}Keep" value="%{prop1}john"/>
     <s:param name="Remove" value="%{prop1}doe"/>
* </s:bean>

But I could not get the lines in bold working. Do you have any idea how to
concatenate two strings and assing it to a third variable? I tried
<s:append> but that doesn't work either. Using that I can only iterate and
print the values but cant assign to third variable.

Thanks

On Thu, Apr 3, 2008 at 8:40 AM, Dave Newton <newton.dave@(protected):

> --- Niral Trivedi <niral22@(protected):
> > I am using Struts 2.0.11 on RAD7, Webspher 6.1, JDK 1.5.
>
> Hey, me too. My sympathies.
>
> > I am trying to create radio buttons using a dynamic Map as below:
> >
> > <s:bean name="java.util.HashMap" id="keepRemoveRadioMap">
> >      <s:param name="Keep" value="john"/>
> >      <s:param name="Remove" value="doe"/>
> > </s:bean>
> >
> > <td width="20%" style="background-color:#fffade; vertical-align:center">
> >      <s:radio name="keepRemove" list="keepRemoveRadioMap" onclick=
> > "changeKeep1()" theme="simple"/>
> > </td>
> >
> > But when I try to load the page, it is giving Freemaker Template
> exception
> > as below(I haven't pasted entire stack trace for readability) :
>
> What happens if you use list="#keepRemoveRadioMap"?
>
> While I've never used the <s:bean...> tag, normally when you create an
> object
> in the OGNL context like that you need to refer to it with a leading "#"
> meaning that it's a named object, not a property of an object on the value
> stack.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_185045.ezm (zipped)

I need to integrate tiles in struts 1.3.9 i have included the jar files and
tlds as needed but im getting the exception...
  i don know whats the error....


Apr 4, 2008 10:25:48 AM org.apache.struts.action.ActionServlet initChain
INFO: Loading chain catalog from code-source:/C:/Jdeveloper
1014/jdev/mywork/test/ViewController/public_html/WEB-INF/lib/struts-core-1.3.9.jar!org/apache/struts/chain/chain-config.xml
Apr 4, 2008 10:25:48 AM org.apache.struts.tiles.TilesPlugin
initDefinitionsFactory
INFO: Tiles definition factory loaded for module ''.
Apr 4, 2008 10:25:49 AM org.apache.struts.chain.ComposableRequestProcessor
init
INFO: Initializing composable request processor for module prefix ''
Apr 4, 2008 10:25:49 AM
org.apache.struts.chain.commands.AbstractExceptionHandler execute
WARNING: Unhandled exception
java.lang.IllegalArgumentException: path must begin with a "/"
 at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:1532)
 at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward (PerformForward.java:107)
 at
org.apache.struts.chain.commands.servlet.PerformForward.perform (PerformForward.java:96)
 at
org.apache.struts.chain.commands.AbstractPerformForward.execute (AbstractPerformForward.java:54)
 at
org.apache.struts.chain.commands.ActionCommandBase.execute (ActionCommandBase.java:51)
 at org.apache.commons.chain.impl.ChainBase.execute (ChainBase.java:190)
 at
org.apache.commons.chain.generic.LookupCommand.execute (LookupCommand.java:304)
 at org.apache.commons.chain.impl.ChainBase.execute (ChainBase.java:190)
 at
org.apache.struts.chain.ComposableRequestProcessor.process (ComposableRequestProcessor.java:283)
 at org.apache.struts.action.ActionServlet.process (ActionServlet.java:1913)
 at org.apache.struts.action.ActionServlet.doGet (ActionServlet.java:450)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:743)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:856)
 at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
 at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
 at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
 at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
 at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
 at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
 at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
 at java.lang.Thread.run (Thread.java:595)
Apr 4, 2008 10:25:49 AM org.apache.struts.chain.commands.ExceptionCatcher
postprocess
WARNING: Exception from exceptionCommand 'servlet-exception'
java.lang.IllegalArgumentException: path must begin with a "/"
 at
com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:1532)
 at
org.apache.struts.chain.commands.servlet.PerformForward.handleAsForward (PerformForward.java:107)
 at
org.apache.struts.chain.commands.servlet.PerformForward.perform (PerformForward.java:96)
 at
org.apache.struts.chain.commands.AbstractPerformForward.execute (AbstractPerformForward.java:54)
 at
org.apache.struts.chain.commands.ActionCommandBase.execute (ActionCommandBase.java:51)
 at org.apache.commons.chain.impl.ChainBase.execute (ChainBase.java:190)
 at
org.apache.commons.chain.generic.LookupCommand.execute (LookupCommand.java:304)
 at org.apache.commons.chain.impl.ChainBase.execute (ChainBase.java:190)
 at
org.apache.struts.chain.ComposableRequestProcessor.process (ComposableRequestProcessor.java:283)
 at org.apache.struts.action.ActionServlet.process (ActionServlet.java:1913)
 at org.apache.struts.action.ActionServlet.doGet (ActionServlet.java:450)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:743)
 at javax.servlet.http.HttpServlet.service (HttpServlet.java:856)
 at
com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719)
 at
com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376)
 at
com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870)
 at
com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451)
 at
com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218)
 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:119)
 at
com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
 at
oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
 at
com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
 at java.lang.Thread.run (Thread.java:595)


my sample code.


web.xml

<?xml version = '1.0' encoding = 'windows-1252'?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee">
  <description>Empty web.xml file for Web Application</description>
  <servlet>
    <servlet-name>action</servlet-name>
   
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
       <param-name>config</param-name>
       <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
 
  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <session-config>
    <session-timeout>35</session-timeout>
  </session-config>
<jsp-config>
    <taglib>
       <taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
       <taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
       
    </taglib>
  </jsp-config>
  <mime-mapping>
    <extension>html</extension>
    <mime-type>text/html</mime-type>
  </mime-mapping>
  <mime-mapping>
    <extension>txt</extension>
    <mime-type>text/plain</mime-type>
  </mime-mapping>
</web-app>

struts-config.xml

<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts
Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config>
  <action-mappings>
    <action path="/baselayout"
       forward="tiles-defs"/>
</action-mappings>
<message-resources parameter="view.ApplicationResources"/>
<plug-in className="org.apache.struts.tiles.TilesPlugin">
  <set-property property="definitions-config"
value="/WEB-INF/tiles-defs.xml"/>
  <set-property property="moduleAware" value="true" />
  <set-property property="definitions-parser-validate" value="true" />
 </plug-in>
</struts-config>


tiles-defs.xml

<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE tiles-definitions PUBLIC "-//Apache Software Foundation//DTD Tiles
Configuration 1.1//EN"
"http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">
<tiles-definitions>
<definition name="tiles-defs" path="/jsp/baseLayout.jsp">
  <put name="top" value="/jsp/top.jsp"/>
  <put name="bottom" value="/jsp/bottom.jsp"/>
</definition>
</tiles-definitions>


baseLayout.jsp

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@(protected)"%>
<%@(protected)"%>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;
charset=windows-1252"/>
  <title>baseLayout</title>
</head>
<body>
  <tiles:insert attribute="top"/>
  <tiles:insert attribute="bottom"/>
</body>
</html>

my top and bottom layout jsps are just sample texted files...

can any one help me where i have made any mistakes...

thanks
Balaji.M


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

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