Java Mailing List Archive

http://www.gg3721.com/

Home » Struts Users Mailing List »

user Digest 10 Jul 2008 17:58:47 -0000 Issue 8134

user-digest-help

2008-07-10


Author LoginPost Reply

user Digest 10 Jul 2008 17:58:47 -0000 Issue 8134

Topics (messages 188697 through 188719):

[OT] RE: RE: RE: RE: Re: [S2] Struts configuration vizualization
 188697 by: Dave Newton
 188699 by: Milan Milanovic
 188701 by: Dave Newton
 188704 by: Milan Milanovic
 188708 by: Dave Newton
 188712 by: Milan Milanovic
 188713 by: Dave Newton
 188715 by: Milan Milanovic
 188717 by: Dave Newton

Re: [S2] Struts configuration vizualization
 188698 by: Milan Milanovic
 188700 by: Milan Milanovic

Re: Struts-Tiles - Missing Content
 188702 by: Ryan Henson
 188703 by: Antonio Petrelli
 188719 by: Ryan Henson

Re: This is odd, sometimes my requests 'miss' the Struts2 filter
 188705 by: Lyallex
 188714 by: Alberto A. Flores

Re: Struts2.0 + Ajax based Implementation
 188706 by: AjaySrini

Browser compatability issue - <s:radio> in Struts2.0
 188707 by: AjaySrini

Re: Using xdoclet with ValidatorActionForm
 188709 by: Dimitris Mouchritsas

Re: looking for suggestion regarding interceptor
 188710 by: Chris Pratt
 188716 by: Gabriel Belingueres

Re: action performed twice when using ajax
 188711 by: xianwinwin

getting Session from one to another namespace - possible?
 188718 by: Michael Obster

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_188697.ezm (zipped)
--- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
> I put this in my classpath:
>
> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib\commons-logging-1.0.4.jar;
>
> and I run sitegraph from my lib folder:
>
> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib>java
> -cp ... -jar struts2-sitegraph-plugin-2.0.11.1.jar -config ../src/java
> -views ../../pages -output shema
>
> and I get this exception:
>
> Exception in thread "main"
> java.lang.NoClassDefFoundError:
> org/apache/commons/logging/LogFactory
>      at
> org.apache.struts2.sitegraph.SiteGraph.<clinit>(SiteGraph.java:51)
>
> What is the problem here ?

You have a single jar in your classpath. It seems unlikely, at best, that this single jar contains all the dependencies for running sitegraph.

I'm also not sure what "-cp ..." will do; I'm only familiar with that notation in regards to enabling/disabling assertions in sub-packages--what is your intention with that line argument value? I'm also reasonably sure that using the "-cp" argument will override the CLASSPATH environment variable.

Dave


Attachment: user_188699.ezm (zipped)

Dear Dave,

this is how it is given at SiteGraph page:

java -cp ... -jar struts2-sitegraph-plugin-x.x.x.jar
  -config CONFIG_DIR
  -views VIEWS_DIRS
  -output OUTPUT
  [-ns NAMESPACE]


--
Milan

newton.dave wrote:
>
> --- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
>> I put this in my classpath:
>>
>> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib\commons-logging-1.0.4.jar;
>>
>> and I run sitegraph from my lib folder:
>>
>> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib>java
>> -cp ... -jar struts2-sitegraph-plugin-2.0.11.1.jar -config ../src/java
>> -views ../../pages -output shema
>>
>> and I get this exception:
>>
>> Exception in thread "main"
>> java.lang.NoClassDefFoundError:
>> org/apache/commons/logging/LogFactory
>>      at
>> org.apache.struts2.sitegraph.SiteGraph.<clinit>(SiteGraph.java:51)
>>
>> What is the problem here ?
>
> You have a single jar in your classpath. It seems unlikely, at best, that
> this single jar contains all the dependencies for running sitegraph.
>
> I'm also not sure what "-cp ..." will do; I'm only familiar with that
> notation in regards to enabling/disabling assertions in sub-packages--what
> is your intention with that line argument value? I'm also reasonably sure
> that using the "-cp" argument will override the CLASSPATH environment
> variable.
>
> Dave
>
>
> ---------------------------------------------------------------------
> 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_188701.ezm (zipped)
--- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
> this is how it is given at SiteGraph page:
>
> java -cp ... -jar struts2-sitegraph-plugin-x.x.x.jar
>    -config CONFIG_DIR
>    -views VIEWS_DIRS
>    -output OUTPUT
>    [-ns NAMESPACE]

So... you didn't use "x.x.x", and you didn't add "[-ns NAMESPACE]", which are obviously placeholders. So is the "...". It should be replaced with (a) nothing, removing the -cp, and rely on the CLASSPATH environment variable, (b) use -cp and use the CLASSPATH as -cp's argument, or (c) put all the required libraries as -cp arguments (not recommended; too much work).

As I said before: using -cp will cause your classpath environment variable to be ignored (IIRC, I could be wrong about that, but avoiding the confusion is easy. Or so I thought.)

Apparently the large red box on the SiteGraph plugin page [1] containing the following text remains unnoticed:

"You must either supply the correct classpath when invoking the SiteGraph tool or place the Sitegraph plugin in the same directory as the dependent jars. Specifically, the XWork jar, Struts jar, and their dependencies must be included in the classpath. Futhermore, you must also include your Action class files referenced in struts.xml. Without the proper class path entries, SiteGraph will not function properly."

PUT ***ALL*** THE REQUIRED JARS IN YOUR CLASSPATH. I don't know what else to tell you or how else to say it so you'll understand.

