Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 6 Jul 2008 04:09:12 -0000 Issue 8125

user-digest-help

2008-07-06


Author LoginPost Reply

user Digest 6 Jul 2008 04:09:12 -0000 Issue 8125

Topics (messages 188500 through 188517):

Re: Struts2 application doesn't work with Firefox 3
 188500 by: Pierrot52
 188501 by: Pierrot52
 188502 by: georz1
 188506 by: Pierrot52

Type Casting through OGNL expressions.
 188503 by: Ajaneesh Rajashekharaiah
 188504 by: Ajaneesh Rajashekharaiah

Re: Character Encoding and s:textarea
 188505 by: Richard Sayre

Re: Interceptor to access session objects
 188507 by: Ralf Fischer

Problem with FormBean containing Lists of LabelValueBeans or something equivalent
 188508 by: Erik Panzer

Jasper Report Plugin
 188509 by: Felipe Rodrigues
 188510 by: Patrick J Kobly

Re: Where to put customized template
 188511 by: lei.java.gmail.com
 188513 by: Struts Two
 188514 by: dusty

Re: [S2] Checking current month using struts 2 tags
 188512 by: dusty

Re: Actions, properties and validation in separate packages?
 188515 by: dusty

Re: Struts2 iterator tag
 188516 by: dusty

Re: [s] Validity of user session
 188517 by: dusty

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

Hi georz

I made the changes and it works just great! I have datetimepicker and they
work.

I don't have tabbedpanel though.

Regards.

Pierre


georz1 wrote:
>
> Check the pages referenced in your jsp as common/IncludeTop.jsp. See if
> it has a <s:head theme="ajax"> and change it to <s:head theme="xhtml"> and
> see if that fixes it. The downside however to doing this is if you have
> any ajax specific tags in the jsp (tabbedpanel, datetimepicker) they may
> not work properly and you'll have to find a work around. Right now that
> is where I'm stuck. I have tabbedpanel that doesn't work.
>
>
>
> Pierrot52 wrote:
>>
>> Yes,
>> It seems to render and then disappears and hangs. I have to hit the back
>> button to see the page.
>>
>>
>> georz1 wrote:
>>>
>>> When you say hangs does it look like it renders and then disappears and
>>> hangs. I'm having a similar issue and have narrowed it down to page
>>> theme being <s:head theme=ajax>. If I make my pages xhtml they render
>>> fine. Using Firebug I can see that sometimes the dojo libraries are not
>>> loading properly. Unfortunately I don't have a complete fix yet other
>>> than changing the theme.
>>>
>>>
>>> I have an action that normally brings a signon form but for some reasons
>>>>> Firefox hangs. The URL to load the form is
>>>>> http://my_host:8080/cobbCalculator2/signonForm.action
>>>>
>>>
>>
>>
>
>

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


Attachment: user_188501.ezm (zipped)

Hi georz,

You're right,

I double checked and my datetimepickers don't work.

I have to find a workaround

Thanks.

Pierre


georz1 wrote:
>
> Check the pages referenced in your jsp as common/IncludeTop.jsp. See if
> it has a <s:head theme="ajax"> and change it to <s:head theme="xhtml"> and
> see if that fixes it. The downside however to doing this is if you have
> any ajax specific tags in the jsp (tabbedpanel, datetimepicker) they may
> not work properly and you'll have to find a work around. Right now that
> is where I'm stuck. I have tabbedpanel that doesn't work.
>
>
>
> Pierrot52 wrote:
>>
>> Yes,
>> It seems to render and then disappears and hangs. I have to hit the back
>> button to see the page.
>>
>>
>> georz1 wrote:
>>>
>>> When you say hangs does it look like it renders and then disappears and
>>> hangs. I'm having a similar issue and have narrowed it down to page
>>> theme being <s:head theme=ajax>. If I make my pages xhtml they render
>>> fine. Using Firebug I can see that sometimes the dojo libraries are not
>>> loading properly. Unfortunately I don't have a complete fix yet other
>>> than changing the theme.
>>>
>>>
>>> I have an action that normally brings a signon form but for some reasons
>>>>> Firefox hangs. The URL to load the form is
>>>>> http://my_host:8080/cobbCalculator2/signonForm.action
>>>>
>>>
>>
>>
>
>

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


