Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 13 Jun 2008 09:15:36 -0000 Issue 8086

user-digest-help

2008-06-13


Author LoginPost Reply

user Digest 13 Jun 2008 09:15:36 -0000 Issue 8086

Topics (messages 187508 through 187537):

Re: Struts 2 s:select question
 187508 by: Martin
 187510 by: stewart.owd.com
 187515 by: kukudas
 187517 by: Ralf Fischer

dojo with struts 2.0.11.1.
 187509 by: Lalchandra Rampersaud
 187512 by: Dave Newton
 187514 by: Lalchandra Rampersaud
 187516 by: Dave Newton
 187518 by: Joachim Rohde
 187519 by: Struts Two
 187520 by: Dave Newton

Re: Confused about s:include
 187511 by: Jeromy Evans

[OT]Re: Struts 2 s:select question
 187513 by: Al Sutton

Struts 2 file uploaded with temp extension
 187521 by: Ramesh K
 187523 by: Dave Newton
 187526 by: Ramesh K

adding a header in a struts 2 interceptor
 187522 by: Page
 187525 by: Dave Newton

Re: Two problems: Struts2 + https + file load and Struts2 + file load +  java.lang.IllegalStateException: getOutputStream()
 187524 by: UncleLongHair

Re: how to read the 'potenrial list' from a database
 187527 by: xianwinwin
 187530 by: Dave Newton

Could not load dojo.js problem
 187528 by: Ramesh K
 187531 by: Dave Newton

Re: Struts Excel download using POI... throwing java.lang.IllegalStateException
 187529 by: Struts_tania

problems when using <s:iterate>
 187532 by: Alexander Bätz

Struts2 and Tables
 187533 by: StrutsUser

[STRUTS2] Configuring Eclipse3.2 for struts2
 187534 by: Thulasi S.

Re: Dynamically pulling in tile definitions based on session attributes using OGNL
 187535 by: Gamble, Wesley (WG10)

Form template
 187536 by: Matthieu MARC

Struts 2 and Velocity Intergration
 187537 by: dim5b

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_187508.ezm (zipped)
Can you supply the
jsp sepecifically looking for s:select
web.xml
struts<-config>.xml
as well as the code from Action class

http://struts.apache.org/2.0.11.1/docs/select.html

Thanks
Martin
----- Original Message -----
From: "kukudas" <kukudas85@(protected)>
To: <user@(protected)>
Sent: Thursday, June 12, 2008 9:34 AM
Subject: Struts 2 s:select question


>
> hi,
>
> basicly i can't find any working example, howto set the value which was
> choosen into a variable so i can use this in my beans. i've tryied using
> the
> namespace which didn't work.
> someone can provide me with an working example would be awesome thanks.
>
> greets
>
> kuku
> --
> View this message in context:
> http://www.nabble.com/Struts-2-s%3Aselect-question-tp17800089p17800089.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_187510.ezm (zipped)
I will be out of the office, and mostly without email access, until June 17.

Please contact the One World office, 605-845-7172, with any general needs, and Danny Nickels, dnickels@(protected).

If this is an emergency, please feel free to call my cell at 605-848-2841.

Thanks,

-Stewart



Attachment: user_187515.ezm (zipped)

Hi, thanks for your reply i think i did it right but still getting an
exception:
this is how it works when i do a textfield and enter the value by my hand:
<s:textfield id="athy" label="Rolle" name="a.Auth"/>

And this is when i try doing it with the s:select
<s:select name="a.Auth" list="authorities" label="Choose" listValue="athy"/>

i have getter/setter for a in my ActionClass. a is a Object from another
Class lets call it Athy. authorities is a list in my ActionClass which has
getter/setter too. and athy is the string from the Class Athy(where i make
the "a" object from). the list and listValue thing is working because i get
the right values populated the thing which doesnt work is the name attribute
"a.Auth". Its Strange that in a textfield when i send the value it works ..

The items in the list are populated but when i select something and push
submit i get this error:
java.util.NoSuchElementException