(You've installed GraphViz, right?)

Good luck,
Dave

[1] http://struts.apache.org/2.x/docs/sitegraph-plugin.html


Attachment: user_188704.ezm (zipped)

Dear Dave,


newton.dave wrote:
>
> So... you didn't use "x.x.x", and you didn't add "[-ns NAMESPACE]", which
> are obviously placeholders. So is the "...". It should be replaced with
> (a) nothing, removing the -cp, and rely on the CLASSPATH environment
> variable, (b) use -cp and use the CLASSPATH as -cp's argument, or (c) put
> all the required libraries as -cp arguments (not recommended; too much
> work).
>
> As I said before: using -cp will cause your classpath environment variable
> to be ignored (IIRC, I could be wrong about that, but avoiding the
> confusion is easy. Or so I thought.)
>

As I wrote above in the thread I removed -cp and I'm just using my System
environment CLASSPATH variable.


newton.dave wrote:
> Apparently the large red box on the SiteGraph plugin page [1] containing
> the following text remains unnoticed:
>
> "You must either supply the correct classpath when invoking the SiteGraph
> tool or place the Sitegraph plugin in the same directory as the dependent
> jars. Specifically, the XWork jar, Struts jar, and their dependencies must
> be included in the classpath. Futhermore, you must also include your
> Action class files referenced in struts.xml. Without the proper class path
> entries, SiteGraph will not function properly."
>
> PUT ***ALL*** THE REQUIRED JARS IN YOUR CLASSPATH. I don't know what else
> to tell you or how else to say it so you'll understand.
>
> (You've installed GraphViz, right?)
>
>

I noticed this, but my Sitegraph plugin in the same directory as the
dependent jars so I don't need to put them into classpath ?

Yes, I installed GrahViz and I have its .exe in PATH variable.

--
Milan



newton.dave wrote:
>
> --- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
>> this is how it is given at SiteGraph page:
>>
>> java -cp ... -jar struts2-sitegraph-plugin-x.x.x.jar
>>    -config CONFIG_DIR
>>    -views VIEWS_DIRS
>>    -output OUTPUT
>>    [-ns NAMESPACE]
>
> So... you didn't use "x.x.x", and you didn't add "[-ns NAMESPACE]", which
> are obviously placeholders. So is the "...". It should be replaced with
> (a) nothing, removing the -cp, and rely on the CLASSPATH environment
> variable, (b) use -cp and use the CLASSPATH as -cp's argument, or (c) put
> all the required libraries as -cp arguments (not recommended; too much
> work).
>
> As I said before: using -cp will cause your classpath environment variable
> to be ignored (IIRC, I could be wrong about that, but avoiding the
> confusion is easy. Or so I thought.)
>
> Apparently the large red box on the SiteGraph plugin page [1] containing
> the following text remains unnoticed:
>
> "You must either supply the correct classpath when invoking the SiteGraph
> tool or place the Sitegraph plugin in the same directory as the dependent
> jars. Specifically, the XWork jar, Struts jar, and their dependencies must
> be included in the classpath. Futhermore, you must also include your
> Action class files referenced in struts.xml. Without the proper class path
> entries, SiteGraph will not function properly."
>
> PUT ***ALL*** THE REQUIRED JARS IN YOUR CLASSPATH. I don't know what else
> to tell you or how else to say it so you'll understand.
>
> (You've installed GraphViz, right?)
>
> Good luck,
> Dave
>
> [1] http://struts.apache.org/2.x/docs/sitegraph-plugin.html
>
>
> ---------------------------------------------------------------------
> 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_188708.ezm (zipped)
--- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
> I noticed this, but my Sitegraph plugin in the same
> directory as the dependent jars so I don't need to
> put them into classpath?

Oh, it looks like the sitegraph plugin puts its requirements in its manifest file, so never mind about all that classpath stuff. Remove the -cp option altogether.

(I'm not sure the -cp option is valid with a -jar option anyway, actually.)

Are you using the appropriate versions of the required libraries? The "Class-Path" entry in the sitegraph plugin lists all possible dependencies (jar files with version numbers).

Which version of S2 are you using?

Dave


Attachment: user_188712.ezm (zipped)

Dear Dave,


newton.dave wrote:
>
> --- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
>> I noticed this, but my Sitegraph plugin in the same
>> directory as the dependent jars so I don't need to
>> put them into classpath?
>
> Oh, it looks like the sitegraph plugin puts its requirements in its
> manifest file, so never mind about all that classpath stuff. Remove the
> -cp option altogether.
>
> (I'm not sure the -cp option is valid with a -jar option anyway,
> actually.)
>

O.K.


newton.dave wrote:
>
> Are you using the appropriate versions of the required libraries? The
> "Class-Path" entry in the sitegraph plugin lists all possible dependencies
> (jar files with version numbers).
>

Oh, it uses commons-logging-1.0.3.jar but I'm using
commons-logging-1.0.4.jar in my applications lib directory. So, I need to
delete 1.0.4 and copy 1.0.3 in my lib ?


newton.dave wrote:
>
> Which version of S2 are you using?
>
> Dave
>

2.0.11.1

--
Thx, Milan


---------------------------------------------------------------------
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_188713.ezm (zipped)
--- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
> Oh, it uses commons-logging-1.0.3.jar but I'm using
> commons-logging-1.0.4.jar in my applications lib directory.
> So, I need to delete 1.0.4 and copy 1.0.3 in my lib ?

Wouldn't it have been quicker to try it?

If it can't find a file listed it will obviously fail--if the file isn't available it won't be able to contribute any classes to the classpath, no?

Dave


Attachment: user_188715.ezm (zipped)

Dear Dave,


newton.dave wrote:
>
> --- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):
>> Oh, it uses commons-logging-1.0.3.jar but I'm using
>> commons-logging-1.0.4.jar in my applications lib directory.
>> So, I need to delete 1.0.4 and copy 1.0.3 in my lib ?
>
> Wouldn't it have been quicker to try it?
>

Actually no, I would have to change some else libraries too, because I don't
use those versions :-(.


newton.dave wrote:
>
> If it can't find a file listed it will obviously fail--if the file isn't
> available it won't be able to contribute any classes to the classpath, no?
>

Quite right ;-). I give up, it's too complicated, when someone create
Eclipse plug-in, I'll use it...or maybe when I find time I'll create it ;-).

--
Thx anyway, Milan



newton.dave wrote:
>
> Dave
>
>
> ---------------------------------------------------------------------
> 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_188717.ezm (zipped)
You could always try modifying the manifest file and re-packaging; if that's the only version issue you're having it's unlikely that a ..n version issue would cause an issue. It could, though.

Dave


--- On Thu, 7/10/08, Milan Milanovic <milanmilanovich@(protected):

> From: Milan Milanovic <milanmilanovich@(protected)>
> Subject: Re: [OT] RE: RE: RE: RE: Re: [S2] Struts configuration vizualization
> To: user@(protected)
> Date: Thursday, July 10, 2008, 1:34 PM
> Dear Dave,
>
>
> newton.dave wrote:
> >
> > --- On Thu, 7/10/08, Milan Milanovic
> <milanmilanovich@(protected):
> >> Oh, it uses commons-logging-1.0.3.jar but I'm
> using
> >> commons-logging-1.0.4.jar in my applications lib
> directory.
> >> So, I need to delete 1.0.4 and copy 1.0.3 in my
> lib ?
> >
> > Wouldn't it have been quicker to try it?
> >
>
> Actually no, I would have to change some else libraries
> too, because I don't
> use those versions :-(.
>
>
> newton.dave wrote:
> >
> > If it can't find a file listed it will obviously
> fail--if the file isn't
> > available it won't be able to contribute any
> classes to the classpath, no?
> >
>
> Quite right ;-). I give up, it's too complicated, when
> someone create
> Eclipse plug-in, I'll use it...or maybe when I find
> time I'll create it ;-).
>
> --
> Thx anyway, Milan
>
>
>
> newton.dave wrote:
> >
> > Dave
> >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> user-unsubscribe@(protected)
> > For additional commands, e-mail:
> user-help@(protected)
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18388059.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_188698.ezm (zipped)

When I write echo %CLASSPATH% in my command prompt I get this:

and I get this exception:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/commons/lo
gging/LogFactory
    at
org.apache.struts2.sitegraph.SiteGraph.<clinit>(SiteGraph.java:51)

When I write echo %CLASSPATH% in my command prompt I get this:

%CLASSPATH%;C:\Documents and
Settings\Administrator\Desktop\Projects\db-derby-10.
2.2.0-bin\lib\derby.jar;C:\Documents and
Settings\Administrator\Desktop\Projects\
db-derby-10.2.2.0-bin\lib\derbytools.jar;c:\java;c:\java\backport-util-concurren
t.jar;C:\Program
Files\Java\jre1.5.0_12\lib\ext\QTJava.zip;C:\eclipse\workspace\
myProject\WebContent\WEB-INF\lib\commons-logging-1.0.4.jar;C:\eclipse\worksp
ace\myProject\build;

commons-logging is obviously enlisted here, so what is the problem ?

--
Milan


Gabriel Belingueres-2 wrote:
>
> You didn't unclude the most important part of all your command line:
> "java -cp ...."
>
> Obviously you failed to add the commons logging jar file to the classpath.
>
> Try: java -cp path/to/the/following/file/commons-logging-1.0.4.jar;...
> ......
>
> 2008/7/10 Milan Milanovic <milanmilanovich@(protected)>:
>>
>> Dear Dave,
>>
>> I put this in my classpath:
>>
>> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib\commons-logging-1.0.4.jar;
>>
>> and I run sitegraph from my lib folder:
>>
>> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib>java -cp ... -jar
>> stru
>> ts2-sitegraph-plugin-2.0.11.1.jar -config ../src/java -views ../../pages
>> -output
>> shema
>>
>> and I get this exception:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/commons/lo
>> gging/LogFactory
>>     at
>> org.apache.struts2.sitegraph.SiteGraph.<clinit>(SiteGraph.java:51)
>>
>> What is the problem here ?
>>
>> --
>> Thx, Milan
>>
>>
>>
>>
>> newton.dave wrote:
>>>
>>> That's not how classpaths work: as I said, jar files must be listed
>>> individually. This is most easily done programmatically in a shell
>>> script
>>> (or batch file*s*; thanks Windows :(
>>>
>>> *Class* files need only the top-level directory listed--usually a build
>>> output directory.
>>>
>>> Dave
>>>
>>> Milan Milanovic wrote:
>>>> Hi,
>>>> newton.dave wrote:
>>>>>
>>>>> Driving. In an automobile. To get from one place to another.
>>>>>
>>>>>
>>>> Oh that, sorry ;-). You are anwsering to the list while driving, WOW
>>>> :-).
>>>> newton.dave wrote:
>>>>>
>>>>> Java 101 just means really basic Java: if you put all the libraries in
>>>>> your lib directory that'd probably be enough (plus your build
>>>>> directory,
>>>>> I
>>>>> think somebody else mentioned).
>>>>>
>>>> All of my libs are in my lib directory, and I put CLASSPATH variable to
>>>> that
>>>> directory and still I got that error with LogManager.
>>>> --
>>>> Milan
>>>> newton.dave wrote:
>>>>>
>>>>> Milan Milanovic wrote:
>>>>>> You are driving ? Java 101 ? I must say I don't understand you :-(.
>>>>>> I now how to define classpath, but there is a lot of things to
>>>>>> configure
>>>>>> for
>>>>>> this SiteGraph plugin, so I'm asking if anyone have an example ?
>>>>>> --
>>>>>> Milan
>>>>>> newton.dave wrote:
>>>>>>>
>>>>>>> No, I'm driving. This is Java 101, so any Java tutorial should be
>>>>>>> able
>>>>>>> to
>>>>>>> point you in the right direction.
>>>>>>>
>>>>>>> Dave
>>>>>>>
>>>>>>>
>>>>>>> Milan Milanovic wrote:
>>>>>>>> Could you please give me an example ?
>>>>>>>> --
>>>>>>>> Milan
>>>>>>>> newton.dave wrote:
>>>>>>>>>
>>>>>>>>> No, it means you should include the directory *containing* the
>>>>>>>>> compiled
>>>>>>>>> class files. Jar files must be listed individually (trivial under
>>>>>>>>> Unix-like environments, nearly under Windows--set your classpath
>>>>>>>>> or
>>>>>>>>> do
>>>>>>>>> it
>>>>>>>>> from a shell/batch script; why would you do it by hand?!)
>>>>>>>>>
>>>>>>>>> Dave
>>>>>>>>>
>>>>>>>>> Milan Milanovic wrote:
>>>>>>>>>> Hi,
>>>>>>>>>> what this means: "Futhermore, you must also include your Action
>>>>>>>>>> class
>>>>>>>>>> files
>>>>>>>>>> referenced in struts.xml" ?
>>>>>>>>>> Does this mean that I should include in command line all of my
>>>>>>>>>> 100
>>>>>>>>>> action
>>>>>>>>>> classes ?
>>>>>>>>>> --
>>>>>>>>>> Thx, Milan
>>>>>>>>>> Musachy Barroso wrote:
>>>>>>>>>>>
>>>>>>>>>>> Or this:
>>>>>>>>>>>
>>>>>>>>>>> http://cwiki.apache.org/S2PLUGINS/sitegraph-plugin.html
>>>>>>>>>>>
>>>>>>>>>>> musachy
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Jul 9, 2008 at 8:08 AM, Don Brown
>>>>>>>>>>> <donald.brown@(protected)>
>>>>>>>>>>> wrote:
>>>>>>>>>>>> You can try the config browser plugin:
>>>>>>>>>>>>
>>>>>>>>>>>> http://struts.apache.org/2.x/docs/config-browser-plugin.html
>>>>>>>>>>>>
>>>>>>>>>>>> Don
>>>>>>>>>>>>
>>>>>>>>>>>> On Wed, Jul 9, 2008 at 2:04 AM, Milan Milanovic
>>>>>>>>>>>> <milanmilanovich@(protected):
>>>>>>>>>>>>>
>>>>>>>>>>>>> Hi,
>>>>>>>>>>>>>
>>>>>>>>>>>>> I'm wodering is there any Eclipse plug-in (or something
>>>>>>>>>>>>> similar)
>>>>>>>>>>>>> which
>>>>>>>>>>>>> will
>>>>>>>>>>>>> vizualize struts.xml configuration ?
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> Thx, Milan
>>>>>>>>>>>>> --
>>>>>>>>>>>>> View this message in context:
>>>>>>>>>>>>> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18342762.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)
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> "Hey you! Would you help me to carry the stone?" Pink Floyd
>>>>>>>>>>>
>>>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> View this message in context:
>>>>>>>>>> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18361832.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)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> ---------------------------------------------------------------------
>>>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>> View this message in context:
>>>>>>>> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18362620.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)
>>>>>>>
>>>>>>>
>>>>>>> ---------------------------------------------------------------------
>>>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>> --
>>>>>> View this message in context:
>>>>>> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18363044.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)
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>>>> For additional commands, e-mail: user-help@(protected)
>>>>>
>>>>>
>>>>>
>>>> --
>>>> View this message in context:
>>>> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18364578.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)
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@(protected)
>>> For additional commands, e-mail: user-help@(protected)
>>>
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/-S2--Struts-configuration-vizualization-tp18342762p18382932.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)
>>
>>
>
> ---------------------------------------------------------------------
> 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_188700.ezm (zipped)