Attachment: user_188502.ezm (zipped)

I know the ajax theme loads a ton of javascript includes. You might be able
to add manually just the ones you need for the datetimepicker to see if you
can get them to work.  Looking on the dojo support boards might help also.

Regards,
George



Pierrot52 wrote:
>
> Hi georz,
>
> You're right,
>
> I double checked and my datetimepickers don't work.
>
> I have to find a workaround
>
> Thanks.
>
> Pierre
>
>
> georz1 wrote:
>>
>> Check the pages referenced in your jsp as common/IncludeTop.jsp. See if
>> it has a <s:head theme="ajax"> and change it to <s:head theme="xhtml">
>> and see if that fixes it. The downside however to doing this is if you
>> have any ajax specific tags in the jsp (tabbedpanel, datetimepicker) they
>> may not work properly and you'll have to find a work around. Right now
>> that is where I'm stuck. I have tabbedpanel that doesn't work.
>>
>>
>>
>> Pierrot52 wrote:
>>>
>>> Yes,
>>> It seems to render and then disappears and hangs. I have to hit the back
>>> button to see the page.
>>>
>>>
>>> georz1 wrote:
>>>>
>>>> When you say hangs does it look like it renders and then disappears and
>>>> hangs. I'm having a similar issue and have narrowed it down to page
>>>> theme being <s:head theme=ajax>. If I make my pages xhtml they render
>>>> fine. Using Firebug I can see that sometimes the dojo libraries are
>>>> not loading properly. Unfortunately I don't have a complete fix yet
>>>> other than changing the theme.
>>>>
>>>>
>>>> I have an action that normally brings a signon form but for some
>>>> reasons
>>>>>> Firefox hangs. The URL to load the form is
>>>>>> http://my_host:8080/cobbCalculator2/signonForm.action
>>>>>
>>>>
>>>
>>>
>>
>>
>
>

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


Attachment: user_188506.ezm (zipped)

After spending several hours investigating I found that that problem was that
Firefox 3 does not properly load the *.js files and each time I have to hit
the Back button to see the file.
The files are loader correctly but Firefox does not show them.
It works fine with Firefox 2 though and I've told my customers to wait until
there is a patch available from Mozilla to fix that problem.

Ciao


Pierrot52 wrote:
>
> Hello,
> I have developed a Struts2 application that works well under Firefox 2, IE
> 6, IE 7, Safari, and Opera.
> Unfortunately it doesn't work under Firefox 3.
> Has anybody made this observation and found a solution to this problem?
> Regards.
>

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


Attachment: user_188503.ezm (zipped)

Hi,

I want to do the following, would like to understand if it is possible
at all before proceeding any further.

basically i am working on generating dynamic screens based on Apache
XmlBeans generated classes.

While the following is not exactly what i am doing, it will help drive
the idea home...

i have a number of XSD files for which i generate XmlBeans binding
files. All these classes are basically of type XmlObject.
Understandably, each class would have diffferent setters and getters
based on the XSD. In my action class, i want to declare a property with
just the underlying interface (i.e. XmlObject). I am in a position to
generate the dynamic screen based on the XML schema... but how do i
populate those back to my XmlObject property?

for e.g. Action class has

XmlObject xmlObject;

public XmlObject getXmlObject() {
// snip...
}
public void setXmlObject(XmlObject xmlObject) {
// snip...
}

Suppose i am dealing with a XML with a structure such as
<TopLevel>
  <SecondLevel>
    <ThirdLevel>
  <SecondLevelMore>
    <ThirdLevel>
       
