Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 26 Jun 2008 12:49:42 -0000 Issue 8111

user-digest-help

2008-06-26


Author LoginPost Reply

user Digest 26 Jun 2008 12:49:42 -0000 Issue 8111

Topics (messages 188124 through 188153):

Re: How to get all sessions in one web application
 188124 by: Joey
 188125 by: Pawe³ Wielgus
 188131 by: Nils-Helge Garli Hegvik

Re: Multi-row tabular forms
 188126 by: Kleiderman, Matthew
 188129 by: Dave Newton
 188135 by: Kleiderman, Matthew
 188136 by: Nikhil Walvekar
 188140 by: Dave Newton

Re: jUnit Testing Problem with Tiles
 188127 by: Antonio Petrelli
 188128 by: Antonio Petrelli
 188132 by: ezgi
 188137 by: Antonio Petrelli
 188141 by: ezgi
 188143 by: Dave Newton
 188145 by: Antonio Petrelli
 188146 by: Antonio Petrelli
 188148 by: Antonio Petrelli
 188153 by: ezgi

InternetExplorer > View... > Encoding
 188130 by: Raghuveer
 188133 by: Dave Newton
 188134 by: Antonio Petrelli

[s2] Whats the most strutsy way of doing....
 188138 by: Al Sutton
 188139 by: Pawe³ Wielgus
 188142 by: Lukasz Lenart
 188144 by: Dave Newton

Overriding and localizing default conversion error message
 188147 by: Jukka Välimaa
 188150 by: Dave Newton

[OT] Re: jUnit Testing Problem with Tiles
 188149 by: Dave Newton
 188151 by: Al Sutton

[OT] Euro 2008 (WAS: Re: [OT] Re: jUnit Testing Problem with Tiles)
 188152 by: Antonio Petrelli

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_188124.ezm (zipped)
for example, in a application, a admin user maybe want to check all
sessions on this application, just for this....
as I wrote in my first email, I am using a listener to add each
session when a session created, but I am lazy', so just wondering
maybe there is a better and easier way to get all sessions.

On Thu, Jun 26, 2008 at 7:08 PM, Wendy Smoak <wsmoak@(protected):
> On Thu, Jun 26, 2008 at 3:53 AM, Joey <joey.information@(protected):
>
>> Just want to know how to get all sessions.
>> now, I used a listener to add ActionContext.getContext().getSession()
>> to a list by myself, I just wondering maybe there is a struts API can
>> get all sessions.
>
> AFAIK there is no 'getSessions' method anywhere in the Servlet spec.
> (You should be able to see the session you are in, but not the
> others.)
>
> What problem are you trying to solve by doing this?
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188125.ezm (zipped)
Hi Joey,
from a security point of view, this should be forbiden.
But You may have a look at manager application from tomcat distribution,
there is exactly such thing that counts and show all sessions in
application. I've no idea how it's done there though, but most likely
there are sources for it in distribution.

Best greetings,
Paweł Wielgus.


On 26/06/2008, Joey <joey.information@(protected):
> for example, in a application, a admin user maybe want to check all
> sessions on this application, just for this....
> as I wrote in my first email, I am using a listener to add each
> session when a session created, but I am lazy', so just wondering
> maybe there is a better and easier way to get all sessions.
>
> On Thu, Jun 26, 2008 at 7:08 PM, Wendy Smoak <wsmoak@(protected):
> > On Thu, Jun 26, 2008 at 3:53 AM, Joey <joey.information@(protected):
> >
> >> Just want to know how to get all sessions.
> >> now, I used a listener to add ActionContext.getContext().getSession()
> >> to a list by myself, I just wondering maybe there is a struts API can
> >> get all sessions.
> >
> > AFAIK there is no 'getSessions' method anywhere in the Servlet spec.
> > (You should be able to see the session you are in, but not the
> > others.)
> >
> > What problem are you trying to solve by doing this?
> >
> > --
> > Wendy
> >
> > ---------------------------------------------------------------------
> > 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_188131.ezm (zipped)
Most application servers expose some kind of monitoring and management
operations, usually through JMX. Check the documentation for your
application server for more information.

Nils-H

On 26. juni. 2008, at 13.42, Joey <joey.information@(protected):

> for example, in a application, a admin user maybe want to check all
> sessions on this application, just for this....
> as I wrote in my first email, I am using a listener to add each
> session when a session created, but I am lazy', so just wondering
> maybe there is a better and easier way to get all sessions.
>
> On Thu, Jun 26, 2008 at 7:08 PM, Wendy Smoak <wsmoak@(protected):
>> On Thu, Jun 26, 2008 at 3:53 AM, Joey <joey.information@(protected)>
>> wrote:
>>
>>> Just want to know how to get all sessions.
>>> now, I used a listener to add ActionContext.getContext().getSession
>>> ()
>>> to a list by myself, I just wondering maybe there is a struts API
>>> can
>>> get all sessions.
>>
>> AFAIK there is no 'getSessions' method anywhere in the Servlet spec.
>> (You should be able to see the session you are in, but not the
>> others.)
>>
>> What problem are you trying to solve by doing this?
>>
>> --
>> Wendy
>>
>> ---------------------------------------------------------------------
>> 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_188126.ezm (zipped)
And I think the problem I'm having is figuring out what to do in the
absence of an indexed property in the s:textfield tag - there's nothing
in the generated HTML that suggests this is going into a Collection on
the Action side.