Jim Kiley wrote:
>
> The s:select tag doesn't have much to do with the namespace.
>
> What you'll want to do is something like this:
>
> <s:form action="myAction">
> <s:select name="myProperty" list="backingList" listKey="field1"
> listValue="field2" label="Choose a thing"/>
> <s:submit />
> </s:form>
>
> Then you just have to make sure that your action ('myAction') has getters
> and setters for 'myProperty', a getter for 'backingList', and that each
> element of 'backingList' has fields 'field1' and 'field2', both of which
> have public getters.
>
> Does this help?
>
> jk
>
> On Thu, Jun 12, 2008 at 9:34 AM, kukudas <kukudas85@(protected):
>
>>
>> hi,
>>
>> basicly i can't find any working example, howto set the value which was
>> choosen into a variable so i can use this in my beans. i've tryied using
>> the
>> namespace which didn't work.
>> someone can provide me with an working example would be awesome thanks.
>>
>> greets
>>
>> kuku
>> --
>> View this message in context:
>> http://www.nabble.com/Struts-2-s%3Aselect-question-tp17800089p17800089.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)
>>
>>
>
>
> --
> Jim Kiley
> Technical Consultant | Summa
> [p] 412.258.3346 [m] 412.445.1729
> http://www.summa-tech.com
>
>

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


Attachment: user_187517.ezm (zipped)
Hi,

On Thu, Jun 12, 2008 at 4:30 PM, kukudas <kukudas85@(protected):
> Hi, thanks for your reply i think i did it right but still getting an
> exception:
> this is how it works when i do a textfield and enter the value by my hand:
> <s:textfield id="athy" label="Rolle" name="a.Auth"/>
>
> And this is when i try doing it with the s:select
> <s:select name="a.Auth" list="authorities" label="Choose" listValue="athy"/>
>
> i have getter/setter for a in my ActionClass. a is a Object from another
> Class lets call it Athy. authorities is a list in my ActionClass which has
> getter/setter too. and athy is the string from the Class Athy(where i make
> the "a" object from). the list and listValue thing is working because i get
> the right values populated the thing which doesnt work is the name attribute
> "a.Auth". Its Strange that in a textfield when i send the value it works ..
>
> The items in the list are populated but when i select something and push
> submit i get this error:
> java.util.NoSuchElementException

Well, that's straight forward: When you press submit the browser only
sends the string representation of the object to the server. As, I'm
pretty sure, you don't have any type conversion of the value set in
the select box to the type of your property in the action, which
should be setA(Athy). You now have some options:

a) Check out how type conversion works within struts2/xwork [1] and
write an appropriate type converter. This options is only viable from
my point of view when Arty is just a simple class and no entity. I
think reading entities from the database or taking similar actions in
a type converter is no good practice, but I might be wrong here.

b) Intercept the action invocation on the way and create/inject the
object from the interceptor into the action, maybe with some
annotation or interface on the action class which marks for the
interceptor to take action on this invocation.

c) Set the String parameter which was selected into the action (by
providing an appropriate setter taking a String) and do the work of
converting the action there. I usually discourage from this, as
conversion code does IMO not belong to the action.

Bye
-Ralf

[1] http://struts.apache.org/2.x/docs/type-conversion.html