Let us assume my schema based XmlObject classes will have the same names
as node names. So TopLevel *is a* XmlObject.

I want to set values from a HTML form using a OGNL expression....

xmlObject.secondLevel.thirdLevel
xmlObject.secondLevelMore.thirdLevel

Obviously, OGNL runtime cannot find setSecondLevel() on xmlObject unless
it has a way of casting it to *TopLevel*

I have been researching a solution to this problem for a long time.,, I
found something on TypeConvertors, havent tried it yet and honestly not
able to tell if it is a solution to my problem :-)

Can someone help me with this? Am i asking for too much or is this
actually possible?? If it *is* possible, will it execute with
reasonable performance?

Any response will be greatly appreciated so that i can atleast take an
alternative approach immediately.


regards

ajaneesh




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

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


Oops! Please ignore my earlier mail. It is working fine, I goofed up
too early without looking at the error messages in detail!!

The logic that I mentioned below *is* indeed working as expected without
me having to do any kind of casting or coersion.

warm regards
ajaneesh

-----Original Message-----
From: Ajaneesh Rajashekharaiah [mailto:ajaneesh@(protected)]
Sent: Friday, July 04, 2008 8:51 PM
To: user@(protected)
Subject: Type Casting through OGNL expressions.


Hi,

I want to do the following, would like to understand if it is possible
at all before proceeding any further.

basically i am working on generating dynamic screens based on Apache
XmlBeans generated classes.

While the following is not exactly what i am doing, it will help drive
the idea home...

i have a number of XSD files for which i generate XmlBeans binding
files. All these classes are basically of type XmlObject.
Understandably, each class would have diffferent setters and getters
based on the XSD. In my action class, i want to declare a property with
just the underlying interface (i.e. XmlObject). I am in a position to
generate the dynamic screen based on the XML schema... but how do i
populate those back to my XmlObject property?

for e.g. Action class has

XmlObject xmlObject;

public XmlObject getXmlObject() {
// snip...
}
public void setXmlObject(XmlObject xmlObject) { // snip...
}

Suppose i am dealing with a XML with a structure such as <TopLevel>
  <SecondLevel>
    <ThirdLevel>
  <SecondLevelMore>
    <ThirdLevel>
       
Let us assume my schema based XmlObject classes will have the same names
as node names. So TopLevel *is a* XmlObject.

I want to set values from a HTML form using a OGNL expression....

xmlObject.secondLevel.thirdLevel
xmlObject.secondLevelMore.thirdLevel

Obviously, OGNL runtime cannot find setSecondLevel() on xmlObject unless
it has a way of casting it to *TopLevel*

I have been researching a solution to this problem for a long time.,, I
found something on TypeConvertors, havent tried it yet and honestly not
able to tell if it is a solution to my problem :-)

Can someone help me with this? Am i asking for too much or is this
actually possible?? If it *is* possible, will it execute with
reasonable performance?

Any response will be greatly appreciated so that i can atleast take an
alternative approach immediately.


regards

ajaneesh




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

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.techmahind
ra.com/Disclaimer.html</a> externally and <a
href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahind
ra.com/Disclaimer.html</a> internally within Tech Mahindra.

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

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

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_188505.ezm (zipped)
I found the problem and it does not involve Struts 2.   We changed
our SQL Server 2005 Text columns to varcharmax. For Java to properly
read the characters out of the DB we had to use rs.getCharacterStream.

Thank you for your help.