- Matt

-----Original Message-----
From: Nikhil Walvekar [mailto:walvekar@(protected)]
Sent: Thursday, June 26, 2008 7:37 AM
To: Struts Users Mailing List
Subject: Re: Multi-row tabular forms

Hi Matt,

For Struts 1.1, I used to do following things:

<logic:iterate id="dataObjects" property="dataObjects" indexId="cnt">
   <html:text name="dataObjects" property="property1"
indexed="true"/>
   <html:text name="dataObjects" property="property2"
indexed="true"/> </html:iterate>

Syntax may be wrong (tried 2 yrs back :D ).

But with this, I got another error, while populating data into form. The
collection needs to have required number of objects.
If you know that only 2 rows will be present then you can populate
collection with 2 empty object, else you might get NullPointer.

Regards,
Nikhil

On Thu, Jun 26, 2008 at 4:16 AM, Kleiderman, Matthew <
Matthew.Kleiderman@(protected):

> I'm trying create a form that maps to a collection of data objects, so

> that a user can edit any property of any object, and submit the
changes.
> I'm using an s:iterator tag to draw each item in the collection as a
> row in a table, and the xhtml template. The table is getting drawn
> properly, with data filled in from the collection - but the Action
> receiving the data always has the Collection set to null. Here's a
> stripped-down excerpt of what the .jsp looks like:
>
> <s:form theme="xhtml" id="configureobjects"
> action="DoConfigureObjects"> <s:label theme="xhtml" label="Name"
> name="Name" /> <s:hidden name="Name" /> <table>
>   <tbody>
>    <s:iterator value="DataObjects" var="CurrentObject">
>    <tr>
>     <td>
>       <s:property value="CurrentObject.Property1" />
>       <s:hidden name="CurrentObject.Property1"
> value="CurrentObject.Property1" />
>     </td>
>     <td>
>       <s:textfield name="CurrentObject.Property2" />
>     </td>
>     <td>
>       <s:textfield name="CurrentObject.Property3" />
>     </td>
>    </tr>
>    </s:iterator>
>   </tbody>
> </table>
> <sx:submit label="Configure" />
> </s:form>
>
> What am I doing wrong?
>
> Thanks in advance,
>
> Matt Kleiderman
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Nikhil

Attachment: user_188129.ezm (zipped)
That was, more or less, why I suggested manually creating an array index in the name of the field.


--- On Thu, 6/26/08, Kleiderman, Matthew <Matthew.Kleiderman@(protected):

> From: Kleiderman, Matthew <Matthew.Kleiderman@(protected)>
> Subject: RE: Multi-row tabular forms
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Thursday, June 26, 2008, 7:53 AM
> And I think the problem I'm having is figuring out what
> to do in the
> absence of an indexed property in the s:textfield tag -
> there's nothing
> in the generated HTML that suggests this is going into a
> Collection on
> the Action side.
>
> - Matt
>
> -----Original Message-----
> From: Nikhil Walvekar [mailto:walvekar@(protected)]
> Sent: Thursday, June 26, 2008 7:37 AM
> To: Struts Users Mailing List
> Subject: Re: Multi-row tabular forms
>
> Hi Matt,
>
> For Struts 1.1, I used to do following things:
>
> <logic:iterate id="dataObjects"
> property="dataObjects"
> indexId="cnt">
>     <html:text name="dataObjects"
> property="property1"
> indexed="true"/>
>     <html:text name="dataObjects"
> property="property2"
> indexed="true"/> </html:iterate>
>
> Syntax may be wrong (tried 2 yrs back :D ).
>
> But with this, I got another error, while populating data
> into form. The
> collection needs to have required number of objects.
> If you know that only 2 rows will be present then you can
> populate
> collection with 2 empty object, else you might get
> NullPointer.
>
> Regards,
> Nikhil
>
> On Thu, Jun 26, 2008 at 4:16 AM, Kleiderman, Matthew <
> Matthew.Kleiderman@(protected):
>
> > I'm trying create a form that maps to a collection
> of data objects, so
>
> > that a user can edit any property of any object, and
> submit the
> changes.
> > I'm using an s:iterator tag to draw each item in
> the collection as a
> > row in a table, and the xhtml template. The table is
> getting drawn
> > properly, with data filled in from the collection -
> but the Action
> > receiving the data always has the Collection set to
> null. Here's a
> > stripped-down excerpt of what the .jsp looks like:
> >
> > <s:form theme="xhtml"
> id="configureobjects"
> > action="DoConfigureObjects"> <s:label
> theme="xhtml" label="Name"
> > name="Name" /> <s:hidden
> name="Name" /> <table>
> >   <tbody>
> >    <s:iterator value="DataObjects"
> var="CurrentObject">
> >    <tr>
> >     <td>
> >       <s:property
> value="CurrentObject.Property1" />
> >       <s:hidden
> name="CurrentObject.Property1"
> > value="CurrentObject.Property1" />
> >     </td>
> >     <td>
> >       <s:textfield
> name="CurrentObject.Property2" />
> >     </td>
> >     <td>
> >       <s:textfield
> name="CurrentObject.Property3" />
> >     </td>
> >    </tr>
> >    </s:iterator>
> >   </tbody>
> > </table>
> > <sx:submit label="Configure" />
> > </s:form>
> >
> > What am I doing wrong?
> >
> > Thanks in advance,
> >
> > Matt Kleiderman
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
>
>
> --
> Nikhil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_188135.ezm (zipped)
OK - that could work, but would it auto magically go into the Collection
on the Action if I tamper with the ID field, or would I have to start
looking into HttpRequest parameters? If the latter, then creating a new
tag and interceptor combination is probably the right way to go about
it.