Dear Lukasz,

Yes, Environment variable CLASSPATH, I wrote above what is content of the
variable.

java -cp is for setting classpath and it is given at Sitegraph page.

I tried just with "java -jar struts2-sitegraph-plugin-2.0.11.1.jar -config
../src/java...", but it is the same.

--
Milan


Lukasz Lenart wrote:
>
>> I put this in my classpath:
>>
>> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib\commons-logging-1.0.4.jar;
>>
>> and I run sitegraph from my lib folder:
>>
>> C:\eclipse\workspace\myProject\WebContent\WEB-INF\lib>java -cp ... -jar
>> stru
>> ts2-sitegraph-plugin-2.0.11.1.jar -config ../src/java -views ../../pages
>> -output
>> shema
>
> What you mean "classpath"? Environment's variable CLASSPATH?
> What it is: java -cp ...?
>
> If you add all your jar's to the CLASSPATH, omit -cp parameter, if you
> want to add additional jar's only for this process, add
> java -cp %CLASSPATH%;c:\path\to\my.jar
>
> if you start
> java - cp c:\path\to\my.jar
>
> it will overwrite the system CLASSPATH, java will not use them.
>
>
> Regards
> --
> Lukasz
> http://www.lenart.org.pl/
>
> ---------------------------------------------------------------------
> 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_188702.ezm (zipped)
I posted the resulting HTML code at the bottom of that last email. It would appear from my side that the <tiles:insert attribute="body" /> is not executing properly as <tiles:getAsString name="title" /> does actually produce the correct text.

