Re: Why I Hate Struts Modules

2005-10-11 Thread Frank W. Zammetti
Paul, you are aware that you can specify multiple configuration files, 
right?  There isn't even a need to use XML entities, which I suspect 
isn't as well-known as it probably should be, and another poster pointed 
out that it presents some troubleshooting (or was it validation?) 
problems.  I think multiple config files gives you what you want though.


http://struts.apache.org/userGuide/configuration.html#dd_config_servlet

David G. Friedman wrote:

 Paul,



See, after all these years, I really wanted was to
split files up. Modules don't gain me anything, do
they? I know (or I think) when Craig wrote Struts 0.x,
he had an action.xml which did something similar
Now I could create file of just actions and use XML
ENTITIES to include them, but I never see people doing
that solution. Is it not well-known or frown upon?



I'd only heard once on this list about the XML entities trick.  Personally,
I'd prefer that one like that if I were creating anything large enough to
warrant breaking the configuration down into multiple files/modules. :)

Regards,
David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



.



--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Why I Hate Struts Modules

2005-10-11 Thread David G. Friedman
 Paul,

> See, after all these years, I really wanted was to
> split files up. Modules don't gain me anything, do
> they? I know (or I think) when Craig wrote Struts 0.x,
> he had an action.xml which did something similar
> Now I could create file of just actions and use XML
> ENTITIES to include them, but I never see people doing
> that solution. Is it not well-known or frown upon?

I'd only heard once on this list about the XML entities trick.  Personally,
I'd prefer that one like that if I were creating anything large enough to
warrant breaking the configuration down into multiple files/modules. :)

Regards,
David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Why I Hate Struts Modules

2005-10-11 Thread Paul Benedict
Great subject line, isn't it? :)

OK. I've been doing Struts for like 2-3 years now, and
Struts Modules I loved for awhile but now I absolutely
can't stand them

First off, my initial appeal to modules was to split
up the configuration files so different developers can
work on the project without people waiting for
check-outs. That sounds like a good deal, but Modules
are MORE than splitting up configuration files - they
are these Berlin Walls kind of construction where
forms and actions can't be shared across them 
unless you want to define them in multiple config
files.

See, after all these years, I really wanted was to
split files up. Modules don't gain me anything, do
they? I know (or I think) when Craig wrote Struts 0.x,
he had an action.xml which did something similar
Now I could create file of just actions and use XML
ENTITIES to include them, but I never see people doing
that solution. Is it not well-known or frown upon?

So I am kind of sick of Struts modules. More so, now
that I have to declare my Struts global exception
handler in every config file!! This gets ridiculous
after 5 modules... and forget about it if you have a
project with 50 modules.

Too much configuration duplication. 



__ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Postback not occuring for Clay html full view

2005-10-11 Thread Ryan Wynn
[EMAIL PROTECTED] (Gary VanMatre) wrote on 10/11/2005 04:29:47 PM:

> If you are using myfaces runtime, you need to add a preprocess 
> filter command.  The usecase has an example (http://svn.apache.
> org/viewcvs.cgi/struts/shale/trunk/use-cases/src/web/WEB-INF/chain-
> config.xml?view=markup).  This command captures the file suffix 
> before myfaces changes the viewid suffix. 

I had added this one already, noticed it in the example.

If you are using only 
> Clay full html views in your project, you might try changing the 
> default "javax.faces.DEFAULT_SUFFIX" to "*.html". 
> 

This change fixed it for me.  I am not sure why because I had already
mapping the faces servlet to *.html.  Regardless, it works now.  Thanks, 
Gary.



RE: sample please ....

2005-10-11 Thread David G. Friedman
Bib,

Can you include your Tiles definition and your jsp using tiles so we can
look at it?  Are you observing any errors in your logs?  Do the logs show
that the TilesRequestProcessor has initialized?

Regards,
David

-Original Message-
From: bib_lucene bib [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 11, 2005 8:31 PM
To: user@struts.apache.org
Subject: sample please 


Hi

Can I get a working sample which has struts and tiles. Basically has some
layout like head body and footer. Body includes a jsp with a form that has
html:text.

My example just dont work.

Thanks
bib



-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



sample please ....

2005-10-11 Thread bib_lucene bib
Hi
 
Can I get a working sample which has struts and tiles. Basically has some 
layout like head body and footer. Body includes a jsp with a form that has 
html:text.
 
My example just dont work.
 
Thanks
bib



-
 Yahoo! Music Unlimited - Access over 1 million songs. Try it free.

Re: Is the best way to have multiplestruts-config.xmlandtiles-defs.xml files, modules?

2005-10-11 Thread Kishore Senji
TilesPlugin doesn't configure the TilesDefinitionsFactory once it is already
configured, so, if you use comma-separated xml files you would to declare
all your tiles-definitions in only one xml file. Similarly for Validator --
ValidatorPlugin overrides the resources from subsequent calls to its init
method, so you would have to declare all the validator resources in one xml
file.

Also it is always better to prefix action paths and tiles-defs based on the
xml file. That way it totally eliminates the possibility of silently
overriding action-mappings, tiles-defs of one xml file by another xml file.


On 10/11/05, Preston CRAWFORD <[EMAIL PROTECTED]> wrote:
>
> Oooh. I like that. That works relatively well so far, although it's not
> picking up on my secondary tiles-defs.xml file.
>
> Preston
>
> >>> [EMAIL PROTECTED] 10/11/2005 2:26:22 PM >>>
> From: "Preston CRAWFORD" <[EMAIL PROTECTED]>
>
> > I've done this in the past. Used modules to logically (and for the
> sake
> > of having sane config files) break up these config files. However
> I'm
> > wondering if anyone avoids using modules and maybe merges the files
> > using ANT or something?
>
> You can have multiple Struts config files without using modules:
> http://www.mail-archive.com/user@struts.apache.org/msg32270.html
>
> http://struts.apache.org/api/org/apache/struts/action/ActionServlet.html
>
> config - Comma-separated list of context-relative path(s) to the XML
> resource(s) containing the configuration information for the default
> module.
> (Multiple files support since Struts 1.1)
> [/WEB-INF/struts-config.xml].
>
> --
> Wendy Smoak
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Is the best way to have multiplestruts-config.xmlandtiles-defs.xml files, modules?