> Jim Kiley wrote:
>>
>> The s:select tag doesn't have much to do with the namespace.
>>
>> What you'll want to do is something like this:
>>
>> <s:form action="myAction">
>> <s:select name="myProperty" list="backingList" listKey="field1"
>> listValue="field2" label="Choose a thing"/>
>> <s:submit />
>> </s:form>
>>
>> Then you just have to make sure that your action ('myAction') has getters
>> and setters for 'myProperty', a getter for 'backingList', and that each
>> element of 'backingList' has fields 'field1' and 'field2', both of which
>> have public getters.
>>
>> Does this help?
>>
>> jk
>>
>> On Thu, Jun 12, 2008 at 9:34 AM, kukudas <kukudas85@(protected):
>>
>>>
>>> hi,
>>>
>>> basicly i can't find any working example, howto set the value which was
>>> choosen into a variable so i can use this in my beans. i've tryied using
>>> the
>>> namespace which didn't work.
>>> someone can provide me with an working example would be awesome thanks.
>>>
>>> greets
>>>
>>> kuku
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Struts-2-s%3Aselect-question-tp17800089p17800089.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)
>>>
>>>
>>
>>
>> --
>> Jim Kiley
>> Technical Consultant | Summa
>> [p] 412.258.3346 [m] 412.445.1729
>> http://www.summa-tech.com
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Struts-2-s%3Aselect-question-tp17800089p17801387.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_187509.ezm (zipped)
hey all
whenever i put <%@ taglib prefix="sx" uri="/struts-dojo-tags"%>  on my jsp pages eclipse gives me an error.  i am using struts-2.0.11.1.
 
the docs has include the Dojo Plugin distributed with Struts 2 in your /WEB-INF/lib folder but i can't seem to find it anywhere..
 
what could be the problem?
 
Lalchandra Rampersaud

------------
Carpe diem
 
 

Attachment: user_187512.ezm (zipped)
--- On Thu, 6/12/08, Lalchandra Rampersaud <lrampersaud@(protected):

> From: Lalchandra Rampersaud <lrampersaud@(protected)>
> Subject: dojo with struts 2.0.11.1.
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Thursday, June 12, 2008, 12:48 PM
> hey all
> whenever i put <%@(protected)"
> uri="/struts-dojo-tags"%> on my jsp pages
> eclipse gives me an error. i am using struts-2.0.11.1.
>
> the docs has include the Dojo Plugin distributed with
> Struts 2 in your /WEB-INF/lib folder but i can't seem
> to find it anywhere..
>
> what could be the problem?

The <sx:...> tags are Struts 2.1, and the Dojo functionality is moved into a plugin.

Dave


Attachment: user_187514.ezm (zipped)
Thanks for the quick reply.

I assume that the plugin is in a jar file.
Where can i get the plugin?

Lalchandra
------------
Carpe diem


----- Original Message -----
From: "Dave Newton" <newton.dave@(protected)>
To: "Struts Users Mailing List" <user@(protected)>
Sent: Thursday, June 12, 2008 7:24 AM
Subject: Re: dojo with struts 2.0.11.1.


> --- On Thu, 6/12/08, Lalchandra Rampersaud <lrampersaud@(protected):
>
>> From: Lalchandra Rampersaud <lrampersaud@(protected)>
>> Subject: dojo with struts 2.0.11.1.
>> To: "Struts Users Mailing List" <user@(protected)>
>> Date: Thursday, June 12, 2008, 12:48 PM
>> hey all
>> whenever i put <%@(protected)"
>> uri="/struts-dojo-tags"%> on my jsp pages
>> eclipse gives me an error. i am using struts-2.0.11.1.
>>
>> the docs has include the Dojo Plugin distributed with
>> Struts 2 in your /WEB-INF/lib folder but i can't seem
>> to find it anywhere..
>>
>> what could be the problem?
>
> The <sx:...> tags are Struts 2.1, and the Dojo functionality is moved into a plugin.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>

Attachment: user_187516.ezm (zipped)
--- On Thu, 6/12/08, Lalchandra Rampersaud wrote:
> Where can i get the plugin?

In the beta S2.1 build or by building from source.

I have no idea if it works in S2.0.11.1 out-of-the-box; I'd be skeptical. It might make more sense to use the existing S2.0 Dojo tags.

Dave