My question is focused on why does HttpURLConnection not seem to work correctly with tiles:insert?



----- Original Message ----
From: Antonio Petrelli <antonio.petrelli@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, July 10, 2008 9:44:16 AM
Subject: Re: Struts-Tiles - Missing Content

2008/7/10 Ryan Henson <nwstraith@(protected)>:
> I will note that calling this definition works correctly when I just view it using a browser.

So I doubt it is a problem of Tiles. Can you see if the HTML is ok
just before you use it with iText?

Antonio

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


   

Attachment: user_188703.ezm (zipped)
2008/7/10 Ryan Henson <nwstraith@(protected)>:
> I posted the resulting HTML code at the bottom of that last email.

Whoops! Sorry I did not see it.

> It would appear from my side that the <tiles:insert attribute="body" /> is not executing properly as <tiles:getAsString name="title" /> does actually produce the correct text.

Now I see it, that's strange. I see that in your body JSP page there
is a <logic:present> tag surrounding everything. Can you try putting a
sample text before this tag to see if, at least, the page is called?

Antonio

Attachment: user_188719.ezm (zipped)
I put in the text as you suggested and it did indeed show the text from the body. So now the issue has moved to being that the data variable is not being found. Alright, that helped me find some more issues but we're not quite there yet.

The results from the body come back with ONLY "Hello from the body". The logic beyond that should return either the data or the text "I do not see your data", but NEITHER is returned. I do not see any errors in the console to help me with this either. The logic tag simply does not do its job.

Ideas Antonio? Thanks for your help btw, I really do appreciate it.