2005-10-11 Thread Preston CRAWFORD
Oooh. I like that. That works relatively well so far, although it's not
picking up on my secondary tiles-defs.xml file.

Preston

>>> [EMAIL PROTECTED] 10/11/2005 2:26:22 PM >>>
From: "Preston CRAWFORD" <[EMAIL PROTECTED]>

> I've done this in the past. Used modules to logically (and for the
sake
> of having sane config files) break up these config files. However
I'm
> wondering if anyone avoids using modules and maybe merges the files
> using ANT or something?

You can have multiple Struts config files without using modules:
   http://www.mail-archive.com/user@struts.apache.org/msg32270.html 

http://struts.apache.org/api/org/apache/struts/action/ActionServlet.html

config - Comma-separated list of context-relative path(s) to the XML 
resource(s) containing the configuration information for the default
module. 
(Multiple files support since Struts 1.1) 
[/WEB-INF/struts-config.xml].

-- 
Wendy Smoak 


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



findforward w/session objects

2005-10-11 Thread Chris Pat
Hello
When I use the code below the Action "playThis" claims
the file attribute is null.  It is not unless I am
loosing the session on the findforward.  How can I
store a value in the session and forward to an Action?
 The first line of the "playThis action is String file
= (String) request.getAttribute("file"); so why is
attribute null?  Any enlightment welcomed.

System.out.println("file= "+temp);
session.setAttribute("file", temp);
return actionMapping.findForward("playThis");




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is the best way to have multiple struts-config.xml andtiles-defs.xml files, modules?

2005-10-11 Thread Wendy Smoak

From: "Preston CRAWFORD" <[EMAIL PROTECTED]>


I've done this in the past. Used modules to logically (and for the sake
of having sane config files) break up these config files. However I'm
wondering if anyone avoids using modules and maybe merges the files
using ANT or something?


You can have multiple Struts config files without using modules:
  http://www.mail-archive.com/user@struts.apache.org/msg32270.html

http://struts.apache.org/api/org/apache/struts/action/ActionServlet.html
config - Comma-separated list of context-relative path(s) to the XML 
resource(s) containing the configuration information for the default module. 
(Multiple files support since Struts 1.1)  [/WEB-INF/struts-config.xml].


--
Wendy Smoak 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is the best way to have multiple struts-config.xml andtiles-defs.xml files, modules?

2005-10-11 Thread Preston CRAWFORD
Just tried this. This works nice. Only downside is that then you don't
get any context help in the editor as you can't have a full XML file
with a doctype at the top (for the included files).

Bummer.

Preston

>>> [EMAIL PROTECTED] 10/11/2005 2:02:48 PM >>>
Some people prefer to stay away from modules (I have a vague memory of
at
least one Struts committer saying they generally try to avoid them for
example).  One option that Craig turned me on to (and I hope I'm
remembering this right!) is using entities to import XML into another. 
If
the only real purpose of using modules is to better organize your
multiple
struts-config files and tiles-defs, this might be a good answer.


...
&struts_config_2;

That, more or less, functions as an import, as I recall (someone
PLEASE
correct me if I got the syntax, or the concept of course, wrong).

Of course, if you have another purpose for modules, like if you have a
desktop CRM application that has a number of largely independent
sub-components (I picked this example because we're discussing this
very
thing right now), then they might be a good fit.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com 
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED] 

On Tue, October 11, 2005 4:36 pm, Preston CRAWFORD said:
> I've done this in the past. Used modules to logically (and for the
sake
> of having sane config files) break up these config files. However
I'm
> wondering if anyone avoids using modules and maybe merges the files
> using ANT or something? Reason I ask is because I know there are
> pitfalls to using modules and I'm not sure I want to have to deal
with
> them for this project (pitfalls like switching between the parent
and
> the module, pathnames, etc.).
>
> Preston
>
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: startup time validator validation?

2005-10-11 Thread Mick Knutson
no, because my code is being generated from wsdl2java, and not xdoclet.

"David G. Friedman" wrote:

> Wouldn't XDoclet's Struts Validator features work for you
> in this regard?  It wouldn't be i nthe JSP or at startup
> but at build/compile time.  See:
>
> http://xdoclet.sourceforge.net/xdoclet/tags/[EMAIL PROTECTED]
> evel_Tags
>
> >I am trying to figure out if there is a way to have the Validator
> >framwork verify that the form element names defined in the
> >validation.xml, are in synch with my ActionForms, but not jst at
> >runtime. Right now if there is a mismatch, then I get an error in the
> >form of an error, sometimes obscure, on the field that is mismatched.
> >
> >So I would like to be able to enforce the validating of the
> >validation.xml forms at startup time if possible.
> >
> >
>
> Regards,
> David
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is the best way to have multiple struts-config.xml andtiles-defs.xml files, modules?

2005-10-11 Thread Preston CRAWFORD
No, in our case it's mostly to make the code manageable. We're putting
code into separate packages and separate JSP directories, but it's all
going to be part of the same application in the end. And avoiding
modules wold be nice if possible.

Preston

>>> [EMAIL PROTECTED] 10/11/2005 2:02:48 PM >>>
Some people prefer to stay away from modules (I have a vague memory of
at
least one Struts committer saying they generally try to avoid them for
example).  One option that Craig turned me on to (and I hope I'm
remembering this right!) is using entities to import XML into another. 
If
the only real purpose of using modules is to better organize your
multiple
struts-config files and tiles-defs, this might be a good answer.


...
&struts_config_2;

That, more or less, functions as an import, as I recall (someone
PLEASE
correct me if I got the syntax, or the concept of course, wrong).

Of course, if you have another purpose for modules, like if you have a
desktop CRM application that has a number of largely independent
sub-components (I picked this example because we're discussing this
very
thing right now), then they might be a good fit.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com 
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED] 

On Tue, October 11, 2005 4:36 pm, Preston CRAWFORD said:
> I've done this in the past. Used modules to logically (and for the
sake
> of having sane config files) break up these config files. However
I'm
> wondering if anyone avoids using modules and maybe merges the files
> using ANT or something? Reason I ask is because I know there are
> pitfalls to using modules and I'm not sure I want to have to deal
with
> them for this project (pitfalls like switching between the parent
and
> the module, pathnames, etc.).
>
> Preston
>
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED] 
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Is the best way to have multiple struts-config.xml andtiles-defs.xml files, modules?