On Thu, Jul 3, 2008 at 5:01 PM, Laurie Harper <laurie@(protected):
> Richard Sayre wrote:
>>
>> I have a form containing text areas. When I copy a bunch of character
>> data such as:
>> 2öÂnJ1ÈÏúÄp8éÎdìåmðh4uæEÍÉieÔWán2ÅìbØÉÅÀ1JÎZÏôsC5LòÚAPúÜaÃÙPC5üÆCJWCOzùÙtÒQqùét
>>
>> into the text are, it displays normally. When I save the data, the
>> database stores the characters properly, when the data returns to the
>> s:textarea I displays with ?? replacing some characters.
>>
>> I can't figure out where this is happening. When I write the data out
>> to the page as text it all displays properly. When I initially paste
>> it into the textarea it displays correctly, so my browser supports the
>> character set (ISO-8859-1 or Latin-1). It's only when it comes from
>> the database to the textarea that the characters do not display. And
>> I verified that the database can handle the characters and that they
>> are stored correctly.
>>
>> This causes a problem when the user saves the second time, the ? get
>> saved in the db as ?.
>>
>> Any ideas as to what is happening or how to fix it?
>>
>> Thank you,
>>
>> Rich
>
> - Are the characters retrieved from the database correctly? (i.e. if you
> check the data you're sending to the textarea, is it right?)
>
> - What character encoding are you using to serve the page?
>
> - Do you have a @page directive in the JSP specifying the correct character
> encoding?
>
> - Do you have a meta-equiv element in your HTML <head> area to tell the
> browser what encoding the page is in?
>
> - I assume you are using Struts :-) What version?
>
> L.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188507.ezm (zipped)
Well, then I'd just use the ScopeInterceptor [1] to transfer arbitraty
action properties from one action to another via the session. Works
like a charm.

Cheers,
-Ralf

[1] http://struts.apache.org/2.1.2/struts2-core/apidocs/org/apache/struts2/interceptor/ScopeInterceptor.html

On Tue, Jun 24, 2008 at 4:39 PM, Lukasz Lenart
<lukasz.lenart@(protected):
>> You could try using an OGNL expression that references #session (like ${#session.foo}) but I don't know if that'll work. After trying it, it'd be nice if you reported back and/or added it to wiki (if it worked).
>
> It will not work, I've been trying. There is a bug in
> StaticParametersInterceptor, it will try to first put param on stack
> (and for above example, it will throw an exception) and then it will
> try to parse it.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188508.ezm (zipped)
Hi all,

I have a problem mapping my form bean to a jsp that contains javascript
to add html inputs dynamically.

I already found out that i can use BeanUtils to add the input values to
an ArrayList like this

public void setProperty(int iIndex, String inputString) {
  this.propertyList.add(inputString);
}


The Problem is that there should be the chance to add whole groups of
inputs dynamically. Inside these groups single inputs also should be
reproducible. So i would have something like that in my DOM afterwards:

<input type="text" name="teachtarget[0].name" />
<textarea name="teachtarget[0].description" rows="5" cols="10"></textarea>
<select name="teachtarget[0].priority">
  <option>hoch</option>
  <option>mittel</option>
  <option>niedrig</option>
</select>
<input type="text" name="teachtarget[0].abilities_0" />
<input type="text" name="teachtarget[0].abilities_1" />
<input type="text" name="teachtarget[0].abilities_2" />

<input type="text" name="teachtarget[1].name" /></div>
<textarea name="teachtarget[1].description" rows="5" cols="10"></textarea>
<select name="teachtarget[1].priority">
  <option>hoch</option>
  <option>mittel</option>
  <option>niedrig</option>
</select>
<input type="text" name="teachtarget[1].abilities_0" />
<input type="text" name="teachtarget[1].abilities_1" />
<input type="text" name="teachtarget[1].abilities_2" />


I thought about putting several LabelValueBeans or LazyDynaBeans to an
ArrayList named teachtarget.


When i use

public void setTeachtarget(int index, LabelValueBean teachtargetProperty) {
  this.teachtarget.add(teachtargetProperty);
}


as the set method and than try to read the list, I always receive an
empty list.

I'm wondering if I'm on the right way, I don't have an idea if this
should work or not.

If someone has any other ideas to work with two dimensional arrays (or
lists of LabelValueBeans) containing values of inputs that have been
created by javascript I would really appreciate it...
Thanks for help!