Excerpt from ReportAction
________________________________
  public ActionForward getCamperScheduleReport(ActionMapping mapping,
       ActionForm form, HttpServletRequest request,
       HttpServletResponse response) throws Exception {
    logger.info("I'm starting my report");
    DynaValidatorActionForm query = (DynaValidatorActionForm) form;
    QueryService service = new QueryService();
    ReportService service2 = new ReportService();
    Camp camp = (Camp) request.getSession().getAttribute("currentCamp");
    int currentCampID = camp.getCampID();

    String[] camperIDs;
    Report report = (Report) request.getAttribute("report");

    if (query.getString("selectedIDs").indexOf(",") > 0) {
       camperIDs = query.getString("selectedIDs").split(",");
    } else {
       camperIDs = new String[] { query.getString("selectedIDs") };
    }

    logger.info("I have the camper IDs which the first is: " + camperIDs[0]);
   
    report.setSelectedIDs(query.getString("selectedIDs"));
    request.setAttribute("report", report);

    request.setAttribute("campers", service.getCampers(currentCampID));
    request.setAttribute("periods", service.getPeriodList());
    if (camperIDs[0].length() > 0) {
       request.setAttribute("data", service2.getCamperScheduleReport(
            camperIDs, currentCampID));
       logger.info("I've set the data");
    }

    logger.info("All done what's next?");
    if (query.getString("print").equals("true")) {
       return mapping.findForward("camper.print");
    } else {
       return mapping.findForward("camper.view");
    }
  }
________________________________


Updated tools.report.camper.body.jsp
________________________________
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>
<%@(protected)"%>

Hello from the body

<logic:notPresent name="data">
I do not see your data
</logic:notPresent>

<logic:present name="data">
  <logic:iterate name="data" id="person" indexId="num">
    <logic:notEqual name="num" value="0">
       <c:if test="${num % 3 == 0}">
          <p class="pageBreak" />
       </c:if>
    </logic:notEqual>

    <h3>${person.firstName} ${person.middleInitial} ${person.lastName}</h3>
    <table class="sorted_list" cellpadding="2" cellspacing="0" width="100%">
       <tr>
          <td width="100">
          <table>
            <tr>
               <th>Age:</th>
               <td>${person.age}</td>
            </tr>
          </table>
          </td>
          <td width="100">
          <table>
            <tr>
               <th>Rank:</th>
               <td>${person.rank}</td>
            </tr>
          </table>
          </td>
          <td width="100">
          <table>
            <tr>
               <th>Troop:</th>
               <td>${person.troopName}</td>
            </tr>
          </table>
          </td>
       </tr>
    </table>

    <logic:greaterThan name="person" property="classCount" value="0">

       <table class="sorted_list" cellpadding="2" cellspacing="0" width="100%">
          <tr>
            <th>Period</th>
            <th>ClassName</th>
            <th>Instructor</th>
            <th>Location</th>
            <th>Area</th>
            <th>Special Requirements</th>
          </tr>
          <logic:iterate name="periods" id="period">
            <tr>
               <td width="30">${period.periodName}</td>
               <logic:iterate name="person" property="enrollment" id="course">
                  <logic:equal name="course" property="periodID"
                    value="${period.periodID}">
                    <td>${course.className}</td>
                    <td>${course.instructorFirstName} ${course.instructorLastName}</td>
                    <td>${course.locationName}</td>
                    <td>${course.areaName}</td>
                    <td>${course.specialRequirements}</td>
                  </logic:equal>
               </logic:iterate>
            </tr>
          </logic:iterate>
       </table>
    </logic:greaterThan>
    <logic:equal name="person" property="classCount" value="0">
       The camper is not enrolled in any classes
    </logic:equal>

  </logic:iterate>
</logic:present>
________________________________




----- Original Message ----
From: Antonio Petrelli <antonio.petrelli@(protected)>
To: Struts Users Mailing List <user@(protected)>
Sent: Thursday, July 10, 2008 10:34:31 AM
Subject: Re: Struts-Tiles - Missing Content

2008/7/10 Ryan Henson <nwstraith@(protected)>:
> I posted the resulting HTML code at the bottom of that last email.

Whoops! Sorry I did not see it.

> It would appear from my side that the <tiles:insert attribute="body" /> is not executing properly as <tiles:getAsString name="title" /> does actually produce the correct text.

Now I see it, that's strange. I see that in your body JSP page there
is a <logic:present> tag surrounding everything. Can you try putting a
sample text before this tag to see if, at least, the page is called?

Antonio

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


   

Attachment: user_188705.ezm (zipped)
OK, I think I've twigged this now

Every jsp page has this include

<jsp:include page="header.jsp"></jsp:include>

recently I have included this in header.jsp (I'm messing around with
Struts2 i18n)

<%@(protected)" %>
...
<span class='header'><s:text name="header.welcome"/></span>

If I go back to this config in web.xml ..