2005-10-11 Thread Frank W. Zammetti
Some people prefer to stay away from modules (I have a vague memory of at
least one Struts committer saying they generally try to avoid them for
example).  One option that Craig turned me on to (and I hope I'm
remembering this right!) is using entities to import XML into another.  If
the only real purpose of using modules is to better organize your multiple
struts-config files and tiles-defs, this might be a good answer.


...
&struts_config_2;

That, more or less, functions as an import, as I recall (someone PLEASE
correct me if I got the syntax, or the concept of course, wrong).

Of course, if you have another purpose for modules, like if you have a
desktop CRM application that has a number of largely independent
sub-components (I picked this example because we're discussing this very
thing right now), then they might be a good fit.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

On Tue, October 11, 2005 4:36 pm, Preston CRAWFORD said:
> I've done this in the past. Used modules to logically (and for the sake
> of having sane config files) break up these config files. However I'm
> wondering if anyone avoids using modules and maybe merges the files
> using ANT or something? Reason I ask is because I know there are
> pitfalls to using modules and I'm not sure I want to have to deal with
> them for this project (pitfalls like switching between the parent and
> the module, pathnames, etc.).
>
> Preston
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Is the best way to have multiple struts-config.xml andtiles-defs.xml files, modules?

2005-10-11 Thread Preston CRAWFORD
I've done this in the past. Used modules to logically (and for the sake
of having sane config files) break up these config files. However I'm
wondering if anyone avoids using modules and maybe merges the files
using ANT or something? Reason I ask is because I know there are
pitfalls to using modules and I'm not sure I want to have to deal with
them for this project (pitfalls like switching between the parent and
the module, pathnames, etc.).

Preston

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Postback not occuring for Clay html full view

2005-10-11 Thread Gary VanMatre
Hi Ryan,

>I am using shale/clay html full view.  I have an initial page, index.html, 
>which contains a commandLink to another page, page2.html.
>
>index.html
>
>[snippet]
>
>index is configured as in faces-config.xml and implements ViewController. 
>
>When I click on page2Link I see that the following is happening...
>
>Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler 
>restoreView
>INFO: Clay template restoreView for /index.jsp
>init called
>prerender called
>Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler 
>renderView
>INFO: Clay template renderView for /index.jsp
>destroy called
>
>My action handler is not being called so the navigation is not occuring 
>and the preprocess cycle is not being invoked.
>
>Any ideas?

If you are using myfaces runtime, you need to add a preprocess filter command.  
The usecase has an example 
(http://svn.apache.org/viewcvs.cgi/struts/shale/trunk/use-cases/src/web/WEB-INF/chain-config.xml?view=markup).
  This command captures the file suffix before myfaces changes the viewid 
suffix.  If you are using only Clay full html views in your project, you might 
try changing the default "javax.faces.DEFAULT_SUFFIX" to "*.html".  

Another thing you might try is turning on debug for a couple myfaces classes in 
the java logging.properties file.
org.apache.myfaces.application.NavigationHandlerImpl.level=ALL
org.apache.myfaces.application.ActionListenerImpl.level=ALL


Gary

 



--- Begin Message ---
I am using shale/clay html full view.  I have an initial page, index.html, 
which contains a commandLink to another page, page2.html.

index.html




Page 2


 

clay-config.xml
...




 


...

index is configured as in faces-config.xml and implements ViewController. 

When I click on page2Link I see that the following is happening...

Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler 
restoreView
INFO: Clay template restoreView for /index.jsp
init called
prerender called
Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler 
renderView
INFO: Clay template renderView for /index.jsp
destroy called

My action handler is not being called so the navigation is not occuring 
and the preprocess cycle is not being invoked.

Any ideas?



--- End Message ---
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

RE: startup time validator validation?

2005-10-11 Thread David G. Friedman
Wouldn't XDoclet's Struts Validator features work for you
in this regard?  It wouldn't be i nthe JSP or at startup
but at build/compile time.  See:

http://xdoclet.sourceforge.net/xdoclet/tags/[EMAIL PROTECTED]
evel_Tags

>I am trying to figure out if there is a way to have the Validator
>framwork verify that the form element names defined in the
>validation.xml, are in synch with my ActionForms, but not jst at
>runtime. Right now if there is a mismatch, then I get an error in the
>form of an error, sometimes obscure, on the field that is mismatched.
>
>So I would like to be able to enforce the validating of the
>validation.xml forms at startup time if possible.
>
>

Regards,
David


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[OT] Re: startup time validator validation?

2005-10-11 Thread Dave Newton

Mick Knutson wrote:


It could be at build time just fine, but I am using maven.
So how could I integrate this into my build then?
 


I have no idea :)

In my case, with ant, I was just running an external task. I don't even 
remember how I was getting status information back and all that. Just 
some ideas about how one could go about it.


Sorry,
Dave



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: startup time validator validation?

2005-10-11 Thread Mick Knutson
It could be at build time just fine, but I am using maven.
So how could I integrate this into my build then?

Dave Newton wrote:

> Mick Knutson wrote:
>
> >I am trying to figure out if there is a way to have the Validator
> >framwork verify that the form element names defined in the
> >validation.xml, are in synch with my ActionForms, but not jst at
> >runtime. Right now if there is a mismatch, then I get an error in the
> >form of an error, sometimes obscure, on the field that is mismatched.
> >
> >So I would like to be able to enforce the validating of the
> >validation.xml forms at startup time if possible.
> >
> >
> I solved a similar problem at build using two different methods on
> several projects:
>
> 1) Generated validation.xml, torque schema, chunks of
> DynaValidatorActionForm form-beans for struts-config.xml, parts of
> application resources, java classes for marshalling within Actions (I
> didn't always use this part, actually :/ and JSP chunks (form tiles)
> from an over-arching XML configuration file. This doesn't do what you're
> asking, but it does make sure that things are in sync, and was actually
> kinda nice.
>
> 2) Used XML parser to check names of fields in validation.xml against
> struts-config action "name" attributes linked against struts-config
> form-bean defs, sort of like a 'diff' for various chunks of XML. This
> also ran as an ant task, not on startup or anything, but I suppose it
> could be adapted to that.
>
> To me, this seems like a problem better solved during the build process
> rather than deployment/startup.
>
> Dave Newton
> Technical Lead (MonkeyLips OmniGalgomon Project)
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Postback not occuring for Clay html full view