Erik

Attachment: user_188509.ezm (zipped)

Hi Guys,

I'm having a problem when trying to use JasperReport plugin in a linux
machine. I'm getting root cause

java.lang.InternalError: Can't connect to X11 window server using
'localhost:0.0' as the value of the DISPLAY variable.
 sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
 sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
 sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
 java.security.AccessController.doPrivileged(Native Method)
 sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
 java.lang.Class.forName0(Native Method)
 java.lang.Class.forName (Class.java:169)

java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment (GraphicsEnvironment.java:68)

net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv (JRGraphEnvInitializer.java:58)
 net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:363)

net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)

net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:59)
 net.sf.jasperreports.engine.fill.JRFiller.createFiller (JRFiller.java:147)
 net.sf.jasperreports.engine.fill.JRFiller.fillReport (JRFiller.java:83)

net.sf.jasperreports.engine.JasperFillManager.fillReport (JasperFillManager.java:601)

org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:240)

org.apache.struts2.dispatcher.StrutsResultSupport.execute (StrutsResultSupport.java:178)


Does anybody knows this problem or even have a clue to follow?

Cheers,

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


Attachment: user_188510.ezm (zipped)
System property java.awt.headless needs to be set to true.  (-Djava.awt.headless=true in the startup for whichever container you're using)

PK


Felipe Rodrigues wrote:
Hi Guys,

I'm having a problem when trying to use JasperReport plugin in a linux
machine. I'm getting root cause

java.lang.InternalError: Can't connect to X11 window server using
'localhost:0.0' as the value of the DISPLAY variable.
	sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
	sun.awt.X11GraphicsEnvironment.access$100(X11GraphicsEnvironment.java:52)
	sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:155)
	java.security.AccessController.doPrivileged(Native Method)
	sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:131)
	java.lang.Class.forName0(Native Method)
	java.lang.Class.forName(Class.java:169)

java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68)

net.sf.jasperreports.engine.util.JRGraphEnvInitializer.initializeGraphEnv(JRGraphEnvInitializer.java:58)
	net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:363)

net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:77)

net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:59)
	net.sf.jasperreports.engine.fill.JRFiller.createFiller(JRFiller.java:147)
	net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:83)

net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:601)

org.apache.struts2.views.jasperreports.JasperReportsResult.doExecute(JasperReportsResult.java:240)

org.apache.struts2.dispatcher.StrutsResultSupport.execute(StrutsResultSupport.java:178)


Does anybody knows this problem or even have a clue to follow?

Cheers,

Felipe
  


--
[Fwd: test]

 

Patrick Kobly, CISSP

 

T: 403-274-9033

C: 403-463-6141

F: 866-786-9459

56 388 Sandarac Dr NW
Calgary, Alberta
T3K 4E3
http://www.kobly.com

 


Attachment: cid:part1.07040008.04090805@kobly.com


Attachment: patrick.vcf (zipped)
Attachment: signature.asc (zipped)
Attachment: user_188511.ezm (zipped)
Thanks Timothy and Jeromy for your answers. I tried your suggestions but
they are not working.

Basically, I changed the fielderror.ftl by removing the list tags in it and
then saved it to /WEB-INF/classes/template/ folder. Struts2 doesn't look at
the new fielderror.ftl so the error message is still be rendered as a list
item. The same thing if the ftl is put in /WEB-INF/tempalte/ folder. Since
the theme I am using is simple, so no theme.properties file.

I guess the issue is still related to the location. Has anyone customized
templates before?

Thanks.


On Thu, Jul 3, 2008 at 10:30 PM, Jeromy Evans <
jeromy.evans@(protected):

> Timothy Wonil Lee wrote:
>
>> I believe the default value is WEB-INF/template, but I may be wrong.
>>
>>
> Almost, the default is in the *classpath* at /template
> So that should read WEB-INF/classes/template
>
> Also, don't forget the theme.properties file.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