<filter-mapping>
 <filter-name>struts2</filter-name>
 <url-pattern>/*</url-pattern>
</filter-mapping>

...

<welcome-file-list>
 <welcome-file>/welcome.jsp</welcome-file>
</welcome-file-list>

... when I access the site the welcome page with it's included header
loads fine.
So obviously the request is going through the filter.

If I then click the login link it all goes horribly wrong.
looking at the exception trace it appears that login.jsp which also
loads the header is where the problem lies
So, it appears that there is a forward going on (or at least a redirect)
somewhere when Tomcat sees that I am trying to access a protected resource
This makes sense as I'm trying to access a servlet (Login) but I
actually get a jsp (login.jsp)

according to http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd another
valid value for
<dispatcher> is INCLUDE so I tried this on it's own ... boom, it all
went wrong,
so it looks like the default behaviour for the filter mapping thing is REQUEST.
If you add any dispatcher then that seems to override the default config.

Distressingly (perhaps)

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

Doesn't do it, it has to be

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

phew, got there in the end

I'm still not entirely convinced I've got to the bottom of things as
I'm sure I had this working with the tags in the header
but without the <dispatcher> stuff ... then again it's been a long
week and I'm probably mistaken.

Anyway, whoever said there was a forward going on ... take a bow, you
were right and I was talking tosh

If it's true that this fix does indeed break in some versions of IE
then we are in a spot of bother with this.

Thanks for the input, it got me thinking.

Rgds

lyallex


On Thu, Jul 10, 2008 at 11:11 AM, Lyallex <lyallex@(protected):
> Hello
>
> Tomcat version 5.5.26
> Struts2 version 2.0.11.1
>
> I'm trying to understand why, given the following in web.xml requests
> sometimes 'miss out' the Struts2 filter
>
> <filter>
> <filter-name>struts2</filter-name>
> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
> </filter>
>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> </filter-mapping>
>
>
> It appears to really only be an issue with web.xml declarative security
>
> Reading around the various archives it appears that this is a know issue
> when trying to use Struts2 Actions as the target but I'm not trying to do that
> I just use a standard jsp.
>
> <odd>
>
> The really odd thing is that the login process works perfectly
> sometimes and sometimes it fails with the (apparently well known) message
>
> The Struts dispatcher cannot be found.
> This is usually caused by using Struts tags without the associated filter ...
>
> </odd>
>
> Here's the login config
>
> <login-config>
> <auth-method>FORM</auth-method>
> <realm-name>Form based authentication</realm-name>
> <form-login-config>
> <form-login-page>/login.jsp</form-login-page>
> <form-error-page>/login.jsp</form-error-page>
> </form-login-config>
> </login-config>
>
> Someone, somwhere on my journey through the archives suggested this fix.
>
> <filter-mapping>
> <filter-name>struts2</filter-name>
> <url-pattern>/*</url-pattern>
> <dispatcher>REQUEST</dispatcher>
> <dispatcher>FORWARD</dispatcher>
> </filter-mapping>
>
> It does appear to solve the problem I was just wondering why ?
>
> Is there a definitive resolution to this problem out there somewhere ?
>
> TIA
>
> lyallex
>

Attachment: user_188714.ezm (zipped)
You are correct, the default is REQUEST (if no dispatcher is specified).
Also, depending on your needs, consider using Spring Security. I was
finally able to add it to all my struts2 app without problems. J2EE
authentication has it's own limitations as you will continue to learn
and in these kind of cases (forwards, includes, etc) you'll have to
write your own code anyway (whereas with Spring or not). Please, excuse
me if it sounds like I try to evangelize Spring. I must admit that I had
written code with and without it and Spring makes you code a lot easier
to maintain, yet writing/configuring following specs (as it sounds like
you are doing) teaches you good lessons...

As a way of reference, the SRV.12.5.3 (from servlet spec 2.4) says that
in the form based authentication (as you said you are doing)...

"The login form associated with the security constraint is sent to the
client and the URL path triggering the authentication is stored by the
container"

The spec clearly doesn't specify whether a forward or a
response.redirect() is used. This means that it is up to the container
to decide how this is implemented. Depending on your portability
requirements, this may or may not be an issue (Tomcat vs Weblogic,
Resin, etc)...


Lyallex wrote:
> OK, I think I've twigged this now
>
> Every jsp page has this include
>
> <jsp:include page="header.jsp"></jsp:include>
>
> recently I have included this in header.jsp (I'm messing around with
> Struts2 i18n)
>
> <%@(protected)" %>
> ...
> <span class='header'><s:text name="header.welcome"/></span>
>
> If I go back to this config in web.xml ..
>
> <filter-mapping>
>   <filter-name>struts2</filter-name>
>   <url-pattern>/*</url-pattern>
> </filter-mapping>
>
> ...
>
> <welcome-file-list>
>   <welcome-file>/welcome.jsp</welcome-file>
> </welcome-file-list>
>
> ... when I access the site the welcome page with it's included header
> loads fine.
> So obviously the request is going through the filter.
>
> If I then click the login link it all goes horribly wrong.
> looking at the exception trace it appears that login.jsp which also
> loads the header is where the problem lies
> So, it appears that there is a forward going on (or at least a redirect)
> somewhere when Tomcat sees that I am trying to access a protected resource
> This makes sense as I'm trying to access a servlet (Login) but I
> actually get a jsp (login.jsp)
>
> according to http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd another
> valid value for
> <dispatcher> is INCLUDE so I tried this on it's own ... boom, it all
> went wrong,
> so it looks like the default behaviour for the filter mapping thing is REQUEST.
> If you add any dispatcher then that seems to override the default config.
>
> Distressingly (perhaps)
>
> <filter-mapping>
>   <filter-name>struts2</filter-name>
>   <url-pattern>/*</url-pattern>
>   <dispatcher>REQUEST</dispatcher>
>   <dispatcher>INCLUDE</dispatcher>
> </filter-mapping>
>
> Doesn't do it, it has to be
>
> <filter-mapping>
>   <filter-name>struts2</filter-name>
>   <url-pattern>/*</url-pattern>
>   <dispatcher>REQUEST</dispatcher>
>   <dispatcher>FORWARD</dispatcher>
> </filter-mapping>
>
> phew, got there in the end
>
> I'm still not entirely convinced I've got to the bottom of things as
> I'm sure I had this working with the tags in the header
> but without the <dispatcher> stuff ... then again it's been a long
> week and I'm probably mistaken.
>
> Anyway, whoever said there was a forward going on ... take a bow, you
> were right and I was talking tosh
>
> If it's true that this fix does indeed break in some versions of IE
> then we are in a spot of bother with this.
>
> Thanks for the input, it got me thinking.
>
> Rgds
>
> lyallex
>
>
> On Thu, Jul 10, 2008 at 11:11 AM, Lyallex <lyallex@(protected):
>> Hello
>>
>> Tomcat version 5.5.26
>> Struts2 version 2.0.11.1
>>
>> I'm trying to understand why, given the following in web.xml requests
>> sometimes 'miss out' the Struts2 filter
>>
>> <filter>
>> <filter-name>struts2</filter-name>
>> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
>> </filter>
>>
>> <filter-mapping>
>> <filter-name>struts2</filter-name>
>> <url-pattern>/*</url-pattern>
>> </filter-mapping>
>>
>>
>> It appears to really only be an issue with web.xml declarative security
>>
>> Reading around the various archives it appears that this is a know issue
>> when trying to use Struts2 Actions as the target but I'm not trying to do that
>> I just use a standard jsp.
>>
>> <odd>
>>
>> The really odd thing is that the login process works perfectly
>> sometimes and sometimes it fails with the (apparently well known) message
>>
>> The Struts dispatcher cannot be found.
>> This is usually caused by using Struts tags without the associated filter ...
>>
>> </odd>
>>
>> Here's the login config
>>
>> <login-config>
>> <auth-method>FORM</auth-method>
>> <realm-name>Form based authentication</realm-name>
>> <form-login-config>
>> <form-login-page>/login.jsp</form-login-page>
>> <form-error-page>/login.jsp</form-error-page>
>> </form-login-config>
>> </login-config>
>>
>> Someone, somwhere on my journey through the archives suggested this fix.
>>
>> <filter-mapping>
>> <filter-name>struts2</filter-name>
>> <url-pattern>/*</url-pattern>
>> <dispatcher>REQUEST</dispatcher>
>> <dispatcher>FORWARD</dispatcher>
>> </filter-mapping>
>>
>> It does appear to solve the problem I was just wondering why ?
>>
>> Is there a definitive resolution to this problem out there somewhere ?
>>
>> TIA
>>
>> lyallex
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

--

Alberto A. Flores
http://www.linkedin.com/in/aflores


Attachment: user_188706.ezm (zipped)

Hi

I have implemented ajax based parital page rendering in Struts 2.0.
Currently i'm facing browser compatibility issue because of radio button
events.
While using onclick,it is working fine in IE but not in Firefox2.0
Similarly, when using onchange it is working vice-versa.

Currently is there any browser compatibility issue with Struts2.0....


Thanks,
Srini


newton.dave wrote:
>
> --- On Thu, 7/10/08, AjaySrini <srinivasan152@(protected):
>> I'm using Struts2.0 in our application.I have written
>> the code in such a way it supports Ajax(<s:head theme="ajax">).
>> I'm successfully implemented the login screen using
>> ajax.After user successfully logs in, the user views four
>> Radio buttons written in a struts 2 div tag.Based on the
>> selection of the radio buttons i need to display another
>> component in the same page by invoking an action class using
>> AJAX......
>>
>> Note:The login Screen is a separate JSP. And successful
>> login which displays other JSP.
>>
>> Looking forward to ur reply....
>
> What's the question?
>
> Dave
>
>
> ---------------------------------------------------------------------
> 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_188707.ezm (zipped)

Hi

I have implemented ajax based parital page rendering in Struts 2.0.
Currently i'm facing browser compatibility issue because of radio button
events.
While using onclick,it is working fine in IE but not in Firefox2.0
Similarly, when using onchange it is working vice-versa.

Currently is there any browser compatibility issue with Struts2.0....


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


Attachment: user_188709.ezm (zipped)
Dimitris Mouchritsas wrote:
> Hi all,
> I've got a multipage form bean to complete a registration in 3 steps.
> Validator
> is not working correctly. Some fields in the first page are validated,
> some are not.
> In the 3rd page none of the fields are validated. Now from what I
> understand
> I need to extend ValidatorActionForm instead of ValidatorForm. But in
> the xdoclet
> path I need to provide a path attribute. (btw I use a patched 1.2.3
> xdoclet to support
> struts 1.3.8) If this is the path for the action then I'm in trouble
> because I have 3 seperate
> actions for each step. Do I need to combine them in one?
>
> Could you please provide an example of how to use this path attribute?
>
> Thanks
> Dimitris
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
Finally found the answer, when declaring the page attribute for the
property in
xdoclet it has to be on the same declaration as in:

  * @struts.validator type="required,mask,maxlength" page="3"

and not as in:
  * @struts.validator type="required,mask,maxlength"
  * @struts.validator page="3"

The latter, even though it produced a valid validation xml it added a
null as in:

        <field property="name"
             page="1"
             depends="required,mask,maxlength,null">

and this messed up the validation.


Attachment: user_188710.ezm (zipped)
But then your Service Bean/DAO has to be injected into every Action
that might need to load it and the code to check for the Data Object
and load it, then store it to the context has to be Cut-n-Pasted
between each of those Actions. Way too many chances for Cut-n-Paste
errors or incomplete fixes for my taste. By using the Interceptor
that code is consolidated in one place and the only thing the Action
has to worry about it what it was created specifically to accomplish,
not all the other housekeeping chores.
(*Chris*)

On Wed, Jul 9, 2008 at 6:10 PM, Gabriel Belingueres
<belingueres@(protected):
> Wow it is amazing how S2 can be used.
> This is a use of interceptor I've never seen before.
>
> IMHO, I think it is too much trouble to declare an xxxAware interface
> and an xxxInterceptor to just share the same database data across
> multiple pages. I would stick to store the data in session or
> application scope. You have available the SessionAware and
> ApplicationAware interfaces that injects into an action a
> java.util.Map that usually is enough for testability.
>
> My own common solution to this problem would be to use Spring to
> inject a service bean into the action that would retrieve the category
> list from a cache (OSCache works great for me and has easy Spring
> integration.) When data is not in the cache or it times-out, it is
> read from the database.
>
> 2008/7/9 Chris Pratt <thechrispratt@(protected)>:
>> That's usually how I start. The one thing I usually add is an Aware
>> interface that allows me to inject the value into my Actions when it's
>> needed. So in your case I'd add a simple interface:
>>
>> interface CategoryListAware {
>> void setCategoryList(List<Category> categories);
>> }
>>
>> And at the end of your interceptor I'd add:
>>
>> Object action = invocation.getAction();
>> if(action instanceof CategoryListAware) {
>> ((CategoryListAware)action).setCategoryList(categoryList);
>> }
>>
>> That way you can add the Interceptor to your default stack and the
>> Actions that need the category list can have it injected without
>> having to have any knowledge about the Session. (which makes the
>> system much easier to unit test).
>>
>> (*Chris*)
>>
>> On Wed, Jul 9, 2008 at 3:28 PM, Dhiraj Thakur <desi.tek.org@(protected):
>>> Hello there,
>>>
>>> There are 4 jsp page in which i want to show same category by retrieving it
>>> from database.
>>> What is the best way to do that? should i write a intercepter which will
>>> retrieve Category from database and store it in session?
>>> something like this
>>>
>>>
>>>     if (session.getAttribute("category") == null) {
>>>
>>>        CategoryDAO categoryDAO = new CategoryDAO();
>>>
>>>        categoryList = categoryDAO.listCategory();
>>>
>>>        session.setAttribute(ConfigAPP.CATEGORY_KEY, categoryList);
>>>
>>>        categoryList = (List)
>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>
>>>        System.out.println(categoryList.size());
>>>
>>>     } else {
>>>        categoryList = categoryList = (List)
>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>     }
>>>
>>>
>>> or is there any other way to do that ?
>>>
>>>
>>>
>>> *Dhiraj*
>>>
>>
>> ---------------------------------------------------------------------
>> 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_188716.ezm (zipped)
IMHO both approaches are similar, as the intention is to inject the
required data when you need it. The difference is that you created
both an interface and an interceptor to perform the injection, while I
relied on Spring to do this work.

As a general rule I think on writing custom interceptors only when
there is some generic pre/post processing that would need to take on a
set of actions but that are not part of regular functional
requirements.

See between the lines:

2008/7/10 Chris Pratt <thechrispratt@(protected)>:
> But then your Service Bean/DAO has to be injected into every Action
> that might need to load it

Yes, in the same way you need to implement the xxxAware interface in
every action that need to access the data.

> and the code to check for the Data Object
> and load it,

Not quite; this is the job of Spring, I only declare it one time in
the spring configuration xml file.

>then store it to the context has to be Cut-n-Pasted

Don't know what you meant here. There is not too much C&P. Just 2
instance variables: one for the service, and the other for the data.
Same as implementing the interface and declaring a variable to hold
the data.

> between each of those Actions. Way too many chances for Cut-n-Paste
> errors or incomplete fixes for my taste. By using the Interceptor
> that code is consolidated in one place and the only thing the Action
> has to worry about it what it was created specifically to accomplish,
> not all the other housekeeping chores.
> (*Chris*)
>
> On Wed, Jul 9, 2008 at 6:10 PM, Gabriel Belingueres
> <belingueres@(protected):
>> Wow it is amazing how S2 can be used.
>> This is a use of interceptor I've never seen before.
>>
>> IMHO, I think it is too much trouble to declare an xxxAware interface
>> and an xxxInterceptor to just share the same database data across
>> multiple pages. I would stick to store the data in session or
>> application scope. You have available the SessionAware and
>> ApplicationAware interfaces that injects into an action a
>> java.util.Map that usually is enough for testability.
>>
>> My own common solution to this problem would be to use Spring to
>> inject a service bean into the action that would retrieve the category
>> list from a cache (OSCache works great for me and has easy Spring
>> integration.) When data is not in the cache or it times-out, it is
>> read from the database.
>>
>> 2008/7/9 Chris Pratt <thechrispratt@(protected)>:
>>> That's usually how I start. The one thing I usually add is an Aware
>>> interface that allows me to inject the value into my Actions when it's
>>> needed. So in your case I'd add a simple interface:
>>>
>>> interface CategoryListAware {
>>> void setCategoryList(List<Category> categories);
>>> }
>>>
>>> And at the end of your interceptor I'd add:
>>>
>>> Object action = invocation.getAction();
>>> if(action instanceof CategoryListAware) {
>>> ((CategoryListAware)action).setCategoryList(categoryList);
>>> }
>>>
>>> That way you can add the Interceptor to your default stack and the
>>> Actions that need the category list can have it injected without
>>> having to have any knowledge about the Session. (which makes the
>>> system much easier to unit test).
>>>
>>> (*Chris*)
>>>
>>> On Wed, Jul 9, 2008 at 3:28 PM, Dhiraj Thakur <desi.tek.org@(protected):
>>>> Hello there,
>>>>
>>>> There are 4 jsp page in which i want to show same category by retrieving it
>>>> from database.
>>>> What is the best way to do that? should i write a intercepter which will
>>>> retrieve Category from database and store it in session?
>>>> something like this
>>>>
>>>>
>>>>     if (session.getAttribute("category") == null) {
>>>>
>>>>        CategoryDAO categoryDAO = new CategoryDAO();
>>>>
>>>>        categoryList = categoryDAO.listCategory();
>>>>
>>>>        session.setAttribute(ConfigAPP.CATEGORY_KEY, categoryList);
>>>>
>>>>        categoryList = (List)
>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>
>>>>        System.out.println(categoryList.size());
>>>>
>>>>     } else {
>>>>        categoryList = categoryList = (List)
>>>> session.getAttribute(ConfigAPP.CATEGORY_KEY);
>>>>     }
>>>>
>>>>
>>>> or is there any other way to do that ?
>>>>
>>>>
>>>>
>>>> *Dhiraj*
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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_188711.ezm (zipped)

Hi all,

I have a table (displayTag) and a form. when the user check (checkbox) some
of the items in the table and clicks submit the action is performed BUT
after it is finished it performs again... my question is why and how can I
avoid that?

Thank You!

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


Attachment: user_188718.ezm (zipped)
Hi,

I've a problem with holding the session between two namespaces.
I defined 3 namespaces:
- /: The unsecure namespace
- /secure: The secure namespace -> user has to be logged in
- /usermanager: The special secure namespace -> user has to have
permission to get there

The LoginAction forwards the user into the secure namespace. There I
have a menu with
 <a href="<s:url action="action1" namespace="secure"/>">link1</a>
 <a href="<s:url action="action2" namespace="secure"/>">link2</a>
 <a href="
   <s:url action="action3" namespace="usermanager"/>
   ">link3</a>

When I switch to the action2 the session is hold. Switching back to
action1 works as well.
But if I switch to action3 I get the right page, but switching back to
action1 or action2 I get the login page. After some debugging I've seen
that the session was killed. After some further debugging I've seen that
this only happens when I switch the namespace.

Has anyone an idea, what I did wrong?

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