2005-10-11 Thread Martin Gainty

Ryan

the Clay dcumentation at
http://struts.apache.org/shale/features.html#view
For each JavaServer Faces view that you wish to associate with a 
ViewController backing bean, you must:


 a.. Implement the ViewController interface. The most convenient way to do 
this is likely to be extending the convenience base class 
(org.apache.shale.view.ViewController).
 b.. As required by the JavaBeans specification, provide a no-args public 
constructor.
 c.. Declare your backing bean as a managed bean. In nearly all 
circumstances, you will want the bean to be placed in request scope.
 d.. (Optional) Provide public JavaBean properties that may be set to 
customize the functionality provided by this bean. Typically, such 
properties will be configured based on the managed beans configuration 
defined in the JavaServer Faces configuration resources for your 
application.
 e.. Ensure that the functionality of your backing bean is not dependent 
upon the order in which property setters are called, since managed beans are 
configured via the "setter injection" pattern.
 f.. Create event handlers for the lifecycle events of interest, plus 
standard JavaServer Faces event handlers for things like actions and value 
changes.
 g.. (Optional but recommended) write a corresponding JUnit test case using 
the Shale Test Framework. Because nearly all of your property and event 
handling methods have no JavaServer Faces API dependencies for their 
parameter signatures, it is generally quite easy to write such tests.
whith regards to your missing boolean property 'postback' for your backing 
bean the doc states
Each backing bean that implements ViewController will support a boolean 
property postback, which will be set to
true if this view is the one that is processing a form submit previously 
rendered by the same page, or

false if this view was newly navigated to.

The property will be set before any of the lifecycle methods described below 
are called, so that application logic may perform conditional tasks based on 
this state.


Off the top I dont see your postback attribute

Hope this helps you out,

Martin-
(e)[EMAIL PROTECTED]
617-852-7822

- Original Message - 
From: "Ryan Wynn" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, October 11, 2005 1:55 PM
Subject: Postback not occuring for Clay html full view



I am using shale/clay html full view.  I have an initial page, index.html,
which contains a commandLink to another page, page2.html.

index.html




   Page 2




clay-config.xml
...

   
   
   
   
   

...

index is configured as in faces-config.xml and implements ViewController.

When I click on page2Link I see that the following is happening...

Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler
restoreView
INFO: Clay template restoreView for /index.jsp
init called
prerender called
Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler
renderView
INFO: Clay template renderView for /index.jsp
destroy called

My action handler is not being called so the navigation is not occuring
and the preprocess cycle is not being invoked.

Any ideas?






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: startup time validator validation?

2005-10-11 Thread Dave Newton

Mick Knutson wrote:


I am trying to figure out if there is a way to have the Validator
framwork verify that the form element names defined in the
validation.xml, are in synch with my ActionForms, but not jst at
runtime. Right now if there is a mismatch, then I get an error in the
form of an error, sometimes obscure, on the field that is mismatched.

So I would like to be able to enforce the validating of the
validation.xml forms at startup time if possible.
 

I solved a similar problem at build using two different methods on 
several projects:


1) Generated validation.xml, torque schema, chunks of 
DynaValidatorActionForm form-beans for struts-config.xml, parts of 
application resources, java classes for marshalling within Actions (I 
didn't always use this part, actually :/ and JSP chunks (form tiles) 
from an over-arching XML configuration file. This doesn't do what you're 
asking, but it does make sure that things are in sync, and was actually 
kinda nice.


2) Used XML parser to check names of fields in validation.xml against 
struts-config action "name" attributes linked against struts-config 
form-bean defs, sort of like a 'diff' for various chunks of XML. This 
also ran as an ant task, not on startup or anything, but I suppose it 
could be adapted to that.


To me, this seems like a problem better solved during the build process 
rather than deployment/startup.


Dave Newton
Technical Lead (MonkeyLips OmniGalgomon Project)



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DynaActionForm, Boolean checkboxes, and Initial

2005-10-11 Thread katre
Hello all.

In my app, I use the DynaActionForm, because it makes it much easier to
declare all the forms I need.  However, it is giving me a problem with
Boolean type variables used in checkboxes.

Specifically, I have the following form-bean:





In my JSP, I have:



This is properly checked by default.

The problem is that when a user unchecks the checkbox, this is not
noticed in the form, due to the infamous
HTTP-doesn't-send-empty-parameters problem.  The canonical advice I have
seen is 'set the property to false in the form's reset() method'.

This has two problems:
a) DynaActionForm's reset does nothing by default.  Is there really no
support for this common thing in DynaActionForm?
b) I created a subclass on DynaActionForm, which had a reset() method
that only sets that property to false.  However, the ActionForm.reset()
method is apparently called via the  tag, (the doStartTag()
method calls initFormBean(), which calls the form bean's reset()
method).  This means that the checkbox is initially unchecked, and seems
to be a problem regardless of using DynaActionForm or not.

So, my question is: how can I have a Boolean checkbox that defaults to
true, and yet can tell when it is unchecked, and still use
DynaActionForm?

Thanks,
katre


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Submit buttons getting their value

2005-10-11 Thread Richard Yee
D.J.,
Perhaps you should try it yourself. It works for me.
If the html:submit tag is used, and the property
attribute is specified, then that property is
available in the action class as
request.getParameter("the_submit_button_property_name");

I don't see any code that wraps HttpServletRequest.

-Richard


--- Dakota Jack <[EMAIL PROTECTED]> wrote:

> Actually this won't work either.  The problem is
> that the request
> object has been purloined and given another wrapper
> name.  You might
> want to look at the code before giving these ideas.
> 
> On 10/10/05, Richard Yee <[EMAIL PROTECTED]> wrote:
> > Try getParameter() instead of getAttribute().
> >
> > -Richard
> >
> >
> > C.F. Scheidecker Antunes wrote:
> > > Hello all,
> > >
> > > I have two submit buttons, one with a value of
> Continue and the other
> > > Back.
> > >
> > > How do I check their values?
> > >
> > > I've tried
> request.getAttribute("submit").toString() but I do
> not get
> > > anything.
> > >
> > > My buttons are like this:
> > >
> > > back
> > >  value="continue">continue
> > >
> > > They are within the same form structure.
> > >
> > > My action has already a Session Bean scope to
> save the form contents.
> > > But the submit is not
> > > in that DynaBean.
> > >
> > > I will decide on what to do within the action
> based on what button is
> > > pressed.
> > >
> > > Thanks,
> > > C.F.
> > >
> > >
>
-
> > > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> [EMAIL PROTECTED]
> > >
> > >
> > >
> >
> >
> >
> >
>
-
> > To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> > For additional commands, e-mail:
> [EMAIL PROTECTED]
> >
> >
> 
> 
> --
> "You can lead a horse to water but you cannot make
> it float on its back."
> ~Dakota Jack~
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 





__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



startup time validator validation?

2005-10-11 Thread Mick Knutson
I am trying to figure out if there is a way to have the Validator
framwork verify that the form element names defined in the
validation.xml, are in synch with my ActionForms, but not jst at
runtime. Right now if there is a mismatch, then I get an error in the
form of an error, sometimes obscure, on the field that is mismatched.

So I would like to be able to enforce the validating of the
validation.xml forms at startup time if possible.

--

Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---



"MMS " made the following annotations.
--
Warning: 
All e-mail sent to this address will be received by the Safeway corporate 
e-mail system, and is subject to archival and review by someone other than the 
recipient.  This e-mail may contain information proprietary to Safeway and is 
intended only for the use of the intended recipient(s).  If the reader of this 
message is not the intended recipient(s), you are notified that you have 
received this message in error and that any review, dissemination, distribution 
or copying of this message is strictly prohibited.  If you have received this 
message in error, please notify the sender immediately. 
  
==


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [JSF] Is it possible to submit to different URL/page?

2005-10-11 Thread Craig McClanahan
On 10/11/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote:
>
> So, is it possible to submit a form to another page, either with
> submit button or with a link?


There is no such attribute on the  or 
components, because in HTML that is not what determines where the submit
goes -- it's the "action" attribute of the parent form component that
determines that. The only way to do what you're describing is to have some
client side Javascript that goes and messes with the action attribute before
calling document.submit().

Of course, doing this means you're throwing away the current component tree,
so it kind of defeats the purpose of using JSF in the first place. If you
want alternative processing of the same input data based some environmental
conditions, that's whay DI frameworks like Spring or Hivemind let you build
up on the server side -- just use them in the action method that handles the
submit to do what you need, without trying to mess around at the HTML level.

OutputLink does not seem to submit a
> form.


Nope ... that's why  exists, to provide you something that
looks like a hyperlink but actually does submit the form.

Michael.


Craig


Accessing Struts portal via Netscreen