- Matt

-----Original Message-----
From: Dave Newton [mailto:newton.dave@(protected)]
Sent: Thursday, June 26, 2008 8:00 AM
To: Struts Users Mailing List
Subject: RE: Multi-row tabular forms

That was, more or less, why I suggested manually creating an array index
in the name of the field.


--- On Thu, 6/26/08, Kleiderman, Matthew <Matthew.Kleiderman@(protected)>
wrote:

> From: Kleiderman, Matthew <Matthew.Kleiderman@(protected)>
> Subject: RE: Multi-row tabular forms
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Thursday, June 26, 2008, 7:53 AM And I think the problem I'm
> having is figuring out what to do in the absence of an indexed
> property in the s:textfield tag - there's nothing in the generated
> HTML that suggests this is going into a Collection on the Action side.
>
> - Matt
>
> -----Original Message-----
> From: Nikhil Walvekar [mailto:walvekar@(protected)]
> Sent: Thursday, June 26, 2008 7:37 AM
> To: Struts Users Mailing List
> Subject: Re: Multi-row tabular forms
>
> Hi Matt,
>
> For Struts 1.1, I used to do following things:
>
> <logic:iterate id="dataObjects"
> property="dataObjects"
> indexId="cnt">
>     <html:text name="dataObjects"
> property="property1"
> indexed="true"/>
>     <html:text name="dataObjects"
> property="property2"
> indexed="true"/> </html:iterate>
>
> Syntax may be wrong (tried 2 yrs back :D ).
>
> But with this, I got another error, while populating data into form.
> The collection needs to have required number of objects.
> If you know that only 2 rows will be present then you can populate
> collection with 2 empty object, else you might get NullPointer.
>
> Regards,
> Nikhil
>
> On Thu, Jun 26, 2008 at 4:16 AM, Kleiderman, Matthew <
> Matthew.Kleiderman@(protected):
>
> > I'm trying create a form that maps to a collection
> of data objects, so
>
> > that a user can edit any property of any object, and
> submit the
> changes.
> > I'm using an s:iterator tag to draw each item in
> the collection as a
> > row in a table, and the xhtml template. The table is
> getting drawn
> > properly, with data filled in from the collection -
> but the Action
> > receiving the data always has the Collection set to
> null. Here's a
> > stripped-down excerpt of what the .jsp looks like:
> >
> > <s:form theme="xhtml"
> id="configureobjects"
> > action="DoConfigureObjects"> <s:label
> theme="xhtml" label="Name"
> > name="Name" /> <s:hidden
> name="Name" /> <table>
> >   <tbody>
> >    <s:iterator value="DataObjects"
> var="CurrentObject">
> >    <tr>
> >     <td>
> >       <s:property
> value="CurrentObject.Property1" />
> >       <s:hidden
> name="CurrentObject.Property1"
> > value="CurrentObject.Property1" />
> >     </td>
> >     <td>
> >       <s:textfield
> name="CurrentObject.Property2" />
> >     </td>
> >     <td>
> >       <s:textfield
> name="CurrentObject.Property3" />
> >     </td>
> >    </tr>
> >    </s:iterator>
> >   </tbody>
> > </table>
> > <sx:submit label="Configure" />
> > </s:form>
> >
> > What am I doing wrong?
> >
> > Thanks in advance,
> >
> > Matt Kleiderman
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
>
>
> --
> Nikhil
>
> ---------------------------------------------------------------------
> 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_188136.ezm (zipped)
In generated HTML it should be like this
<input type="text" name="dataObjects[0].property1" value=""/>

If you can get output like this, then that collection can be populated.

Regards,
Nikhil

On Thu, Jun 26, 2008 at 5:23 PM, Kleiderman, Matthew <
Matthew.Kleiderman@(protected):