Attachment: user_188513.ezm (zipped)
I tried the samething before but met no success as well. It would be great if we could call a field error as follows that generate no html mark-up
<s:fielderror theme="simple">
         <s:param>field1</s:param>
</s:fielderror>
I tried to print the error message right beside each input field. However;  the html generated mark-up moves the error line to the next line (single line is displayed as a list).


----- Original Message ----
From: "lei.java@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Saturday, July 5, 2008 5:29:24 PM
Subject: Re: Where to put customized template

Thanks Timothy and Jeromy for your answers. I tried your suggestions but
they are not working.

Basically, I changed the fielderror.ftl by removing the list tags in it and
then saved it to /WEB-INF/classes/template/ folder. Struts2 doesn't look at
the new fielderror.ftl so the error message is still be rendered as a list
item. The same thing if the ftl is put in /WEB-INF/tempalte/ folder. Since
the theme I am using is simple, so no theme.properties file.

I guess the issue is still related to the location. Has anyone customized
templates before?

Thanks.


On Thu, Jul 3, 2008 at 10:30 PM, Jeromy Evans <
jeromy.evans@(protected):

> Timothy Wonil Lee wrote:
>
>> I believe the default value is WEB-INF/template, but I may be wrong.
>>
>>
> Almost, the default is in the *classpath* at /template
> So that should read WEB-INF/classes/template
>
> Also, don't forget the theme.properties file.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>



   __________________________________________________________________
Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php


Attachment: user_188514.ezm (zipped)

Its is not /WEB-INF/template. Its /template under your web root.

so its /template/[theme name]/file.ftl



Struts Two wrote:
>
> I tried the samething before but met no success as well. It would be great
> if we could call a field error as follows that generate no html mark-up
> <s:fielderror theme="simple">
>       <s:param>field1</s:param>
> </s:fielderror>
> I tried to print the error message right beside each input field. However;
> the html generated mark-up moves the error line to the next line (single
> line is displayed as a list).
>
>
> ----- Original Message ----
> From: "lei.java@(protected)>
> To: Struts Users Mailing List <user@(protected)>
> Sent: Saturday, July 5, 2008 5:29:24 PM
> Subject: Re: Where to put customized template
>
> Thanks Timothy and Jeromy for your answers. I tried your suggestions but
> they are not working.
>
> Basically, I changed the fielderror.ftl by removing the list tags in it
> and
> then saved it to /WEB-INF/classes/template/ folder. Struts2 doesn't look
> at
> the new fielderror.ftl so the error message is still be rendered as a list
> item. The same thing if the ftl is put in /WEB-INF/tempalte/ folder. Since
> the theme I am using is simple, so no theme.properties file.
>
> I guess the issue is still related to the location. Has anyone customized
> templates before?
>
> Thanks.
>
>
> On Thu, Jul 3, 2008 at 10:30 PM, Jeromy Evans <
> jeromy.evans@(protected):
>
>> Timothy Wonil Lee wrote:
>>
>>> I believe the default value is WEB-INF/template, but I may be wrong.
>>>
>>>
>> Almost, the default is in the *classpath* at /template
>> So that should read WEB-INF/classes/template
>>
>> Also, don't forget the theme.properties file.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>> For additional commands, e-mail: user-help@(protected)
>>
>>
>
>
>
>     __________________________________________________________________
> Connect with friends from any web browser - no download required. Try the
> new Yahoo! Canada Messenger for the Web BETA at
> http://ca.messenger.yahoo.com/webmessengerpromo.php
>
>
> ---------------------------------------------------------------------
> 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_188512.ezm (zipped)

<s:iterator value="fruits">
<%
Calendar cal = Calendar.getInstance();
cal.setTime(new Date());
int monthNow = cal.get(Calendar.MONTH);
cal.setTime(date); //fruit.getDate()
int monthFruit = cal.get(Calendar.MONTH);
if(monthNow == monthFruit){
%>
delete delete
<%}%>
</s:iterator>