(No CC is necessary; I'm happy with the single message going to the list, and it keeps my inboxes cleaner.)


Attachment: user_187518.ezm (zipped)
As Dave mentioned, the <sx:...> tags are Struts 2.1. So download the
2.1.2 distribution ( http://struts.apache.org/download.cgi#struts212 )
and you'll find the dojo-plugin in the lib-directory.

Joachim

Lalchandra Rampersaud schrieb:
> Thanks for the quick reply.
>
> I assume that the plugin is in a jar file.
> Where can i get the plugin?
>
> Lalchandra
> ------------
> Carpe diem
>
>
> ----- Original Message -----
> From: "Dave Newton" <newton.dave@(protected)>
> To: "Struts Users Mailing List" <user@(protected)>
> Sent: Thursday, June 12, 2008 7:24 AM
> Subject: Re: dojo with struts 2.0.11.1.
>
>
>> --- On Thu, 6/12/08, Lalchandra Rampersaud <lrampersaud@(protected):
>>
>>> From: Lalchandra Rampersaud <lrampersaud@(protected)>
>>> Subject: dojo with struts 2.0.11.1.
>>> To: "Struts Users Mailing List" <user@(protected)>
>>> Date: Thursday, June 12, 2008, 12:48 PM
>>> hey all
>>> whenever i put <%@(protected)"
>>> uri="/struts-dojo-tags"%> on my jsp pages
>>> eclipse gives me an error. i am using struts-2.0.11.1.
>>>
>>> the docs has include the Dojo Plugin distributed with
>>> Struts 2 in your /WEB-INF/lib folder but i can't seem
>>> to find it anywhere..
>>>
>>> what could be the problem?
>> The <sx:...> tags are Struts 2.1, and the Dojo functionality is moved into a plugin.
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG.
> Version: 8.0.100 / Virus Database: 270.3.0/1499 - Release Date: 12.06.2008 07:13

Attachment: user_187519.ezm (zipped)
The confusion is caused by the documentation. Dojo plugin is included in 2.1.x, however; the documentation for 2.0.11 uses <sx:head/> in its example at the buttom of the page, while it uses <s:head debug="true" cache="false" compressed="false" /> on the top of the page.
You can even go the following link http://struts.apache.org/2.0.11/docs/bind.html and then when u look at its example, you see the following:
<sx:bind id="ex1" href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
<s:submit theme="simple" type="submit" value="submit" id="button"/>
It makes u wonder where "sx" is coming from for 2.0.11, as David mentioned "sx" tags are included in 2.1.x.


   __________________________________________________________________
Looking for the perfect gift? Give the gift of Flickr!

http://www.flickr.com/gift/

Attachment: user_187520.ezm (zipped)
--- On Thu, 6/12/08, Struts Two <strutstwo@(protected):
> It makes u wonder where "sx" is coming from for
> 2.0.11, as David mentioned "sx" tags are included
> in 2.1.x.

Because the wiki isn't versionable, it's a volunteer project, and when information is added sometimes it isn't complete or perfect.

Feel free to file a CLA and contribute to document maintenance; all help is appreciated.

Dave


Attachment: user_187511.ezm (zipped)
Jim Kiley wrote:
> I guess I could just use <s:action>, huh? It's amazing how these insights
> reach me five minutes after I send mail to the list.
>
> jk
>  
>  
The Include tag creates a javax.servlet.RequestDispatcher and performs
an include operation [1]. The tag attempts to create a reference to the
resource provided as a parameter based on the current servlet path. It
should be able to invoke an action if the Struts2 Filter sees that
include request.

The Action tag creates a struts ActionInvocation based on your
Configuration and invokes it as accessed via the Filter (through all the
interceptors). It can invoke any action but be wary that the
ActionContext is stored in a ThreadLocal (not saved and restored after
an invocation) and not all results can be safely executed within another
page.

Hope that helps,
Jeromy Evans

[1]http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/RequestDispatcher.html#include(javax.servlet.ServletRequest,%20javax.servlet.ServletResponse)


Attachment: user_187513.ezm (zipped)
How many people think him sending out of office emails to the list is
enough of an emergency to call his cell phone as he's given us the
number :)?

Al.

stewart@(protected):
> I will be out of the office, and mostly without email access, until June 17.
>
> Please contact the One World office, 605-845-7172, with any general needs, and Danny Nickels, dnickels@(protected).
>
> If this is an emergency, please feel free to call my cell at 605-848-2841.
>
> Thanks,
>
> -Stewart
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>  
 

Attachment: user_187521.ezm (zipped)

Hi,

  In my struts 2 file uploading application I uploaded a jpg image through
s:file tag and got .tmp file as output. How can I get my uploaded file with
the same extension? I set the first filter as ActionContextCleanup
in web.xml

please help me to solve this.

Regards,

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


Attachment: user_187523.ezm (zipped)
--- On Thu, 6/12/08, Ramesh K <ramesh.k@(protected):
> In my struts 2 file uploading application I uploaded a
> jpg image through s:file tag and got .tmp file as output.
> How can I get my uploaded file with the same extension?

Was the FAQ entry not helpful?

http://struts.apache.org/2.x/docs/how-do-we-upload-files.html

Dave


Attachment: user_187526.ezm (zipped)

Hi,

  In my struts 2 file uploading application I uploaded a jpg image through
s:file tag and got .tmp file as output. How can I get my uploaded file with
the same extension? I set the first filter as ActionContextCleanup
in web.xml

please help me to solve this.

Regards,

Ramesh K



Ramesh K wrote:
>
> Hi,
>
>   In my struts 2 file uploading application I uploaded a jpg image
> through s:file tag and got .tmp file as output. How can I get my uploaded
> file with the same extension? I set the first filter as
> ActionContextCleanup
> in web.xml
>
> please help me to solve this.
>
> Regards,
>
> Ramesh K
>

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


Attachment: user_187522.ezm (zipped)

I'm on a project which is using struts 2 on the backend and an inhouse
javascript framework on the client side that receives status information
from the server in an X-JSON header.

I have an interceptor that I'm writing to handle all the needs of the client
side framework and a second that manages the json objects called (not
clever) JsonInterceptor. It grabs json strings from the header and
instantiates them into JSONObjects which it stores in the request before the
invoke. After the invoke I wanted to check the value stack for a particular
object and if it exists, add a new X-JSON header to the response.

Problem: it seems I can't alter the response. It doesn't give me an error if
I user addHeader - but if I check for the header immediately after with
containsHeader, it doesn't exist. below is a stripped down version of the
interceptor





 public String intercept(ActionInvocation actInv) throws Exception {    

   // ...checks header and adds objects from X-JSON header to request
attributes
   
   //--------  BEFORE  -----------
   String result = actInv.invoke();
   //--------  AFTER   -----------

   //check for response object. If one doesn't exist, add default 200
response
   SnipsResponse snipResp =
(SnipsResponse)actInv.getStack().findValue("snipsResponse");
   if (snipResp == null) {
     snipResp = new SnipsResponse(200,"Autogenerated OK response");      
   }
   //get the response
   HttpServletResponse response =
(HttpServletResponse)actInv.getInvocationContext().get(StrutsStatics.HTTP_RESPONSE);
   if (response==null) {
     LOG.error("Unable to retrieve HttpServletResponse from invocation
context");
   } else {
     response.addHeader("X-JSON", snipResp.getJSONString());
     if (response.containsHeader("X-JSON")) {
       LOG.debug("Added X-JSON header: "+snipResp.getJSONString());        
     } else LOG.debug("adding header failed");
           
   }
   
   return result;
 }


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

Attachment: user_187525.ezm (zipped)
--- On Thu, 6/12/08, Page <jpage@(protected):
> I have an interceptor that I'm writing to handle all
> the needs of the client
> side framework and a second that manages the json objects
> called (not
> clever) JsonInterceptor. It grabs json strings from the
> header and
> instantiates them into JSONObjects which it stores in the
> request before the
> invoke. After the invoke I wanted to check the value stack
> for a particular
> object and if it exists, add a new X-JSON header to the
> response.
>
> Problem: it seems I can't alter the response. It
> doesn't give me an error if
> I user addHeader - but if I check for the header
> immediately after with
> containsHeader, it doesn't exist. below is a stripped
> down version of the
> interceptor
>
>
>
>
>
>   public String intercept(ActionInvocation actInv) throws
> Exception {    
>
>     // ...checks header and adds objects from X-JSON
> header to request
> attributes
>    
>     //--------  BEFORE  -----------
>     String result = actInv.invoke();
>     //--------  AFTER   -----------
>
>     //check for response object. If one doesn't
> exist, add default 200
> response
>     SnipsResponse snipResp =
> (SnipsResponse)actInv.getStack().findValue("snipsResponse");
>     if (snipResp == null) {
>       snipResp = new
> SnipsResponse(200,"Autogenerated OK response");
>    
>     }
>     //get the response
>     HttpServletResponse response =
> (HttpServletResponse)actInv.getInvocationContext().get(StrutsStatics.HTTP_RESPONSE);
>     if (response==null) {
>       LOG.error("Unable to retrieve
> HttpServletResponse from invocation
> context");
>     } else {
>       response.addHeader("X-JSON",
> snipResp.getJSONString());
>       if (response.containsHeader("X-JSON")) {
>         LOG.debug("Added X-JSON header:
> "+snipResp.getJSONString());        
>       } else LOG.debug("adding header
> failed");
>            
>     }
>    
>     return result;
>   }

http://struts.apache.org/2.x/docs/writing-interceptors.html

The result has already been rendered after the invoke, so header modification would be a bit superfluous ;)

Dave


Attachment: user_187524.ezm (zipped)

I was getting the "getOutputStream() has already been called for this
response" problem and figured out a solution. In my case, I was able to
switch from getOutputStream() to getWriter() because I was dealing with text
files, and the error message stopped.

I think the error message is misleading, I think you can get it if either
getOutputStream() gets called more than once OR if both getOutputStream()
and getWriter() are called. I wonder if the idea is to prevent both text
and binary data from being written into a response.

I understand that this might not help everyone, but I thought I'd offer it
up. It might be worthwhile to look at the source for HttpServletResponse to
see the conditions under which the error is thrown.

Uncle



Brad A Cupit wrote:
>
>>> And it is strange because it happens only when I use https and
>>> IE6. When it is http and IE6 it seems to be fine.
>
> these links may help:
> http://eirikhoem.wordpress.com/2007/06/15/generated-pdfs-over-https-with
> -internet-explorer/
>
> http://forum.java.sun.com/thread.jspa?threadID=233446&forumID=45
>
> Brad Cupit
> Louisiana State University - UIS
>
> ---------------------------------------------------------------------
> 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_187527.ezm (zipped)

I have a list of 20,000 cities; I would like the user to provide at least 2
chars and then present him a'potential list'.

I managed to do this:

JSP

<s:autocompleter theme="simple" list="state" name="StateName"/>



Java:

public class autocompleter extends ActionSupport
{
private List state;
public String execute() throws Exception{
  state = new ArrayList();
  state.add("Bonn");
  state.add("Paris");
.
.
.

  return SUCCESS;
}

 public List getState(){
  return state;
}
}

as you can see, the autocompliter is based on the 'state' I initially
provided. But what if the list is huge???

Q: How can I invoke an action once the user types a letter (str) and the
string gets to the invoked-method (based on the str the method will invoke
the appropriate list)

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


Attachment: user_187530.ezm (zipped)
Search a database of city names?

I'm not sure what you're asking.


--- On Thu, 6/12/08, xianwinwin <xianwinwin@(protected):

> From: xianwinwin <xianwinwin@(protected)>
> Subject: struts2: how to read the 'potenrial list' from a database
> To: user@(protected)
> Date: Thursday, June 12, 2008, 6:07 PM
> I have a list of 20,000 cities; I would like the user to
> provide at least 2
> chars and then present him a'potential list'.
>
> I managed to do this:
>
> JSP
>
> <s:autocompleter theme="simple"
> list="state" name="StateName"/>
>
>
>
> Java:
>
> public class autocompleter extends ActionSupport
> {
>  private List state;
>  public String execute() throws Exception{
>   state = new ArrayList();
>   state.add("Bonn");
>   state.add("Paris");
> .
> .
> .
>
>   return SUCCESS;
>  }
>  
>   public List getState(){
>   return state;
>  }
> }
>
> as you can see, the autocompliter is based on the
> 'state' I initially
> provided. But what if the list is huge???
>
> Q: How can I invoke an action once the user types a letter
> (str) and the
> string gets to the invoked-method (based on the str the
> method will invoke
> the appropriate list)
>
> thank you!!!
> --
> View this message in context:
> http://www.nabble.com/struts2%3A-how-to-read-the-%27potenrial-list%27-from-a-database-tp17810726p17810726.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_187528.ezm (zipped)

Hi,

 In my struts 2 application I used s:datetimepicker to manipulate date.
for that If I try to include

 <@(protected)"/>

 It shows the that it could not be loaded.

 How can I load this dojo.js to my struts 2.0.11 application

Thanks

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


Attachment: user_187531.ezm (zipped)



--- On Thu, 6/12/08, Ramesh K <ramesh.k@(protected):

> From: Ramesh K <ramesh.k@(protected)>
> Subject: Could not load dojo.js problem
> To: user@(protected)
> Date: Thursday, June 12, 2008, 6:33 PM
> Hi,
>
>   In my struts 2 application I used s:datetimepicker to
> manipulate date.
> for that If I try to include
>
>   <@(protected)"
> uri="/struts-dojo-tags"/>
>
>   It shows the that it could not be loaded.
>
>   How can I load this dojo.js to my struts 2.0.11
> application

<s:head theme="ajax"/>

The <sx:...> tags are Struts 2.1.

Dave


Attachment: user_187529.ezm (zipped)

Chris,
Thanks for your reply..

How can I avoid this..
I want to download the excel file in the same screen where the download
button was there.
So at the end I was forwarding to that jsp..
Should I not have a forward int he action class?If so how do I achieve that.

Thanks



Chris Pratt wrote:
>
> You can either send the excel file or redirect the user, not both.
> You're getting the error because once you've sent the excel file,
> you're trying to send the redirect but the stream has already been
> used.
>  (*Chris*)
>
> On Wed, Jun 11, 2008 at 2:37 PM, <gec_anita@(protected):
>> I have a button on jsp on clicl of which the request goes to the Struts
>> action where I am trying to use POI to create a excel file . It goes back
>> to the right jsp as per the "forward" but no download option. I keep
>> getting the following exception...
>>
>> Appreciate if anyone can help me with this..
>> java.lang.IllegalStateException
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr   R   at
>> com.ibm.wps.pe.pc.legacy.impl.PortletResponseImpl.setHeader(PortletResponseImpl.java:450)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr   R   at
>> javax.servlet.http.HttpServletResponseWrapper.setHeader (HttpServletResponseWrapper.java:194)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr   R   at
>> com.strykercorp.e3s.stellent.actions.SearchResultsAction.execute(SearchResultsAction.java:275)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr   R   at
>> com.ibm.wps.portlets.struts.WpsRequestProcessor.processActionPerform(WpsRequestProcessor.java:344)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr   R   at
>> org.apache.struts.action.RequestProcessor.process (RequestProcessor.java:274)
>> [6/11/08 12:16:16:839 PDT] 6f09c13b SystemErr   R   at
>> com.ibm.wps.portlets.struts.WpsRequestProcessor.processNewActionUri(WpsRequestProcessor.java:863)
>>
>> ---------------------------------------------------------------------
>> 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_187532.ezm (zipped)
Hi,

i'm making my first steps with struts and currently i'm testing the
s:iterate tag. Unfortunately my test wont work.

at first i created an action with a getter that returns a ArrayList of a
special class. then i tried to iterate over that list.

at first nothing happend. the tag didnt work, neither for my list of
objects nor for a simple list of strings. Then i added the jar of
commons-collection to my build path an now it will at least iterate over
strings.

something is really wrong with my testproject.

can somebody help?

Greetings,
Alex

Attachment: user_187533.ezm (zipped)

Hi,
I am new to struts and am stuck with a problem. Could anyone please help me
with this.

I need to create a table which should get values from DB and display them. I
should also be able to add/delete rows to/from the table. Some of the
columns of the table should be rendered as combo boxes.
Is this possible using Struts2 and can I make it generic because this sort
of table is required by me in many places. If I pass some parameters to the
generic table (like column count, column name etc.) a table
should be generated. I also need to perform some validations on the data
entered in the table.

For now I am using JavaScript to create such a table. It works but it is
unweildy to maintain. The code has bloated and add ons like validations are
difficult to do. So I am looking for a solution using struts itself.

Any ideas or suggestions would be greatly appreciated.


Thanks

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


Attachment: user_187534.ezm (zipped)

Hi

I am newbie to Struts2 & I am using Eclipse3.2.
Could anyone help me on this regard?

Thanks in Advance,
Thulasi

============================================================================================================================


Disclaimer:

This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.

============================================================================================================================

Attachment: user_187535.ezm (zipped)
Antonio, Chris, Dave, Martin,

Thanks for the responses. I haven't had a chance to thoroughly mull
them over, but I am confident that once I do so, my confusion will be
eased.

I'm quite keen on the combination of S2 and Tiles - and I'm sure I can
do what I need to.

Thanks again,
Wes

-----Original Message-----
From: Antonio Petrelli [mailto:antonio.petrelli@(protected)]
Sent: Wednesday, June 11, 2008 1:41 AM
To: Struts Users Mailing List
Subject: Re: Dynamically pulling in tile definitions based on session
attributes using OGNL

2008/6/10 Gamble, Wesley (WG10) <WG10@(protected)>:
>  <tiles:insertDefinition name="${#session.companyId}_compensation" />

It does not work because Tiles (at the moment) does not support OGNL.
Notice that Tiles does not support JSP EL "directly". In fact, it is
the container that supports it.
In other words, *before* the tag is called, the EL expression is
evaluated by the container, and then transferred to the tag.

Antonio

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


Attachment: user_187536.ezm (zipped)
Hi,

I am making a form page with jstl tags :

<%@(protected)" %>

<s:form>
 
  <s:hidden name="week.username" value="%{week.username}" />
 
  <s:iterator value="week.daysOfWeek">
    <s:label labelposition="top" value="%{getText(displayName)}"
cssStyle="font-weight: bold;" />
    <s:select name="week.daysOfWeek[%{index}].am"
onchange="countHour();" id="am%{index}" key="timetable.morning"
list="heures" value="%{am}" />
    <s:select name="week.daysOfWeek[%{index}].pm"
onchange="countHour();" id="pm%{index}" key="timetable.afternoon"
list="heures" value="%{pm}" />
  </s:iterator>
 
  <s:label id="tpsTotal" labelposition="left"
key="timetable.totalTime" name="tpsTotal" />
  <s:submit name="submitChange" value="Submit"
action="timetableRecordChange" />
  <s:submit name="submitCancel" value="Cancel"
action="timetableDisplay" />
 
</s:form>

The code generated used TABLE, TR and TD to put the different element on
the page. I would prefered to use DIV, P and SPAN but I don't know how
to do. Looking at the s:form element, I found the parameter template,
but I didn't manage to find any documentation on how to use the paramater.

Can someone give me some link to documentation on templating a form in
order to use anything else than a table based formated page ?

Thanks in advance.

Matthieu MARC

--
Matthieu MARC
matthieu.marc@(protected)


Attachment: user_187537.ezm (zipped)

Can anyone point out a clear demo of how i can integrate Velocity with Struts
i have followed
the guide in
http://struts.apache.org/2.0.11/docs/velocity.html
http://struts.apache.org/2.0.11/docs/velocity.html

but no success i am trying to integrate with VelocityTools is this no
supported in Struts 2

thanks

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

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