> And I think the problem I'm having is figuring out what to do in the
> absence of an indexed property in the s:textfield tag - there's nothing
> in the generated HTML that suggests this is going into a Collection on
> the Action side.
>
> - Matt
>
> -----Original Message-----
> From: Nikhil Walvekar [mailto:walvekar@(protected)]
> Sent: Thursday, June 26, 2008 7:37 AM
> To: Struts Users Mailing List
> Subject: Re: Multi-row tabular forms
>
> Hi Matt,
>
> For Struts 1.1, I used to do following things:
>
> <logic:iterate id="dataObjects" property="dataObjects" indexId="cnt">
>    <html:text name="dataObjects" property="property1"
> indexed="true"/>
>    <html:text name="dataObjects" property="property2"
> indexed="true"/> </html:iterate>
>
> Syntax may be wrong (tried 2 yrs back :D ).
>
> But with this, I got another error, while populating data into form. The
> collection needs to have required number of objects.
> If you know that only 2 rows will be present then you can populate
> collection with 2 empty object, else you might get NullPointer.
>
> Regards,
> Nikhil
>
> On Thu, Jun 26, 2008 at 4:16 AM, Kleiderman, Matthew <
> Matthew.Kleiderman@(protected):
>
> > I'm trying create a form that maps to a collection of data objects, so
>
> > that a user can edit any property of any object, and submit the
> changes.
> > I'm using an s:iterator tag to draw each item in the collection as a
> > row in a table, and the xhtml template. The table is getting drawn
> > properly, with data filled in from the collection - but the Action
> > receiving the data always has the Collection set to null. Here's a
> > stripped-down excerpt of what the .jsp looks like:
> >
> > <s:form theme="xhtml" id="configureobjects"
> > action="DoConfigureObjects"> <s:label theme="xhtml" label="Name"
> > name="Name" /> <s:hidden name="Name" /> <table>
> >   <tbody>
> >    <s:iterator value="DataObjects" var="CurrentObject">
> >    <tr>
> >     <td>
> >       <s:property value="CurrentObject.Property1" />
> >       <s:hidden name="CurrentObject.Property1"
> > value="CurrentObject.Property1" />
> >     </td>
> >     <td>
> >       <s:textfield name="CurrentObject.Property2" />
> >     </td>
> >     <td>
> >       <s:textfield name="CurrentObject.Property3" />
> >     </td>
> >    </tr>
> >    </s:iterator>
> >   </tbody>
> > </table>
> > <sx:submit label="Configure" />
> > </s:form>
> >
> > What am I doing wrong?
> >
> > Thanks in advance,
> >
> > Matt Kleiderman
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@(protected)
> > For additional commands, e-mail: user-help@(protected)
> >
> >
>
>
> --
> Nikhil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>


--
Nikhil

Attachment: user_188140.ezm (zipped)
Not sure what "id" field you're talking about, but S2's type conversion handles collections.

Dave


--- On Thu, 6/26/08, Kleiderman, Matthew <Matthew.Kleiderman@(protected):

> From: Kleiderman, Matthew <Matthew.Kleiderman@(protected)>
> Subject: RE: Multi-row tabular forms
> To: "Struts Users Mailing List" <user@(protected)
> Date: Thursday, June 26, 2008, 8:04 AM
> OK - that could work, but would it auto magically go into
> the Collection
> on the Action if I tamper with the ID field, or would I
> have to start
> looking into HttpRequest parameters? If the latter, then
> creating a new
> tag and interceptor combination is probably the right way
> to go about
> it.
>
> - Matt
>
> -----Original Message-----
> From: Dave Newton [mailto:newton.dave@(protected)]
> Sent: Thursday, June 26, 2008 8:00 AM
> To: Struts Users Mailing List
> Subject: RE: Multi-row tabular forms
>
> That was, more or less, why I suggested manually creating
> an array index
> in the name of the field.
>
>
> --- On Thu, 6/26/08, Kleiderman, Matthew
> <Matthew.Kleiderman@(protected)>
> wrote:
>
> > From: Kleiderman, Matthew
> <Matthew.Kleiderman@(protected)>
> > Subject: RE: Multi-row tabular forms
> > To: "Struts Users Mailing List"
> <user@(protected)>
> > Date: Thursday, June 26, 2008, 7:53 AM And I think the
> problem I'm
> > having is figuring out what to do in the absence of an
> indexed
> > property in the s:textfield tag - there's nothing
> in the generated
> > HTML that suggests this is going into a Collection on
> the Action side.
> >
> > - Matt
> >
> > -----Original Message-----
> > From: Nikhil Walvekar [mailto:walvekar@(protected)]
> > Sent: Thursday, June 26, 2008 7:37 AM
> > To: Struts Users Mailing List
> > Subject: Re: Multi-row tabular forms
> >
> > Hi Matt,
> >
> > For Struts 1.1, I used to do following things:
> >
> > <logic:iterate id="dataObjects"
> > property="dataObjects"
> > indexId="cnt">
> >     <html:text name="dataObjects"
> > property="property1"
> > indexed="true"/>
> >     <html:text name="dataObjects"
> > property="property2"
> > indexed="true"/> </html:iterate>
> >
> > Syntax may be wrong (tried 2 yrs back :D ).
> >
> > But with this, I got another error, while populating
> data into form.
> > The collection needs to have required number of
> objects.
> > If you know that only 2 rows will be present then you
> can populate
> > collection with 2 empty object, else you might get
> NullPointer.
> >
> > Regards,
> > Nikhil
> >
> > On Thu, Jun 26, 2008 at 4:16 AM, Kleiderman, Matthew
> <
> > Matthew.Kleiderman@(protected):
> >
> > > I'm trying create a form that maps to a
> collection
> > of data objects, so
> >
> > > that a user can edit any property of any object,
> and
> > submit the
> > changes.
> > > I'm using an s:iterator tag to draw each item
> in
> > the collection as a
> > > row in a table, and the xhtml template. The
> table is
> > getting drawn
> > > properly, with data filled in from the collection
> -
> > but the Action
> > > receiving the data always has the Collection set
> to
> > null. Here's a
> > > stripped-down excerpt of what the .jsp looks
> like:
> > >
> > > <s:form theme="xhtml"
> > id="configureobjects"
> > > action="DoConfigureObjects">
> <s:label
> > theme="xhtml" label="Name"
> > > name="Name" /> <s:hidden
> > name="Name" /> <table>
> > >   <tbody>
> > >    <s:iterator value="DataObjects"
> > var="CurrentObject">
> > >    <tr>
> > >     <td>
> > >       <s:property
> > value="CurrentObject.Property1" />
> > >       <s:hidden
> > name="CurrentObject.Property1"
> > > value="CurrentObject.Property1" />
> > >     </td>
> > >     <td>
> > >       <s:textfield
> > name="CurrentObject.Property2" />
> > >     </td>
> > >     <td>
> > >       <s:textfield
> > name="CurrentObject.Property3" />
> > >     </td>
> > >    </tr>
> > >    </s:iterator>
> > >   </tbody>
> > > </table>
> > > <sx:submit label="Configure" />
> > > </s:form>
> > >
> > > What am I doing wrong?
> > >
> > > Thanks in advance,
> > >
> > > Matt Kleiderman
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > user-unsubscribe@(protected)
> > > For additional commands, e-mail:
> > user-help@(protected)
> > >
> > >
> >
> >
> > --
> > Nikhil
> >
> >
> ---------------------------------------------------------------------
> > 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)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_188127.ezm (zipped)
2008/6/26 ezgi <ezgicicekk@(protected)>:
> If I include the tiles part in struts.xml, it gives a NullPointerException :