2005-10-11 Thread Radhika Sarang
We've installed a Struts based portal on our test system(Solaris box).
When we test inside the network everything works fine.  But if we log in
from outside the network via Netscreen(there is an IP address
translation that happens), the first login page takes over 5 minutes to
appear. But once the login process is complete, all clicks from there on
works just fine.  Another portal(that doesn't use Struts) has no such
problems.  
 
Here's some details:
 
Servlet Engine: Tomcat (from within JBOSS)
Web Server (installed on an external web server) :  Apache
 
The mod_jk.conf file on the external web server:

 
JkWorkersFile /opt/tomcat/conf/workers.properties
JkLogFile  logs/jk.log
JkLogLevel warn
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
JkMount /adminportal/* ajp13
 

 
 
The URL : http://  /adminportal/Welcome.do
 
 
Appreciate any help we can get on this problem.
 
 
Radhika
This message is hereby marked SYLANTRO CONFIDENTIAL, is intended only
for the use of the individual or individuals to which it is addressed
and shall not be disclosed or made available to any other party except
with the prior written consent of the sender. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this message is strictly
prohibited. If you have received this communication in error, please
notify us immediately by replying to the sender of this E-Mail.
 


Postback not occuring for Clay html full view

2005-10-11 Thread Ryan Wynn
I am using shale/clay html full view.  I have an initial page, index.html, 
which contains a commandLink to another page, page2.html.

index.html




Page 2


 

clay-config.xml
...




 


...

index is configured as in faces-config.xml and implements ViewController. 

When I click on page2Link I see that the following is happening...

Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler 
restoreView
INFO: Clay template restoreView for /index.jsp
init called
prerender called
Oct 11, 2005 1:42:47 PM org.apache.shale.clay.faces.ClayViewHandler 
renderView
INFO: Clay template renderView for /index.jsp
destroy called

My action handler is not being called so the navigation is not occuring 
and the preprocess cycle is not being invoked.

Any ideas?





[JSF] Is it possible to submit to different URL/page?

2005-10-11 Thread Michael Jouravlev
So, is it possible to submit a form to another page, either with
submit button or with a link? OutputLink does not seem to submit a
form.

Michael.

-- Forwarded message --
I looked up for an attribute of h:commandButton which would allow to
submit to another URL, and I could not find it. All I found was
"action" and "actionListener", which should evaluate to methods, not
to URLs:
http://java.sun.com/j2ee/javaserverfaces/1.1/docs/tlddocs/h/commandButton.html

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to sustain the sanity of the connection pool

2005-10-11 Thread Ronald Holshausen
DBCP has some properties to help with connection pool leaks:
removeAbandoned, logAbandoned. See
http://jakarta.apache.org/commons/dbcp/configuration.html

On 11/10/05, emre akbas <[EMAIL PROTECTED]> wrote:
> Hi,
> I have some general questions about connection pooling and exception
> handling.
> Struts suggests that developers use declarative exception handling. In
> declarative exception handling, there are almost no "try { } catch() {}"
> blocks in the Action classes. Exception occuring in Action classes are
> handled by exception handlers outside the Action classes. Everything seems
> OK so far.
> It is very usual that we open a connection to the database at the beginning
> of the Action class and then close it at the end. When an exception occurs,
> an exception-handler outside of our Action class (in which the exception is
> thrown) handles the exception. Then, what happens to the connection? We
> weren't able to close it, so does it continue to allocate a connection from
> the pool?
> My other question is about the connection pooling itself. Are there any
> tools or ideas to monitor the sanity of the connection pool? Are we somehow
> able to find the classes where leakage occur?
> Thanks in advance.
>
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: how to sustain the sanity of the connection pool

2005-10-11 Thread Eric Plante
>It is very usual that we open a connection to the database at the beginning
>of the Action class and then close it at the end. When an >exception
occurs,
>an exception-handler outside of our Action class (in which >the exception
is
>thrown) handles the exception. Then, what happens to the >connection? We
>weren't able to close it, so does it continue to allocate a >connection
from
>the pool?
in the finally clause, check if the connection was opened, if it was, close
it. IMHO, it might be better to open and close your connection in the method
that make the call to the DB which would be synchronized for security sake.

>My other question is about the connection pooling itself. Are there any
>tools or ideas to monitor the sanity of the connection pool? Are we somehow
>able to find the classes where leakage occur?

not sure what you mean by leakage but I use Hibernate so I'm not concerned
anymore about inner problems.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html tags not parsed by taglibs

2005-10-11 Thread Eric Plante
Many thanks! It worked!

> try using filter="false"
>
> e.g.
>
> 
>
> Gareth
>
> Kishore Senji wrote:
> > When you say "bean:write is not parsed", you mean that in the html
source
> > that's generated you see "bean:write" in it? If so, you might have just
> > forgot the bean taglib reference (<%@ taglib ...%>)
> >
> > On 10/10/05, Eric Plante <[EMAIL PROTECTED]> wrote:
> >
> >>Hi,
> >>
> >>When I hardcode something like hello between
> >>
> >>and  in my jsp page, it works.
> >>
> >>if I put the same string in a property and use it in a bean:write, it's
> >>not
> >>parsed, the page shows the whole string which is not what I need.
> >>
> >>Is there a way to make the bean:write parse the string in the jsp? And
can
> >>someone explain to me why bean:write acts like that?
> >>
> >>Thanks
> >>
> >>
> >>-
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> -- 
> Gareth Evans
>
> MSoft eSolutions Limited
> Technology Centre
> Inward Way
> Rossmore Business Park
> Ellesmere Port
> Cheshire
> CH65 3EN
>
> -- 
> Tel:+44 (0)870 0100 704
> Fax:+44 (0)870 9010 705
> E-Mail: [EMAIL PROTECTED]
> Web:www.msoft.co.uk
>
> --
> Terms:
> Please note that any prices quoted within this e-mail are subject to VAT.
> All program details and code described in this e-mail are subject to
> copyright © of MSoft eSolutions Limited and remain the intellectual
> property of MSoft eSolutions Limited.
> Any proposal or pricing information contained within this e-mail are
> subject to MSoft eSolutions' Terms and Conditions
> --
> Disclaimer:
> This message is intended only for use of the addressee. If this message
> was sent to you in error, please notify the sender and delete this
> message. MSoft eSolutions Limited cannot accept responsibility for
viruses,
> so please scan attachments. Views expressed in this message do not
> necessarily reflect those of MSoft eSolutions Limited who will not
> necessarily be bound by its contents.
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html:text not interpreted :-(

2005-10-11 Thread Eric Plante
is it within  and  tags?

here's the header of my own jsp page concerning the taglibs just in cast it
works for you since it works well for me.

<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

The .tld are physicaly in my /WEB-INF directory.

I'm using Exadel Studio  which does the complex things for me.

- Original Message - 
From: "bib_lucene bib" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Tuesday, October 11, 2005 2:41 AM
Subject: Re: html:text not interpreted :-(


> no, just put a simple html:text to see if a text box appears, I thought  I
will get this done and then continue adding more elements adding action
classes etc?
> Is that wrong approach?
>
> [EMAIL PROTECTED] wrote:
> Have u map it with form-bean.
>
>
>
>
> bib_lucene bib
> 10/11/2005 11:54 AM
> Please respond to
> "Struts Users Mailing List"
>
>
> To
> Struts Users Mailing List
> cc
>
> Subject
> Re: html:text not interpreted :-(
>
>
>
>
>
>
> ok I attached files , I access this page using
> http://localhost:8090/rs/tiles/example.jsp
> It displays header, left pane, content, footer. But does not show text box
> in content.
> Thanks for your help.
> bib
>
> Wendy Smoak wrote:
> From: "bib_lucene bib"
>
> > I still cannot see the text field in body.
> >
> > This is the content of my web.xml
>
> If you're using the known URI for the taglibs, then you don't need
> in web.xml. (Fix the Tiles URI before removing its from web.xml
> though.)
>
> Are you sure your browser hasn't cached the old, incorrect page? Try
> holding down shift and hitting refresh/reload to make sure you're getting
> a
> new version.
>
> You can also stop your container and delete its 'work' files to force it
> to
> recompile the JSP.
>
> If you still need help, post some of the JSP code for your form and the
> resulting HTML.
>
> -- 
> Wendy Smoak
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional com mands, e-mail: [EMAIL PROTECTED]
>
> Yahoo! Music Unlimited - Access over 1 million songs. Try it
free.version="1.0" encoding="ISO-8859-1"?>
>
>
> RS
>
>
>
> DB Connection
> jdbc/mysqlDB
> javax.sql.DataSource
> Container
>
>
>
> AdminServlet
> com.rs.servlets.AdminServlet
>
>
>
> UserServlet
> UserServlet
> User Actions go into this
> one
> com.rs.servlets.UserServlet
>
>
>
> CandidateServlet
> CandidateServlet
> Candidate Actions go into this
> one
> com.rs.servlets.CandidateServlet
>
>
> action
> org.apache.struts.action.ActionServlet
>
>
> config
>
>
> /WEB-INF/struts-config.xml
>
>
>
>
> debug
>
>
> 3
>
>
>
>
> detail
>
>
> 3
>
>
> 0
>
>
>
> AdminServlet
> /servlet/AdminServlet
>
>
>
> UserServlet
> /servlet/UserServlet
>
>
>
> CandidateServlet
> /Candidate.html
>
>
>
> action
> *.do
>
>
> 30
>
>
>
> http://displaytag.sourceforge.net/
> /WEB-INF/tlds/displaytag-11.tld
>
>
>
> index.jsp
> login.jsp
>
>
>
> 404
> /error.jsp
>
>
>
>
> /tags/struts-bean
> /WEB-INF/struts-bean.tld
>
>
> /tags/struts-logic
> /WEB-INF/struts-logic.tld
>
>
> /tags/struts-nested
> /WEB-INF/struts-nested.tld
>
>
>
>
> /tags/struts-tiles
> /WEB-INF/struts-tiles.tld
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> -
>  Yahoo! Music Unlimited - Access over 1 million songs. Try it free.
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: html tags not parsed by taglibs

2005-10-11 Thread Eric Plante
no, it's not the taglib that isn't parsed but the html tags in the
property's string to be written by the taglib.


- Original Message - 
From: "Kishore Senji" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" 
Sent: Tuesday, October 11, 2005 12:18 AM
Subject: Re: html tags not parsed by taglibs


When you say "bean:write is not parsed", you mean that in the html source
that's generated you see "bean:write" in it? If so, you might have just
forgot the bean taglib reference (<%@ taglib ...%>)

On 10/10/05, Eric Plante <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> When I hardcode something like hello between
> 
> and  in my jsp page, it works.
>
> if I put the same string in a property and use it in a bean:write, it's
> not
> parsed, the page shows the whole string which is not what I need.
>
> Is there a way to make the bean:write parse the string in the jsp? And can
> someone explain to me why bean:write acts like that?
>
> Thanks
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re:How to minimize security related code in Action classes

2005-10-11 Thread ooper
Yes, I am still wondering. Thanks Adam, I'll look into your suggestion.


-
http://Struts_User_List.roomity.com";>roomity.com
Your Roomity Broadband Webapp ~~1129041675336~~
-


Re: This is an easy one

2005-10-11 Thread Ronald Holshausen
&

On 11/10/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I should know this, but how do I use '&' in a tiles xml?
>
> I guess this makes me the whipping boy for a while.
>

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



This is an easy one

2005-10-11 Thread Mario_Hernandez
I should know this, but how do I use '&' in a tiles xml?

I guess this makes me the whipping boy for a while.

Re: how to sustain the sanity of the connection pool

2005-10-11 Thread Ronald Holshausen
Another solution is to use a proxing framework (like spring), that
opens and closes the connections for you. This way you know that the
connection will always be closed after the method call, regardless if
there was an error or not.

You can also create a base class for all your actions that has a try
{} finally{ connection.close(); } statement so that your connections
are always closed. But I think the DAO pattern is probably the best if
you want to keep your actions and data access code seperate.

Also look at the commons-dbutil library, as it has a nice closeQuitly
method so you can close a connection without catch for the
IOException.

On 11/10/05, Murray Collingwood <[EMAIL PROTECTED]> wrote:
> A pertinent question, had the same problem myself this afternoon.
>
> I use Tomcat DBCP and found that each connection really does need to be 
> closed.  If
> you don't your pool of connections is quickly depleted.
>
> From the many code samples I have looked at (not that many really) I find 
> many people
> extend the MVC concept to MVCD where D is the "DAO" or Data Access Object.  
> In my
> recent app I have declared a Dao class that provides by abstract database 
> class and
> then defined all my databases to use this Dao super class.  I then have 
> standard
> functions in the Dao class for managing my connections.  The connections 
> themselves
> all come from a function in my persistence class (like a Manager.class with a
> getInstance() function).
>
> Finally I can put println() calls in my persistence class to count the usage. 
>  This is of
> course very manual, maybe somebody has a better method.  What would be nice 
> is if
> Tomcat had some monitor for the connection pool that we could 
> watchprobably need
> to direct that question to the Tomcat list.
>
> Visually my stuff looks like the following:
>
> public class Manager {
> private static Manager manager = new Manager();
>
> public Manager getInstance() {
> return manager;
> }
>
> public Connection getConnection() {
> return dataSource.getConnection();
> }
>
> ...a few other methods to support the above...
> }
>
> public class Dao {
> /** Creates a new instance of Dao */
> public Dao() {
> try {
> Manager.getInstance().connections += 1;
> System.err.println("");
> System.err.println("* Open connection=" +
> Manager.getInstance().connections);
> connection = Manager.getInstance().getConnection();
> if (connection == null)
> System.err.println("ERROR: Dao: Failed to establish 
> connection == null");
> } catch (Exception e) {
> System.err.println("ERROR: Dao: " + e.getMessage());
> }
> }
>
> public void close() {
> try {
> if (rs != null) rs.close();
> if (statement != null) statement.close();
> if (connection != null) connection.close();
> } catch (Exception e) {
> System.err.println("ERROR: Dao: " + e.getMessage());
> }
> System.err.println("* Close connection=" +
> Manager.getInstance().connections);
> System.err.println("");
> Manager.getInstance().connections -= 1;
> }
>
>...lots of other methods to do stuff to the database...
> }
>
> As you can see in the above two methods I have implemented a counter, this 
> serves to
> write to the log the number of connections in use at any one time.  The count 
> of course
> goes up and down as I move from page to page, but at the end of any page being
> posted it should continually return to zero.
>
> As in this output:
>
> * Open connection=1
>
> * Open connection=2
>
> * Open connection=3
>
> * Open connection=4
>
> * Open connection=5
>
> * Open connection=6
>
> * Open connection=7
> SQL:  SELECT itid, icid, stocode, sloname, stoname, scontent, iduckrank, 
> irank,
> iduration, simagename, ddateStart, ddateStop FROM Tour WHERE itid = '3' LIMIT 
> 0,
> 50
> * Close connection=7
>
> * Close connection=6
>
> * Close connection=5
>
> * Close connection=4
>
> * Close connection=3
>
> * Close connection=2
>
> * Close connection=1
>
>
> Good luck
> mc
>
>
> On 11 Oct 2005 at 15:02, emre akbas wrote:
>
> > Hi,
> > I have some general questions about connection pooling and exception
> > handling.
> > Struts suggests that developers use declarative exception handling. In
> > declarative exception handling, there are almost no "try { } catch() {}"
> > blocks in the Action classes. Exception occuring in Action classes are
> > handled by exception handlers outside the Action classes. Everything seems
> > OK so far.
> > It is very usual that we open a connection to the database at the beginning
> >

Re: how to sustain the sanity of the connection pool

2005-10-11 Thread Murray Collingwood
A pertinent question, had the same problem myself this afternoon.

I use Tomcat DBCP and found that each connection really does need to be closed. 
 If 
you don't your pool of connections is quickly depleted.

>From the many code samples I have looked at (not that many really) I find many 
>people 
extend the MVC concept to MVCD where D is the "DAO" or Data Access Object.  In 
my 
recent app I have declared a Dao class that provides by abstract database class 
and 
then defined all my databases to use this Dao super class.  I then have 
standard 
functions in the Dao class for managing my connections.  The connections 
themselves 
all come from a function in my persistence class (like a Manager.class with a 
getInstance() function).

Finally I can put println() calls in my persistence class to count the usage.  
This is of 
course very manual, maybe somebody has a better method.  What would be nice is 
if 
Tomcat had some monitor for the connection pool that we could watchprobably 
need 
to direct that question to the Tomcat list.

Visually my stuff looks like the following:

public class Manager {
private static Manager manager = new Manager();

public Manager getInstance() {
return manager;
}

public Connection getConnection() {
return dataSource.getConnection();
}

...a few other methods to support the above...
}

public class Dao {
/** Creates a new instance of Dao */
public Dao() {
try {
Manager.getInstance().connections += 1;
System.err.println("");
System.err.println("* Open connection=" + 
Manager.getInstance().connections);
connection = Manager.getInstance().getConnection(); 
if (connection == null)
System.err.println("ERROR: Dao: Failed to establish connection 
== null");
} catch (Exception e) {
System.err.println("ERROR: Dao: " + e.getMessage());
}
}

public void close() {
try {
if (rs != null) rs.close();
if (statement != null) statement.close();
if (connection != null) connection.close();
} catch (Exception e) {
System.err.println("ERROR: Dao: " + e.getMessage());
}
System.err.println("* Close connection=" + 
Manager.getInstance().connections);
System.err.println("");
Manager.getInstance().connections -= 1;
}

   ...lots of other methods to do stuff to the database...
}

As you can see in the above two methods I have implemented a counter, this 
serves to 
write to the log the number of connections in use at any one time.  The count 
of course 
goes up and down as I move from page to page, but at the end of any page being 
posted it should continually return to zero.

As in this output:

* Open connection=1

* Open connection=2

* Open connection=3

* Open connection=4

* Open connection=5

* Open connection=6

* Open connection=7
SQL:  SELECT itid, icid, stocode, sloname, stoname, scontent, iduckrank, irank, 
iduration, simagename, ddateStart, ddateStop FROM Tour WHERE itid = '3' LIMIT 
0, 
50
* Close connection=7

* Close connection=6

* Close connection=5

* Close connection=4

* Close connection=3

* Close connection=2

* Close connection=1


Good luck
mc


On 11 Oct 2005 at 15:02, emre akbas wrote:

> Hi,
> I have some general questions about connection pooling and exception
> handling.
> Struts suggests that developers use declarative exception handling. In
> declarative exception handling, there are almost no "try { } catch() {}"
> blocks in the Action classes. Exception occuring in Action classes are
> handled by exception handlers outside the Action classes. Everything seems
> OK so far.
> It is very usual that we open a connection to the database at the beginning
> of the Action class and then close it at the end. When an exception occurs,
> an exception-handler outside of our Action class (in which the exception is
> thrown) handles the exception. Then, what happens to the connection? We
> weren't able to close it, so does it continue to allocate a connection from
> the pool?
> My other question is about the connection pooling itself. Are there any
> tools or ideas to monitor the sanity of the connection pool? Are we somehow
> able to find the classes where leakage occur?
> Thanks in advance.
> 



FOCUS Computing
Mob: 0415 24 26 24
[EMAIL PROTECTED]
http://www.focus-computing.com.au



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.13/124 - Release Date: 7/10/2005


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai

how to sustain the sanity of the connection pool

2005-10-11 Thread emre akbas
Hi,
I have some general questions about connection pooling and exception
handling.
Struts suggests that developers use declarative exception handling. In
declarative exception handling, there are almost no "try { } catch() {}"
blocks in the Action classes. Exception occuring in Action classes are
handled by exception handlers outside the Action classes. Everything seems
OK so far.
It is very usual that we open a connection to the database at the beginning
of the Action class and then close it at the end. When an exception occurs,
an exception-handler outside of our Action class (in which the exception is
thrown) handles the exception. Then, what happens to the connection? We
weren't able to close it, so does it continue to allocate a connection from
the pool?
My other question is about the connection pooling itself. Are there any
tools or ideas to monitor the sanity of the connection pool? Are we somehow
able to find the classes where leakage occur?
Thanks in advance.


Re: html tags not parsed by taglibs

2005-10-11 Thread Gareth Evans

try using filter="false"

e.g.



Gareth

Kishore Senji wrote:

When you say "bean:write is not parsed", you mean that in the html source
that's generated you see "bean:write" in it? If so, you might have just
forgot the bean taglib reference (<%@ taglib ...%>)

On 10/10/05, Eric Plante <[EMAIL PROTECTED]> wrote:


Hi,

When I hardcode something like hello between

and  in my jsp page, it works.

if I put the same string in a property and use it in a bean:write, it's
not
parsed, the page shows the whole string which is not what I need.

Is there a way to make the bean:write parse the string in the jsp? And can
someone explain to me why bean:write acts like that?

Thanks


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







--
Gareth Evans

MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN

--
Tel:+44 (0)870 0100 704
Fax:+44 (0)870 9010 705
E-Mail: [EMAIL PROTECTED]
Web:www.msoft.co.uk

--
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
--
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Directory acces depending on user connected...

2005-10-11 Thread Gaet

Hi,

I have an application where I store PDF of each of my client...
I would like to know how to restrict the view of PDF to the client that PDF 
belongs to

Actually to view PDF I have a link like this :

www.mywebsite.com/mystrutslink.do?pdf=/pdf/clientId/test.pdf

As you may notice, the problem is that the link is displayed and if the client 
change the id by the one of another client he will see his PDF...

Thanks for your advices on this problem