If you don't like the script in the page then you can create a public method
on fruit called getExpired. fruit.getExpired() does the same calendar work
as above based on the internal date value and the current date and returns a
boolen. In that case:

<s:iterator value="fruits">
 <s:if test="expired">
     delete delete
  </s:if?
</s:iterator>

Depending on how you are doing persistance (JPA on getters/fields/whatever)
you may have to mark this getter as transient....


Milan Milanovic wrote:
>
> Hi,
>
> I have a list of Fruit's of type class Fruit { String name; Date date; },
> and I show those fruits using iterator in my .jsp, like this: <s:iterator
> value="fruits"> ... </s:iterator>. Well I need to show some options (e.g.,
> delete fruit) to user if fruit's date is in the current month, how can I
> check this in my .jsp (inside iterator tag) ?
>
> --
> Thx in advance, Milan Milanovic
>

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


Attachment: user_188515.ezm (zipped)

Do you really want them in separate packages or do you just want them in
separate directories. It seems to me that you are looking for a particular
organization of files during development, so you can keep all the like files
together. Seems reasonable enough. If that is the case then you can create
a series of "src" directories that mirror the classpath but only hold
particular files.

So,

src/main/java/actions/se/intranet/apps/actions/myAction.java
src/main/java/properties/se/intranet/apps/actions/myAction.properties
src/main/java/validation/se/intranet/apps/actions/myAction-validation.xml

They all have the same packages and classpath, but they are organized how
you think of them.  I think....or you think....or I think you think....



Dallas wrote:
>
> Hi all!
>
> I´m wondering if there´s any way of configuring struts2 to allow
> me to keep actions, properties and validation in separate packages?
>
> At the moment I have one packages, se.intranet.apps which includes
> all my actions, properties and validations.
>
> I´d rather keep them in separate packages, like
> se.intranet.apps.actions
> se.intranet.apps.properties
> se.intranet.apps.validation
>
> Any idea on how to do this?
> I´ve tried reading up on localazation, but looking at
> http://struts.apache.org/2.0.6/docs/localization.html the documentation
> it doesn´t look possible...
>

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


Attachment: user_188516.ezm (zipped)

The only syntax difference I see is you should put #stat.index rather than
stat.index so it looks like

<s:textarea name="descList[%{#stat.index}].destination"
value="%{destination}" /&gt;


I am assuming you have the proper setter for setDescList(List<Text>
descList) in your action.