Did you add the StrutsTilesListener in your web.xml?
http://cwiki.apache.org/confluence/display/WW/Tiles+Plugin
Did you configure Tiles correctly?

Antonio

Attachment: user_188128.ezm (zipped)
2008/6/26 ezgi <ezgicicekk@(protected)>:
> If you look at the tutorial I refer, you can understand that I am not the
> only one who have this problem. I try to set the configuration file to
> tiles.defs.xml as suggested, but it gave an XML parse exception.

Can we see the Tiles definition files that you are using?

Antonio

Attachment: user_188132.ezm (zipped)

This is the tiles.defs.xml :


<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
    "-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
    "http://tiles.apache.org/dtds/tiles-config_2_0.dtd">

<tiles-definitions>

 <definition name="tvq.template.default"  template="/layouts/default.jsp">
   <put-attribute name="title" value="Tiles tutorial homepage" />
   <put-attribute name="header" value="/tiles/header.jsp" />
   <put-attribute name="menu" value="/tiles/menu.jsp" />
   <put-attribute name="content" value="/tiles/content.jsp" />
   <put-attribute name="footer" value="/tiles/footer.jsp" />
 </definition>

 <definition name="tvq.ListTasks" extends="tvq.template.default">
   <put-attribute name="title" value="List Tasks" />
   <put-attribute name="content" value="/jsp/task/ListTasks.jsp" />
 </definition>
 
 <definition name="tvq.addTask" extends="tvq.template.default">
   <put-attribute name="title" value="Add a Task" />
   <put-attribute name="content" value="/jsp/task/addTask.jsp" />
 </definition>

</tiles-definitions>