BGE Ger wrote:
>
> Hi Laurie, thank you for help!
>
> you are right that's what I want: to push back the updated fields into the
> list.
> And then I want access the updated fields in the update action class .
> I think maybe there is somesthing wrong in my tag syntax? I found out that
> I
> must use "{}" instead of "[]" which is only for maps, but it also doesn't
> work.
>
> I try this example but it doesn't work:
> http://www.vitarara.org/cms/struts_2_cookbook/updating_a_list_of_domain_entities
>
> Is there any other example anywhere, which I've not found?
>
>
> I'm really desperate! What I want is not unusual, I've thought.
> This must work til tomorrow (for my company) :-((
>
> Thank you very much for helping!
>
>
>
>
> Laurie Harper wrote:
>>
>> I'm not sure what you mean by a 'submit in each row' but if you want to
>> push data back into the list then yes, you need the index in the input's
>> name as you have.
>>
>> L.
>>
>> BGE Ger wrote:
>>> ....thank you for the answer!
>>> But I've read, if I want to change the complete list with the submit
>>> action. I must use the list index.
>>> If I make a submit in each row I can use "destination" syntax.
>>> Isn't it right?
>>>
>>>
>>> Jim Kiley wrote:
>>>> For starters, you can simplify things a lot by changing your syntax
>>>> from:
>>>>
>>>> name="descList[%{stat.index}].destination"
>>>>
>>>> to just:
>>>>
>>>> name="destination"
>>>>
>>>> The iterator tag pushes descList[index] onto the OGNL stack in every
>>>> iteration, so you can refer to its attributes directly.
>>>>
>>>> jk
>>>>
>>>> On Thu, Jul 3, 2008 at 8:55 AM, BGE Ger <bg@(protected):
>>>>
>>>>> Hello,
>>>>> I'm struts(2) newbie and I need some help for the iterator tag.
>>>>> How can I access to an updated list in the action class?
>>>>> My JSP looks like:
>>>>>
>>>>> <s:form theme="simple">
>>>>>     <s:iterator  value="descList" status="stat">
>>>>>     <tr>
>>>>>     <td ><s:textarea name="descList[%{stat.index}].destination"
>>>>> value="%{destination}" /></td>
>>>>>     <td ><s:textarea name="descList[%{stat.index}].category"
>>>>> value="%{category}"   /></td>
>>>>>     <td ><s:textarea name="descrList[%{stat.index}].source"
>>>>> value="%{source}" /></td>
>>>>>     <td><s:textarea name="descList[%{stat.index}].text"
>>>>> value="%{text}"/></td>
>>>>>     </tr>
>>>>>     </s:iterator>
>>>>>     <s:submit action="updateDescriptions" />
>>>>> </s:form>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> Action class:
>>>>>
>>>>>
>>>>> public class DescriptionTestAction extends ActionSupport {
>>>>>
>>>>>  private List<Text> descList;
>>>>>
>>>>>  public DescriptionTestAction () {
>>>>>  }
>>>>>
>>>>>
>>>>>  public void setDescList(List descList) {
>>>>>       this.descList = descList;
>>>>>  }
>>>>>
>>>>>  public List getDescList () {
>>>>>      return this.descList;
>>>>>  }
>>>>>
>>>>> --------------------------------------------------
>>>>> The descList is a spring Bean and everything works well except the
>>>>> update
>>>>> process.
>>>>> If I make an update for the destination field e.g. and then submit
>>>>> this
>>>>> form
>>>>> the descList contains the old values! I've tried everything and spend
>>>>> lot
>>>>> of time for searching for a solution, please help!
>>>>> Thank you in advance!
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://www.nabble.com/Struts2-iterator-tag-tp18258667p18258667.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
>>>>
>>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> 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_188517.ezm (zipped)

Don't you just overwrite the existing session values (that were left behind
because the user didn't click exit) when the user returns to the page?

You can tell the browser not to cache the page with the http equiv header
tags.



Milan Milanovic wrote:
>
> O.K. Could you tell me very session data is stored ? I need to know this
> because when user came to one page I fill session object with some values
> (collections), and when he click "exit" link then I clear session
> contents, but he may click to some other link (to "exit") and then all
> objects in session will stay there until he came again to that page and
> when I resend data in his session.
>
> But, there is another problem which I've been talked about (but nobody
> anwsered :-(, is that when he cam again to my page, action class method is
> not fired at all, but whole page is called from some IE cache.
>
> --
> Thx, Milan
>
>
>
>
> Laurie Harper wrote:
>>
>> Milan Milanovic wrote:
>>> I have an SessionAware-based action class, where I put some variables
>>> into
>>> session when user came to the page which is backed up with that action
>>> class. I'm wondering what is validity of that session object, because
>>> I'm
>>> not sure if I have possibility to clear user session ? So I need to know
>>> when session will be deleted with all its objects inside ? When user go
>>> to
>>> some other page which is not backed-up with this class or some other
>>> action
>>> class ?
>>
>> I'm not sure I understand your question. The session you access through
>> SessionAware is the standard Servlet API session, which lasts for as
>> long as the user remains active in the application. If you want to store
>> data only until the next request, use request scope instead of session
>> scope.
>>
>> L.
>>
>>
>> ---------------------------------------------------------------------
>> 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.

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