and this is the web.xml :

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
 xmlns="http://java.sun.com/xml/ns/j2ee"
 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">
 <display-name>TVQ</display-name>

 <filter>
   <filter-name>struts2</filter-name>
   <filter-class>
     org.apache.struts2.dispatcher.FilterDispatcher
   </filter-class>
 </filter>
 <!-- Add the filter mapping after all filters -->
 <filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/*</url-pattern>
 </filter-mapping>

 <listener>
   <listener-class>
     org.springframework.web.context.ContextLoaderListener
   </listener-class>
 </listener>




 <listener>
   <listener-class>
     org.apache.struts2.tiles.StrutsTilesListener
   </listener-class>
 </listener>

 <servlet>
   <servlet-name>tiles</servlet-name>
   <servlet-class>
     org.apache.tiles.web.startup.TilesServlet
   </servlet-class>
   <init-param>
     <param-name>
       org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
     </param-name>
     <param-value>
       /WEB-INF/tiles-defs.xml
     </param-value>
   </init-param>
   <load-on-startup>2</load-on-startup>
 </servlet>


 <filter>
   <filter-name>Tiles_Filter</filter-name>
   <filter-class>
     org.apache.tiles.web.startup.TilesFilter
   </filter-class>
   <init-param>
     <param-name>
       org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
     </param-name>
     <param-value>
       /WEB-INF/tiles-defs.xml
     </param-value>
   </init-param>
 </filter>

 <filter-mapping>
   <filter-name>Tiles_Filter</filter-name>
   <url-pattern>/*</url-pattern>
   <dispatcher>REQUEST</dispatcher>
 </filter-mapping>
 

 <welcome-file-list>
   <welcome-file>index.html</welcome-file>
   <welcome-file>index.htm</welcome-file>
   <welcome-file>index.jsp</welcome-file>
   <welcome-file>default.html</welcome-file>
   <welcome-file>default.htm</welcome-file>
   <welcome-file>default.jsp</welcome-file>
 </welcome-file-list>
</web-app>


Antonio Petrelli-3 wrote:
>
> 2008/6/26 ezgi <ezgicicekk@(protected)>:
>> If you look at the tutorial I refer, you can understand that I am not the
>> only one who have this problem. I try to set the configuration file to
>> tiles.defs.xml as suggested, but it gave an XML parse exception.
>
> Can we see the Tiles definition files that you are using?
>
> Antonio
>
> ---------------------------------------------------------------------
> 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_188137.ezm (zipped)
2008/6/26 ezgi <ezgicicekk@(protected)>:
>
> This is the tiles.defs.xml :
>     <listener>
>           <listener-class>
>                org.apache.struts2.tiles.StrutsTilesListener
>           </listener-class>
>     </listener>
>
>     <servlet>
>           <servlet-name>tiles</servlet-name>
>           <servlet-class>
>                org.apache.tiles.web.startup.TilesServlet
>           </servlet-class>
>           <init-param>
>                <param-name>
>                     org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
>                </param-name>
>                <param-value>
>                     /WEB-INF/tiles-defs.xml
>                </param-value>
>           </init-param>
>           <load-on-startup>2</load-on-startup>
>     </servlet>
>
>
>     <filter>
>           <filter-name>Tiles_Filter</filter-name>
>           <filter-class>
>                org.apache.tiles.web.startup.TilesFilter
>           </filter-class>
>           <init-param>
>                <param-name>
>                     org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
>                </param-name>
>                <param-value>
>                     /WEB-INF/tiles-defs.xml
>                </param-value>
>           </init-param>
>     </filter>
>
>     <filter-mapping>
>           <filter-name>Tiles_Filter</filter-name>
>           <url-pattern>/*</url-pattern>
>           <dispatcher>REQUEST</dispatcher>
>     </filter-mapping>

The problem is that you are using StrutsTilesListener (that loads
/WEB-INF/tiles.xml by default), TilesServlet and TilesFilter at the
same time.
Choose one and configure it. I suggest to use StrutsTilesListener
only. Configuring it means putting a context parameter. See:
http://tiles.apache.org/tutorial/configuration.html

Antonio

Attachment: user_188141.ezm (zipped)

I tried three of them seperatley, but it did not work. Should I modify the
configuration variable in the BaseStrutsTestCase? I did not add there
web.xml and tiles-defs.xml.
As you suggested, I add this code into web.xml.

<listener>
   <listener-class>
     org.apache.tiles.web.startup.TilesListener
   </listener-class>
 </listener>

   <context-param>
     <param-name>
       org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
     </param-name>
     <param-value>
       /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
     </param-value>
   </context-param>


Antonio Petrelli-3 wrote:
>
> 2008/6/26 ezgi <ezgicicekk@(protected)>:
>>
>> This is the tiles.defs.xml :
>>     <listener>
>>           <listener-class>
>>                org.apache.struts2.tiles.StrutsTilesListener
>>           </listener-class>
>>     </listener>
>>
>>     <servlet>
>>           <servlet-name>tiles</servlet-name>
>>           <servlet-class>
>>                org.apache.tiles.web.startup.TilesServlet
>>           </servlet-class>
>>           <init-param>
>>                <param-name>
>>                    
>> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
>>                </param-name>
>>                <param-value>
>>                     /WEB-INF/tiles-defs.xml
>>                </param-value>
>>           </init-param>
>>           <load-on-startup>2</load-on-startup>
>>     </servlet>
>>
>>
>>     <filter>
>>           <filter-name>Tiles_Filter</filter-name>
>>           <filter-class>
>>                org.apache.tiles.web.startup.TilesFilter
>>           </filter-class>
>>           <init-param>
>>                <param-name>
>>                    
>> org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
>>                </param-name>
>>                <param-value>
>>                     /WEB-INF/tiles-defs.xml
>>                </param-value>
>>           </init-param>
>>     </filter>
>>
>>     <filter-mapping>
>>           <filter-name>Tiles_Filter</filter-name>
>>           <url-pattern>/*</url-pattern>
>>           <dispatcher>REQUEST</dispatcher>
>>     </filter-mapping>
>
> The problem is that you are using StrutsTilesListener (that loads
> /WEB-INF/tiles.xml by default), TilesServlet and TilesFilter at the
> same time.
> Choose one and configure it. I suggest to use StrutsTilesListener
> only. Configuring it means putting a context parameter. See:
> http://tiles.apache.org/tutorial/configuration.html
>
> Antonio
>
> ---------------------------------------------------------------------
> 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_188143.ezm (zipped)
--- On Thu, 6/26/08, Antonio Petrelli <antonio.petrelli@(protected):
> The problem is that you are using StrutsTilesListener (that
> loads /WEB-INF/tiles.xml by default), TilesServlet and
> TilesFilter at the same time.

Two is one, one is none! Three is... three is right out.

You're just mad because of that whole Spain thing.

Dave


Attachment: user_188145.ezm (zipped)
2008/6/26 Dave Newton <newton.dave@(protected)>:
> --- On Thu, 6/26/08, Antonio Petrelli <antonio.petrelli@(protected):
>> The problem is that you are using StrutsTilesListener (that
>> loads /WEB-INF/tiles.xml by default), TilesServlet and
>> TilesFilter at the same time.
>
> Two is one, one is none! Three is... three is right out.
>
> You're just mad because of that whole Spain thing.

Eh? I know I am supposed to laugh, but since I am Italian could you
explain it a little ;-)

Antonio

Attachment: user_188146.ezm (zipped)
2008/6/26 ezgi <ezgicicekk@(protected)>:
> I tried three of them seperatley, but it did not work.

Please clarify, what do you mean with "it did not work"? Do you
receive an exception at startup?

> Should I modify the configuration variable in the BaseStrutsTestCase? I did not add there
> web.xml and tiles-defs.xml.

Sincerely I am not into BaseStrutsTestCase, so I cannot help in this case

>                <param-value>
>                     /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
>                </param-value>

Have you got a "classpath-defs.xml" anywhere in your code? If not, remove it.

Antonio

Attachment: user_188148.ezm (zipped)
2008/6/26 ezgi <ezgicicekk@(protected)>:
> I tried three of them seperatley, but it did not work.

Please clarify, what do you mean with "it did not work"? Do you
receive an exception at startup?

> Should I modify the configuration variable in the BaseStrutsTestCase? I did not add there
> web.xml and tiles-defs.xml.

Sincerely I am not into BaseStrutsTestCase, so I cannot help in this case

>                <param-value>
>                     /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
>                </param-value>

Have you got a "classpath-defs.xml" anywhere in your code? If not, remove it.

Antonio

Attachment: user_188153.ezm (zipped)

I have loaded the Tiles listener and run the jUnit test and it gave the same
NullPointer Exception. Moreover, the trace is same as before.
Then, I tried to load tiles servlet, and it gave the same error. Lastly, I
loaded the tiles filter and it gave ther same NPE.
I have already tried three of them so I can't figure out what the problem
is. Did I load them wrongly?

I have just replaced the code with the new one, isn't it the one you
suggested?

Modified web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
 xmlns="http://java.sun.com/xml/ns/j2ee"
 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">
 <display-name>TVQ</display-name>


 <filter>
   <filter-name>struts2</filter-name>
   <filter-class>
     org.apache.struts2.dispatcher.FilterDispatcher
   </filter-class>
 </filter>
 <!-- Add the filter mapping after all filters -->
 <filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/*</url-pattern>
 </filter-mapping>

 <listener>
   <listener-class>
     org.springframework.web.context.ContextLoaderListener
   </listener-class>
 </listener>


 <listener>
   <listener-class>
     org.apache.tiles.web.startup.TilesListener
   </listener-class>
 </listener>

   <context-param>
     <param-name>
       org.apache.tiles.impl.BasicTilesContainer.DEFINITIONS_CONFIG
     </param-name>
     <param-value>
       /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
     </param-value>
   </context-param>

 <welcome-file-list>
   <welcome-file>index.html</welcome-file>
   <welcome-file>index.htm</welcome-file>
   <welcome-file>index.jsp</welcome-file>
   <welcome-file>default.html</welcome-file>
   <welcome-file>default.htm</welcome-file>
   <welcome-file>default.jsp</welcome-file>
 </welcome-file-list>
</web-app>


Antonio Petrelli-3 wrote:
>
> 2008/6/26 ezgi <ezgicicekk@(protected)>:
>> I tried three of them seperatley, but it did not work.
>
> Please clarify, what do you mean with "it did not work"? Do you
> receive an exception at startup?
>
>> Should I modify the configuration variable in the BaseStrutsTestCase? I
>> did not add there
>> web.xml and tiles-defs.xml.
>
> Sincerely I am not into BaseStrutsTestCase, so I cannot help in this case
>
>>                <param-value>
>>                    
>> /WEB-INF/tiles-defs.xml,/org/apache/tiles/classpath-defs.xml
>>                </param-value>
>
> Have you got a "classpath-defs.xml" anywhere in your code? If not, remove
> it.
>
> Antonio
>
> ---------------------------------------------------------------------
> 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_188130.ezm (zipped)
I have designed a web multiannual web application in "UTF-8".



JSP Code:

<%@(protected)" %>

<%

request.setCharacterEncoding("utf-8"); // this can be added in Servlet
Filter or in Action Form

%>



When JSP page is rendered it is found in

IE > View... > Encoding > Unicode (UTF-8) >



Is it possible to restrict the user to change encoding option in browser?

Example:

IE > View... > Encoding > Central European >





Is there a way to identify in JSP or in Action File if the encoding has been
modified at client side by user and show a message that

"This application has been design to work in UTF-8 Encoding "









                 




Attachment: user_188133.ezm (zipped)
> I have designed a web multiannual web application in "UTF-8".

It will run for years?

> Is it possible to restrict the user to change
> encoding option in browser?

From the *web app*?!

> Is there a way to identify in JSP or in Action File if the
> encoding has been modified at client side by user and show
> a message that [...]

Maybe there's something in the headers you could look at. In any case, it's not a Struts issue.

Dave


Attachment: user_188134.ezm (zipped)
2008/6/26 Raghuveer <raghuveerv@(protected)>:
> Is there a way to identify in JSP or in Action File if the encoding has been
> modified at client side by user and show a message that
>
> "This application has been design to work in UTF-8 Encoding "

Yes, check the "Accept-Charset" header field:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.2

Antonio

Attachment: user_188138.ezm (zipped)
... a remember me tick box on a login page?

If the user ticks the box they're don't have to log in again if they
visit the site again, if they don't click it the login times out in the
same manner as a normal session.

Remember; I'm ideally looking for a method that stays within the
framwork and doesn't make use of servlet request/response/context methods.

Attachment: user_188139.ezm (zipped)
Hi Al,
use cookie?
But it's working only within one user browser at a time.

Best greetings,
Paweł Wielgus

On 26/06/2008, Al Sutton <al.sutton@(protected):
> ... a remember me tick box on a login page?
>
> If the user ticks the box they're don't have to log in again if they visit
> the site again, if they don't click it the login times out in the same
> manner as a normal session.
>
> Remember; I'm ideally looking for a method that stays within the framwork
> and doesn't make use of servlet request/response/context methods.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188142.ezm (zipped)
Hi

2008/6/26 Al Sutton <al.sutton@(protected)>:
> ... a remember me tick box on a login page?
>
> If the user ticks the box they're don't have to log in again if they visit
> the site again, if they don't click it the login times out in the same
> manner as a normal session.
>
> Remember; I'm ideally looking for a method that stays within the framwork
> and doesn't make use of servlet request/response/context methods.

Look at Acegi aka Spring Security, you have support for that out of box.


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

Attachment: user_188144.ezm (zipped)
I don't recall seeing any S2-y cookies stuff, but it'd be pretty easy to write an interceptor that could toss your cookies if there isn't already (and, I suppose, run cookie values through type conversion. Hrmmm.)

Dave

--- On Thu, 6/26/08, Al Sutton <al.sutton@(protected):

> From: Al Sutton <al.sutton@(protected)>
> Subject: [s2] Whats the most strutsy way of doing....
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Thursday, June 26, 2008, 8:19 AM
> ... a remember me tick box on a login page?
>
> If the user ticks the box they're don't have to log
> in again if they
> visit the site again, if they don't click it the login
> times out in the
> same manner as a normal session.
>
> Remember; I'm ideally looking for a method that stays
> within the
> framwork and doesn't make use of servlet
> request/response/context methods.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail:
> user-help@(protected)

Attachment: user_188147.ezm (zipped)
Hi all,

Does anybody know of a way to override the default type conversion error of
Struts 2 in a way that makes it possible to localize the field name? I've
tried using ${getText(fieldName)} and {0] in the overriding message, but
they don't seem to work.

Jukka

Attachment: user_188150.ezm (zipped)
Hmm, I've used ${getText(fieldName)} in the resources without issues... I wonder why that worked for me? Are you using the "key" attribute in the form tag?

Dave


--- On Thu, 6/26/08, Jukka Välimaa <valimaa.jukka@(protected):

> From: Jukka Välimaa <valimaa.jukka@(protected)>
> Subject: Overriding and localizing default conversion error message
> To: "Struts Users Mailing List" <user@(protected)>
> Date: Thursday, June 26, 2008, 8:40 AM
> Hi all,
>
> Does anybody know of a way to override the default type
> conversion error of
> Struts 2 in a way that makes it possible to localize the
> field name? I've
> tried using ${getText(fieldName)} and {0] in the overriding
> message, but
> they don't seem to work.
>
> Jukka

Attachment: user_188149.ezm (zipped)
--- On Thu, 6/26/08, Antonio Petrelli <antonio.petrelli@(protected):
> Eh? I know I am supposed to laugh, but since I am Italian
> could you explain it a little ;-)

Or cry; Spain whupped ya' 4-2.

Dave


Attachment: user_188151.ezm (zipped)
At least they made it to the tournament :(

Dave Newton wrote:
> --- On Thu, 6/26/08, Antonio Petrelli <antonio.petrelli@(protected):
>  
>> Eh? I know I am supposed to laugh, but since I am Italian
>> could you explain it a little ;-)
>>  
>
> Or cry; Spain whupped ya' 4-2.
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>  


Attachment: user_188152.ezm (zipped)
2008/6/26 Al Sutton <al.sutton@(protected)>:
> At least they made it to the tournament :(

Ah now I got it. You know, I removed the tournament from my memory
after the penalty kicks :-D
I see the positive point though, Donadoni is going away and Lippi is
coming back.

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