RE: How To Handle Mis-Typing of URL By Users

2004-09-17 Thread David G. Friedman
Jen,

The question is are you trying to catch mistyped Struts URLS OR regular URL
resources such as JSPs, HTML, CSS, Javascript includes, Images, etc.?
For the former, you're barking up the wrong tree (see below).  For the
latter, your error-page code should work UNLESS those file types are NOT
being handled by your Java Server (perhaps locally by a front-end Apache?).

Some key documentation (uh, oh, I'm saying RTFM aren't I? LOL):
http://struts.apache.org/userGuide/building_controller.html#actionmapping

It explains a wonderful struts-config.xml Action Mapping feature:

unknown - Set to true if this action should be configured as the default for
this application, to handle all requests not handled by another action. Only
one action can be defined as a default within a single application.

So, if your URL is defined as http://www.yoursite.com/myapp/someAction.do
but the visitor ended up typing in a Struts URL you never configured in your
struts-config.xml file(s) such as
http://www.yoursite.com/myapp/someFraction.do, this struts-config.xml
mapping would catch it and other Struts URL mistypings:



And yes, I have used the "unknown" parameter at least once in a Struts v1.1
deployment, though not recently.

Regards,
David

-Original Message-
From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 16, 2004 9:34 AM
To: Struts Users Mailing List; Craig McClanahan
Subject: Re: How To Handle Mis-Typing of URL By Users


Hi, I prepared the error404.jsp (simply typed in a
warning sentence) and placed the file in the
AppName/WEB-INF/web.xml file this way:

  
index.jsp
  
  
404
/error404.jsp
  
  
  
 /tags/struts-bean

/WEB-INF/lib/struts-bean.tld

  

I tested mis-typing.  But, my sentence; i.e. the error
page that I prepared does not show up.

Would you be more clear about "map this condition
directly to a Struts action or URL mapped directly
to a servlet." in the servlet 2.4 environment?  I
still do not have any idea about how the mapping
should be done in the struts-config.xml file.



--- Craig McClanahan <[EMAIL PROTECTED]> wrote:

> On Wed, 15 Sep 2004 13:06:01 -0400, Bill Siggelkow
> <[EMAIL PROTECTED]> wrote:
> > Place this stancza below your welcome-file-list in
> your web.xml. You can
> > use a static HTML page or a JSP.
> >
> > 
> >  404
> >  /error404.jsp
> > 
> >
>
> In a servlet 2.4 environment, you could also map
> this condition
> directly to a Struts action or URL mapped directly
> to a servlet.
>
> > -Bill Siggelkow
> >
>
> Craig
>
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

-
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: JTidy integration?

2004-09-17 Thread Nestor Boscan
Hi

I have not used Struts with Jtidy but I've used the two technologies in
different projects. The way I see it you create a servlet filter that uses
the Tidy.parse method to parse the JSP output. Then you map the filter to
the main JSPs that includes the rest of the content. Everytime the
controller forwards or redirects your actions to the JSPs the servlet filter
will activate and pretty print the content.

Hope this helps

Regards, 

Néstor Boscán

-Mensaje original-
De: Dave Bender [mailto:[EMAIL PROTECTED] 
Enviado el: Friday, September 17, 2004 9:15 PM
Para: Struts Users Mailing List
Asunto: JTidy integration?

Has anybody integrated JTidy or any of the other HTML-prettifiers with
Struts?  I find Tidy does a good job of cleaning up JSPs, which tend to get
pretty spaced out particularly when there are lots of includes, but I don't
have a clear idea of where it would plug in.   Would it make sense to put it
into a servlet filter and then chain that onto the Struts controller
servlet?  Or is there a logical spot to put that functionality somewhere
inside the framework (attach to an action or something??).  Or would it be a
plug in?

Thoughts?

Dave


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



JTidy integration?

2004-09-17 Thread Dave Bender
Has anybody integrated JTidy or any of the other HTML-prettifiers with
Struts?  I find Tidy does a good job of cleaning up JSPs, which tend to get
pretty spaced out particularly when there are lots of includes, but I don't
have a clear idea of where it would plug in.   Would it make sense to put it
into a servlet filter and then chain that onto the Struts controller
servlet?  Or is there a logical spot to put that functionality somewhere
inside the framework (attach to an action or something??).  Or would it be a
plug in?

Thoughts?

Dave


Re: [OT] Apache/Tomcat restriction by IP address

2004-09-17 Thread Erik Weber
Thanks Niall.
The problem is, some stuff is served out of Apache's doc root, while 
other stuff is served by Tomcat. I am hoping to find a central place to 
install the IP restriction.

The valve won't restrict what is in Apache's doc root, and the .htaccess 
file won't restrict what is dispatched to Tomcat (I think .htaccess is 
at the file/directory level, and I need it at the URL level). However, 
.htaccess combined with valves seemingly would do the trick. I haven't 
tried it yet.

If anyone knows how to configure it all in Apache though, I would 
appreciate a tip. I think it might be done in httpd.conf, but I'm still 
trying to figure it out. Plus I have the problem of figuring out the 
nuances of the third-party hosting environment (for example, there *is* 
no httpd.conf :/).

Thanks,
Erik
Niall Pemberton wrote:
Don't know about Apache, but what about configuring Tomcat - doc say there
are remote filters which looks like they would do what you want:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html
Niall
- Original Message - 
From: "Erik Weber" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 10:35 PM
Subject: [OT] Apache/Tomcat restriction by IP address

 

I have a site running on a third-party box that uses Apache in front of
Tomcat. I need to restrict the entire site to a series of IP addresses.
Using the Deny, Order and Allow commands in a .htaccess file works for
whatever is in Apache's public document root. However, it doesn't
prevent requests that are dispatched to Tomcat.
For example, if I forbid my own IP address with this:
Deny from xxx.xx.xx.xxx
I cannot access anything in Apache's document root, but I can still
access any pages that are served by Tomcat. (Apache is configured to
dispatch *.jsp to Tomcat).
How can I tell Apache to filter *all* requests by IP address?
Thanks,
Erik
-
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: [OT] Apache/Tomcat restriction by IP address

2004-09-17 Thread Niall Pemberton
Don't know about Apache, but what about configuring Tomcat - doc say there
are remote filters which looks like they would do what you want:

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/config/valve.html

Niall


- Original Message - 
From: "Erik Weber" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 10:35 PM
Subject: [OT] Apache/Tomcat restriction by IP address


> I have a site running on a third-party box that uses Apache in front of
> Tomcat. I need to restrict the entire site to a series of IP addresses.
>
> Using the Deny, Order and Allow commands in a .htaccess file works for
> whatever is in Apache's public document root. However, it doesn't
> prevent requests that are dispatched to Tomcat.
>
> For example, if I forbid my own IP address with this:
>
> Deny from xxx.xx.xx.xxx
>
> I cannot access anything in Apache's document root, but I can still
> access any pages that are served by Tomcat. (Apache is configured to
> dispatch *.jsp to Tomcat).
>
> How can I tell Apache to filter *all* requests by IP address?
>
> Thanks,
> Erik
>
> -
> 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: Idea for chain and DB transactions

2004-09-17 Thread Sean Schofield
Robert,
Thanks for the feedback.  I took a look at Spring.  It seems interesting but 
I decided to pass on it right now rather than take the time to get up to 
speed on yet another framework.

I did take a look at ThreadLocal, however, and I think this will be perfect 
for what I need.  In fact I found an article that describes how to use 
ThreadLocal and uses JDBC connections in one of their examples 
(http://www-106.ibm.com/developerworks/java/library/j-threads3.html).

I had hear people mention ThreadLocal before but I never really knew what it 
was about.  Now that I've taken a look at it I'm pretty impressed.  It was 
interesting to learn that the initial implementation of ThreadLocal was very 
similar to what I was proposing here.  (Apparently, It has since evolved to 
be much more efficient than the initial implementation.)

I'm allways glad to check with others before embarking on a solution like 
this.  Often times I am on the right track but the collective experience of 
programmers can usually come up with a superior solution (much like Struts 
vs. my own efforts before discovering Struts.)

Thanks again!
sean

- Original Message - 
From: "Robert Taylor" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 3:17 PM
Subject: RE: Idea for chain and DB transactions


Sean, have you looked at Spring? It uses AOP and you can set up 
transactions declaratively.

I'm just starting to investigate using Spring and I'm really impressed.
Like you I had a requirement to demarcate transactions at a high level so 
that
all business objects within the transaction were subject to the same 
transaction
semantics unless a business object explicitely needed to be isolated.

I ended up creating a Transaction framework of sorts which uses 
ThreadLocal to
propogate the Connection to my DAO's. All DAO's that need to be included 
in a
transaction had to subclass a TransactionalDAO which "knew" how to access 
the
current TransactionContext from ThreadLocal.

It has worked for a couple years now, but its not that clean or elegant.
That's why I was so excited to read about Spring and IoC.  It does all 
that stuff
for you.

robert
-Original Message-
From: Sean Schofield [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 2:44 PM
To: [EMAIL PROTECTED]
Subject: Idea for chain and DB transactions
I have a problem and a proposed solution.  I would greatly appreciate any 
feedback about the proposed solution.

Problem:
===
I'm currently using a Struts application with a connection pool (using 
DBCP as supplied by Tomat).  When a database
update is needed, the Struts actions will call the facade which will talk 
to my service layer (currently POJO's which
handle business logic.)  My service layer in turn talks to the 
appropriate DAO.  Each of these DAO's extends from a
common abstract class that provides basic functionality including 
obtaining a connection from the DataSource (via the
pool).  A key aspect of my design is that some updates are in distinct 
areas of the database and so I have different
DAO's for each area (ex. one for "workflow" on for "document.")

As currently implemented I am unable to take advantage of transactions 
because the two DAOs will be getting a connection
indepently from the pool and they will most likely not obtain the 
connection each time.  If I could just get the same
connection each time, then I could use setAutoCommit(false).

Proposed Solution:
==
I'm thinking I could set up a few chains for the various kind of updates. 
The chains would be called by the POJO service
layer (instead of calling the DAO's directly.)  The first Command in the 
chain would be to indentify all database updates
in the chain as needing transactions.  This would be done through a 
static method on a new object called
TransactionManager.  Basically I would have a hashtable that would 
maintain connections for the duration of the chain.
The connections would be stored by the current thread (use that as the 
key to the table.)

Then when a command down the line needs a database connection, it would 
first check to see if there is one already set
aside for it to use.  Actually the command would call the DAO and the DAO 
would check.  The command would also be
decorated by a custom wrapper so that if the DAO's try to close the 
connection, I'll ignore it.  Then when the chain does
the post processing in reverse order.  So the last clean up step will be 
to check for my custom DAOException.  If there
is one, then rollback, otherwise commit.  Finally, the connection is 
removed from the TransactionManager.

I think this might be crazy enough to work.  I know we could allways use 
EJB and get transactions but that might be
overkill since the volume is very light (this is custom software for a 
government agency not ecommerce.)  Please let me
know what you think.  A big question I have is about storing and 
retrieving the datbase connect

Re: Idea for chain and DB transactions

2004-09-17 Thread dhay

You could take a look at the Spring framework - very cool!



|-+>
| |   "Sean Schofield" |
| |   <[EMAIL PROTECTED]|
| |   chof.com>|
| ||
| |   09/17/2004 03:04 |
| |   PM   |
| |   Please respond to|
| |   "Struts Users|
| |   Mailing List"|
| ||
|-+>
  
>|
  |
|
  |   To:   "Struts Users Mailing List" <[EMAIL PROTECTED]>
   |
  |   cc:  
|
  |   Subject:  Re: Idea for chain and DB transactions 
|
  
>|




I had thought about this but it involves duplicating each DAO method.  Also
if I ever wanted to switch to EJB I would have to undo all of the methods
again.  Its definitely an option though.  I was just hoping for something
that would involve less changes to my DAO's.

Thanks for the feedback.

sean

- Original Message -
From: "Erik Weber" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 2:49 PM
Subject: Re: Idea for chain and DB transactions


> Overload each existing DAO method with a secondary method that accepts
the
> Connection as a parameter instead of getting it on its own. Then let your
> service layer object obtain the Connection, set autocommit to false,
> invoke all the DAO methods you need, passing the customized Connection to
> each. Then commit and set autocommit back to true in your service layer
> object.
>
> Erik
>
>
> Sean Schofield wrote:
>
>>I have a problem and a proposed solution.  I would greatly appreciate any
>>feedback about the proposed solution.
>>
>>Problem:
>>===
>>I'm currently using a Struts application with a connection pool (using
>>DBCP as supplied by Tomat).  When a database update is needed, the Struts
>>actions will call the facade which will talk to my service layer
>>(currently POJO's which handle business logic.)  My service layer in turn
>>talks to the appropriate DAO.  Each of these DAO's extends from a common
>>abstract class that provides basic functionality including obtaining a
>>connection from the DataSource (via the pool).  A key aspect of my design
>>is that some updates are in distinct areas of the database and so I have
>>different DAO's for each area (ex. one for "workflow" on for "document.")
>>As currently implemented I am unable to take advantage of transactions
>>because the two DAOs will be getting a connection indepently from the
pool
>>and they will most likely not obtain the connection each time.  If I
could
>>just get the same connection each time, then I could use
>>setAutoCommit(false).
>>
>>Proposed Solution:
>>==
>>I'm thinking I could set up a few chains for the various kind of updates.
>>The chains would be called by the POJO service layer (instead of calling
>>the DAO's directly.)  The first Command in the chain would be to
indentify
>>all database updates in the chain as needing transactions.  This would be
>>done through a static method on a new object called TransactionManager.
>>Basically I would have a hashtable that would maintain connections for
the
>>duration of the chain.  The connections would be stored by the current
>>thread (use that as the key to the table.)
>>Then when a command down the line needs a database connection, it would
>>first check to see if there is one already set aside for it to use.
>>Actually the command would call the DAO and the DAO would check.  The
>>command would also be decorated by a custom wrapper so that if the DAO's
>>try to close the connection, I'll ignore it.  Then when the chain does
the
>>post processing in reverse order.  So the last clean up step will be to
>>check for my custom DAOException.  If there is one, then rollback,
>>otherwise commit.  Finally, the connection is removed from the
>>TransactionManager.
>>
>>I think this might be crazy enough to work.  I know we could allways use
>>EJB and get transactions but that might be overkill since the volume is
>>very light (this is custom software for a government agency not
>>ecommerce.)  Please let me know what you think.  A big question I have is
>>about storing and retrieving the datbase connection using the current
>>thread as the key to a hashtable.  Also, I know that I 

with module & page attributes

2004-09-17 Thread Craig Dickson
Hi,

After reading the email archives and the documentation, it is clear that
the  tag cannot be used with a module attribute and a page
attribute at the same time. I was just wondering why this is? Is there a
strong reason this was not implemented, or is it just a piece of missing
functionality?

Thanks.



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



[OT] Apache/Tomcat restriction by IP address

2004-09-17 Thread Erik Weber
I have a site running on a third-party box that uses Apache in front of 
Tomcat. I need to restrict the entire site to a series of IP addresses.

Using the Deny, Order and Allow commands in a .htaccess file works for 
whatever is in Apache's public document root. However, it doesn't 
prevent requests that are dispatched to Tomcat.

For example, if I forbid my own IP address with this:
Deny from xxx.xx.xx.xxx
I cannot access anything in Apache's document root, but I can still 
access any pages that are served by Tomcat. (Apache is configured to 
dispatch *.jsp to Tomcat).

How can I tell Apache to filter *all* requests by IP address?
Thanks,
Erik
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Content Management Across Multiple Apps

2004-09-17 Thread josh
what about using the crossContext feature of tomcat?  (and here i go out
on a limb without checking how sturdy it is, but I can't find much docs
on this)  Could I set up a servlet that was just a bunch of JSP's that I
use in all the apps?  

too many questions ;)


On Fri, 2004-09-17 at 08:32, josh wrote:
> Still interested to hear if anyone has any ideas about this...
> 
> On Wed, 2004-09-15 at 10:47, josh wrote:
> > Hi all,
> > 
> > I am writing multiple apps (~20) that all share the same sidebar
> > navigation.
> > 
> > Is there a way to make multiple applications use a central library of
> > tiles so that I would be able to change or add a link in the library and
> > it would affect all applications?
> > 
> > In such a scenario could I add a link without redeployment of an app?
> > (does restarting the tiles defs factory do this?)
> > 
> > If the above is not possible, I am also considering storing these links
> > in a DB so that adding or changing a link can be done without restarting
> > the app and it can be done in one simple step through an admin interface
> > or something. (DB caching in sql Maps should keep my DB from doing too
> > much extra work for this I hope) :O  
> > 
> > 
> > (I have decided not to use modules because there will be about 20
> > applications involved and I prefer to be able to reload them
> > individually if one needs maintenance, not having to do one monolithic
> > restart). 
> >  
> > -- thanks in advance, 
> > 
> > Joshua Cronemeyer

***


signature.asc
Description: This is a digitally signed message part


SAX parser anomaly

2004-09-17 Thread Woodchuck
hihi all,

has anyone encountered a SAX xml parsing error due to some
property/attribute of a physical file?

i'm getting that right now.  an xml file created by a legacy VMS system
is causing SAX parsing exceptions.  BUT, if i copy and paste the
contents of that file into my own file, i don't get any parsing errors
at all!

has anyone experienced this?

when doing a file comparison between these two files, they are exactly
the same.  i even looked at them using a hex editor and there are no
differences (ie. no invisible characters differences).

but, there must be a difference!  because when i copy and paste the
contents to a new file, that new file does not cause parsing errors. 
if i try to parse the original VMS created xml file, it causes errors.

so there is something different between these two files

anyone have any clues at all how i can find out why the anomaly?

thanks,
woodchuck



__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



Re: I'm going back to just using regular Actions.. a question

2004-09-17 Thread bmf5




We use option one - separate packages for actions, forms, dao, services,
util, etc.





   
 Rick Reumann  
 <[EMAIL PROTECTED] 
 .net>  To 
   Struts Users Mailing List   
 09/17/2004 02:41  <[EMAIL PROTECTED]>
 PM cc 
   
   Subject 
 Please respond to I'm going back to just using
   "Struts Users   regular Actions.. a question
   Mailing List"   
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   




After thinking about the flavors of Dispatch actions I use, and after
having used them as my primary type of Actions for the past 3+ years,
I've decided to go back to just using regular Actions. I like the
modular self contained Actions.

My question is more of design practice for those that just use standard
Actions. How do you design your packages? For example...

EmployeeUpdateAction:

1) package com.acme.ui.action.employee;

or

2) package com.acme.ui.employee.action;

or just put them all in one package:

3) package com.acme.ui.action;

I'm leaning towards option 1 myself. Other thoughts?

--
Rick


-
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: No Way to Put the init() Method Inside the ActionForward Execute( ... ) Method

2004-09-17 Thread Anna Kerekes
Why can't you call the init() method from inside the execute() method (at the 
beginning of it )?
 
Anna



From: Caroline Jen [mailto:[EMAIL PROTECTED]
Sent: Fri 17/09/2004 2:06 PM
To: [EMAIL PROTECTED]
Subject: No Way to Put the init() Method Inside the ActionForward Execute( ... ) Method



We cannot put a method inside another method.

When using the Struts, we start with:

public final class MyClass extends Action
{
public ActionForward execute( ActionMapping
mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws java.lang.Exception
{

...
...

}
}

I have a void init( ...) { ... } method shown below.
Of course, I cannot put this init( ... ) inside the
ActionForward Execute( ... ) { ... }

What am I supposed to do?  Do I put this void init(
... ) { ... } method before the ActionForward Execute(
... ) { ... } begins?

Code:
=
   String smtpServer;
 
   public void init(ServletConfig config) throws
ServletException
   {
  super.init(config);
  smtpServer =
config.getInitParameter("smtpServer");
   }
=


   
   
__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail

-
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: [OT] JSP 2.0 tag files and expressions

2004-09-17 Thread Laurie Harper
You summed it up perfectly. And that test case works for me too. As does 
my own now. I've no idea what I changed between last night and now, but 
everything's now fine! I'm glad of that but I hate mystery bugs...

L.
Kris Schneider wrote:
This worked on TC 5.0.28:
/WEB-INF/tags/tag1.tag:
---
<%@ tag body-content="empty" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags/" %>

/WEB-INF/tags/tag2.tag:
---
<%@ tag body-content="empty" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>

v: ${v}

tagfile.jsp:

<%@ taglib prefix="tags" tagdir="/WEB-INF/tags/" %>





Which generated:


v: 0
v: 1
v: 2
v: 3
v: 4


Is that what you were trying to do?
Quoting Laurie Harper <[EMAIL PROTECTED]>:

Sorry for the off-topic post but I'm sure someone here will be able to 
tell me what's going on with this... I'm trying to use the JSTL forEach 
tag in a tag file invoked by another tag file and I'm getting an error. 
Here's an example piece of JSP:

  
v: ${v}
  
That works fine in a JSP. It works fine in a tag file invoked from a 
JSP. But if the tag file is invoked from another tag file, I get the 
error "According to TLD or attribute directive in tag file, attribute 
end does not accept any expressions." I can use the expression language 
in other places (e.g. outside of custom tags) though.

Is this a limitation of tag files or of Tomcat's implementation of them? 
Or am I just doing something wrong? If it's a limitation of the JSP spec 
and/or Tomcat, is there a work-around? Otherwise tag files are about to 
become a whole lot less useful to me... :-(

L.


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


RE: No Way to Put the init() Method Inside the ActionForward Execute( ... ) Method

2004-09-17 Thread Ryan Chichirico
Why not write an InitServlet that is set to initialize prior to the struts
ActionServlet in web.xml?  This could override the init() method and provide
the services you need.

>From web.xml

  
init
com.xxx.xxx.servlet.InitServlet

   log4jProperties
   conf/log4j.properties

 3
  

Then your init() method could have something like:
public void init() {
realPath = getServletContext().getRealPath("/");
initLogging();
initDataSource();
etc...
}
-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 17, 2004 12:40 PM
To: Struts Users Mailing List
Subject: Re: No Way to Put the init() Method Inside the ActionForward
Execute( ... ) Method


I would write a Struts Plug-In (very easy) and initialize the 
"smtpServer" variable (and similar variables) there, making the 
configured value available to the rest of the application (including 
your Actions) by setting an Application scope attribute (this also 
abstracts the configuration so that in the future you might configure it 
in a properties file or source file instead of web.xml).

For example:

form.getServlet().getServletContext().getAttribute("smtpServer");


Erik


Caroline Jen wrote:

>We cannot put a method inside another method.
>
>When using the Struts, we start with:
>
>public final class MyClass extends Action
>{
>public ActionForward execute( ActionMapping
>mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response )
>throws java.lang.Exception
>{
>
>...
>...
>
>}
>}
>
>I have a void init( ...) { ... } method shown below.
>Of course, I cannot put this init( ... ) inside the
>ActionForward Execute( ... ) { ... }
>
>What am I supposed to do?  Do I put this void init(
>... ) { ... } method before the ActionForward Execute(
>... ) { ... } begins?
>
>Code:
>=
>   String smtpServer;
>  
>   public void init(ServletConfig config) throws ServletException
>   {
>  super.init(config);
>  smtpServer =
>config.getInitParameter("smtpServer");
>   }
>=
>
>
>   
>   
>__
>Do you Yahoo!?
>New and Improved Yahoo! Mail - 100MB free storage! 
>http://promotions.yahoo.com/new_mail
>
>-
>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: Idea for chain and DB transactions

2004-09-17 Thread Robert Taylor
Sean, have you looked at Spring? It uses AOP and you can set up transactions 
declaratively.

I'm just starting to investigate using Spring and I'm really impressed. 
Like you I had a requirement to demarcate transactions at a high level so that
all business objects within the transaction were subject to the same transaction
semantics unless a business object explicitely needed to be isolated. 

I ended up creating a Transaction framework of sorts which uses ThreadLocal to 
propogate the Connection to my DAO's. All DAO's that need to be included in a 
transaction had to subclass a TransactionalDAO which "knew" how to access the
current TransactionContext from ThreadLocal.

It has worked for a couple years now, but its not that clean or elegant. 

That's why I was so excited to read about Spring and IoC.  It does all that stuff
for you.

robert

> -Original Message-
> From: Sean Schofield [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 2:44 PM
> To: [EMAIL PROTECTED]
> Subject: Idea for chain and DB transactions
> 
> 
> I have a problem and a proposed solution.  I would greatly appreciate any feedback 
> about the proposed solution.
> 
> Problem:
> ===
> I'm currently using a Struts application with a connection pool (using DBCP as 
> supplied by Tomat).  When a database 
> update is needed, the Struts actions will call the facade which will talk to my 
> service layer (currently POJO's which 
> handle business logic.)  My service layer in turn talks to the appropriate DAO.  
> Each of these DAO's extends from a 
> common abstract class that provides basic functionality including obtaining a 
> connection from the DataSource (via the 
> pool).  A key aspect of my design is that some updates are in distinct areas of the 
> database and so I have different 
> DAO's for each area (ex. one for "workflow" on for "document.")  
> 
> As currently implemented I am unable to take advantage of transactions because the 
> two DAOs will be getting a connection 
> indepently from the pool and they will most likely not obtain the connection each 
> time.  If I could just get the same 
> connection each time, then I could use setAutoCommit(false).
> 
> Proposed Solution:
> ==
> I'm thinking I could set up a few chains for the various kind of updates.  The 
> chains would be called by the POJO service 
> layer (instead of calling the DAO's directly.)  The first Command in the chain would 
> be to indentify all database updates 
> in the chain as needing transactions.  This would be done through a static method on 
> a new object called 
> TransactionManager.  Basically I would have a hashtable that would maintain 
> connections for the duration of the chain.  
> The connections would be stored by the current thread (use that as the key to the 
> table.)  
> 
> Then when a command down the line needs a database connection, it would first check 
> to see if there is one already set 
> aside for it to use.  Actually the command would call the DAO and the DAO would 
> check.  The command would also be 
> decorated by a custom wrapper so that if the DAO's try to close the connection, I'll 
> ignore it.  Then when the chain does 
> the post processing in reverse order.  So the last clean up step will be to check 
> for my custom DAOException.  If there 
> is one, then rollback, otherwise commit.  Finally, the connection is removed from 
> the TransactionManager.
> 
> I think this might be crazy enough to work.  I know we could allways use EJB and get 
> transactions but that might be 
> overkill since the volume is very light (this is custom software for a government 
> agency not ecommerce.)  Please let me 
> know what you think.  A big question I have is about storing and retrieving the 
> datbase connection using the current 
> thread as the key to a hashtable.  Also, I know that I will have to be careful with 
> thread synchronization.
> 
> Thanks,
> sean
> 
> 

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



RE: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Robert Taylor
Yep. I usually bunch all action type stuff in the action package.
Like forms, action utils, value objects used in actions, etc...
I guess it more or less represents the presentation part of the package
and the service represents the business part. I only see a need to dissect
it into these two because the actions should only need to talk to the 
service layer. The service layer should be talking to reusable components
in some other package like com.acme.components.whatever.

robert

> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 3:05 PM
> To: Struts Users Mailing List
> Subject: Re: I'm going back to just using regular Actions.. a question
> 
> 
> Robert Taylor wrote the following on 9/17/2004 2:58 PM:
> 
> > com.acme.applications.web.foo.account.action
> > com.acme.applications.web.foo.account.service
> 
> Yea that was my option 2 I posted. I'm still debating about this one as 
> well. I can see both approaches being decent:
> 
> 
> com.acme.applications.web.foo.account.action
> com.acme.applications.web.foo.account.form
> 
> com.acme.applications.web.foo.service.action
> com.acme.applications.web.foo.service.form
> 
> OR:
> 
> com.acme.applications.web.foo.action.account
> com.acme.applications.web.foo.action.service
> 
> com.acme.applications.web.foo.form.account
> com.acme.applications.web.foo.form.service
> 
> 
> I'm leaning towards the later approach since when I'm looking for 
> something I usually know that I'm looking for a form or an action so I 
> can then look to that top level and go down.
> 
> -- 
> Rick
> 
> -
> 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: Idea for chain and DB transactions

2004-09-17 Thread Sean Schofield
I had thought about this but it involves duplicating each DAO method.  Also 
if I ever wanted to switch to EJB I would have to undo all of the methods 
again.  Its definitely an option though.  I was just hoping for something 
that would involve less changes to my DAO's.

Thanks for the feedback.
sean
- Original Message - 
From: "Erik Weber" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 2:49 PM
Subject: Re: Idea for chain and DB transactions


Overload each existing DAO method with a secondary method that accepts the 
Connection as a parameter instead of getting it on its own. Then let your 
service layer object obtain the Connection, set autocommit to false, 
invoke all the DAO methods you need, passing the customized Connection to 
each. Then commit and set autocommit back to true in your service layer 
object.

Erik
Sean Schofield wrote:
I have a problem and a proposed solution.  I would greatly appreciate any 
feedback about the proposed solution.

Problem:
===
I'm currently using a Struts application with a connection pool (using 
DBCP as supplied by Tomat).  When a database update is needed, the Struts 
actions will call the facade which will talk to my service layer 
(currently POJO's which handle business logic.)  My service layer in turn 
talks to the appropriate DAO.  Each of these DAO's extends from a common 
abstract class that provides basic functionality including obtaining a 
connection from the DataSource (via the pool).  A key aspect of my design 
is that some updates are in distinct areas of the database and so I have 
different DAO's for each area (ex. one for "workflow" on for "document.")
As currently implemented I am unable to take advantage of transactions 
because the two DAOs will be getting a connection indepently from the pool 
and they will most likely not obtain the connection each time.  If I could 
just get the same connection each time, then I could use 
setAutoCommit(false).

Proposed Solution:
==
I'm thinking I could set up a few chains for the various kind of updates. 
The chains would be called by the POJO service layer (instead of calling 
the DAO's directly.)  The first Command in the chain would be to indentify 
all database updates in the chain as needing transactions.  This would be 
done through a static method on a new object called TransactionManager. 
Basically I would have a hashtable that would maintain connections for the 
duration of the chain.  The connections would be stored by the current 
thread (use that as the key to the table.)
Then when a command down the line needs a database connection, it would 
first check to see if there is one already set aside for it to use. 
Actually the command would call the DAO and the DAO would check.  The 
command would also be decorated by a custom wrapper so that if the DAO's 
try to close the connection, I'll ignore it.  Then when the chain does the 
post processing in reverse order.  So the last clean up step will be to 
check for my custom DAOException.  If there is one, then rollback, 
otherwise commit.  Finally, the connection is removed from the 
TransactionManager.

I think this might be crazy enough to work.  I know we could allways use 
EJB and get transactions but that might be overkill since the volume is 
very light (this is custom software for a government agency not 
ecommerce.)  Please let me know what you think.  A big question I have is 
about storing and retrieving the datbase connection using the current 
thread as the key to a hashtable.  Also, I know that I will have to be 
careful with thread synchronization.

Thanks,
sean

-
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: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Rick Reumann
Robert Taylor wrote the following on 9/17/2004 2:58 PM:
com.acme.applications.web.foo.account.action
com.acme.applications.web.foo.account.service
Yea that was my option 2 I posted. I'm still debating about this one as 
well. I can see both approaches being decent:

com.acme.applications.web.foo.account.action
com.acme.applications.web.foo.account.form
com.acme.applications.web.foo.service.action
com.acme.applications.web.foo.service.form
OR:
com.acme.applications.web.foo.action.account
com.acme.applications.web.foo.action.service
com.acme.applications.web.foo.form.account
com.acme.applications.web.foo.form.service
I'm leaning towards the later approach since when I'm looking for 
something I usually know that I'm looking for a form or an action so I 
can then look to that top level and go down.

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


Re: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Frank W. Zammetti (MLists)
Yes, that's exactly what happens.  I understand your approach, even like
it!  :)

I think what it comes down to is do you break things up in an
object-oriented way or a functional way?

It can be argued that done as you say, you are breaking it up based on
objects, which mimics how we generally develop nowadays, so it makes
sense.  On the other hand, my approach indicates that all the classes in
the actions package serve the same general functional purpose.

I'm not sure either is more correct in any way than the other... I
personally find it easier to work on a project when I don't have to flip
between a large number of directories (or, in a related kind of way, a lot
of classes).  I'm kind of old-school in this regard... The more of a piece
of code I have right in front of me in one place, the better.  This is
largely contrary to OOP ideals, and sometimes I have to fight myself to
NOT do what feels natural after so many years :)

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Fri, September 17, 2004 2:57 pm, Rick Reumann said:
> Frank W. Zammetti (MLists) wrote the following on 9/17/2004 2:54 PM:
>
>> I personally use #3.
>
> 
>
>> com.company.project
>>  |
>>  *---actionforms
>>  |
>>  *---actions
>>  |
>
> Won't you end up with a TON of Actions though in one package?
>
> EmployeeUpdateAction
> EmployeeDeleteAction
> EmployeeSearchSetUpAction
> EmployeeSearchGetAction
> FooBarInsertAction
> FooBarDeleteAction
>
> I was thinking of breaking it up a bit so all the related Employee
> actions would be in one package under Action and same thing with FooBar.
>
>
> --
> Rick
>
> -
> 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: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Robert Taylor
Rick, 

I have been using the following package layout for a while and it seems to make sense.

For example, let's say the foo web application consists of various sub applications 
like
account, store, product download, etc


com.acme.applications.web.foo.account.action
com.acme.applications.web.foo.account.service

com.acme.applications.web.foo.store.action
com.acme.applications.web.foo.store.service

etc...


May not be the best way, but like I said, it seems to make sense and it works for me.


robert




> -Original Message-
> From: Rick Reumann [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 2:42 PM
> To: Struts Users Mailing List
> Subject: I'm going back to just using regular Actions.. a question
> 
> 
> After thinking about the flavors of Dispatch actions I use, and after 
> having used them as my primary type of Actions for the past 3+ years, 
> I've decided to go back to just using regular Actions. I like the 
> modular self contained Actions.
> 
> My question is more of design practice for those that just use standard 
> Actions. How do you design your packages? For example...
> 
> EmployeeUpdateAction:
>   
> 1) package com.acme.ui.action.employee;
>   
> or
>   
> 2) package com.acme.ui.employee.action;
>   
> or just put them all in one package:
>   
> 3) package com.acme.ui.action;
> 
> I'm leaning towards option 1 myself. Other thoughts?
> 
> -- 
> Rick
> 
> 
> -
> 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: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Rick Reumann
Frank W. Zammetti (MLists) wrote the following on 9/17/2004 2:54 PM:
I personally use #3.   

com.company.project
 |
 *---actionforms
 |
 *---actions
 |
Won't you end up with a TON of Actions though in one package?
EmployeeUpdateAction
EmployeeDeleteAction
EmployeeSearchSetUpAction
EmployeeSearchGetAction
FooBarInsertAction
FooBarDeleteAction
I was thinking of breaking it up a bit so all the related Employee 
actions would be in one package under Action and same thing with FooBar.

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


Re: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Frank W. Zammetti (MLists)
Forgot to mention, although you probably guessed... Any other class
specific to the app that doesn't fit any of the categories (things like
helper classes used in may different Actions) are in com.company.project.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Fri, September 17, 2004 2:54 pm, Frank W. Zammetti (MLists) said:
> I personally use #3.  In fact, all my projects have a pretty
> internally-standard packaging scheme (my own creation)...
>
> com.company.project
>  |
>  *---actionforms
>  |
>  *---actions
>  |
>  *---business
>  |
>  *---config
>  |
>  *---daemonthreads
>  |
>  *---exceptions
>  |
>  *---listeners
>  |
>  *---plugins
>  |
>  *---webservices
>
> actionforms and actions are self-explanatory, business is any business
> delegate class (i.e., anything specific to the app but not tied to the
> presentation), config is any app-specific configuration classes,
> deamonthreads is any background threads, exceptions is any custom
> exception classes specific to the app, listeners are any HTTP listeners,
> plugins are any Struts plug-ins and webservices is any Web Service-related
> code.
>
> All but the first two are optional in any given project.  Any class that
> is shared with other projects in is com.company (possibly in a package
> underneath that).
>
> It's just what I've settled on... Works for me.
>
> --
> Frank W. Zammetti
> Founder and Chief Software Architect
> Omnytex Technologies
> http://www.omnytex.com
>
> On Fri, September 17, 2004 2:41 pm, Rick Reumann said:
>> After thinking about the flavors of Dispatch actions I use, and after
>> having used them as my primary type of Actions for the past 3+ years,
>> I've decided to go back to just using regular Actions. I like the
>> modular self contained Actions.
>>
>> My question is more of design practice for those that just use standard
>> Actions. How do you design your packages? For example...
>>
>> EmployeeUpdateAction:
>>
>> 1) package com.acme.ui.action.employee;
>>
>> or
>>
>> 2) package com.acme.ui.employee.action;
>>
>> or just put them all in one package:
>>
>> 3) package com.acme.ui.action;
>>
>> I'm leaning towards option 1 myself. Other thoughts?
>>
>> --
>> Rick
>>
>>
>> -
>> 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: I'm going back to just using regular Actions.. a question

2004-09-17 Thread Frank W. Zammetti (MLists)
I personally use #3.  In fact, all my projects have a pretty
internally-standard packaging scheme (my own creation)...

com.company.project
 |
 *---actionforms
 |
 *---actions
 |
 *---business
 |
 *---config
 |
 *---daemonthreads
 |
 *---exceptions
 |
 *---listeners
 |
 *---plugins
 |
 *---webservices

actionforms and actions are self-explanatory, business is any business
delegate class (i.e., anything specific to the app but not tied to the
presentation), config is any app-specific configuration classes,
deamonthreads is any background threads, exceptions is any custom
exception classes specific to the app, listeners are any HTTP listeners,
plugins are any Struts plug-ins and webservices is any Web Service-related
code.

All but the first two are optional in any given project.  Any class that
is shared with other projects in is com.company (possibly in a package
underneath that).

It's just what I've settled on... Works for me.

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Fri, September 17, 2004 2:41 pm, Rick Reumann said:
> After thinking about the flavors of Dispatch actions I use, and after
> having used them as my primary type of Actions for the past 3+ years,
> I've decided to go back to just using regular Actions. I like the
> modular self contained Actions.
>
> My question is more of design practice for those that just use standard
> Actions. How do you design your packages? For example...
>
> EmployeeUpdateAction:
>
> 1) package com.acme.ui.action.employee;
>
> or
>
> 2) package com.acme.ui.employee.action;
>
> or just put them all in one package:
>
> 3) package com.acme.ui.action;
>
> I'm leaning towards option 1 myself. Other thoughts?
>
> --
> Rick
>
>
> -
> 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: Idea for chain and DB transactions

2004-09-17 Thread Erik Weber
Overload each existing DAO method with a secondary method that accepts 
the Connection as a parameter instead of getting it on its own. Then let 
your service layer object obtain the Connection, set autocommit to 
false, invoke all the DAO methods you need, passing the customized 
Connection to each. Then commit and set autocommit back to true in your 
service layer object.

Erik
Sean Schofield wrote:
I have a problem and a proposed solution.  I would greatly appreciate any feedback 
about the proposed solution.
Problem:
===
I'm currently using a Struts application with a connection pool (using DBCP as supplied by Tomat).  When a database update is needed, the Struts actions will call the facade which will talk to my service layer (currently POJO's which handle business logic.)  My service layer in turn talks to the appropriate DAO.  Each of these DAO's extends from a common abstract class that provides basic functionality including obtaining a connection from the DataSource (via the pool).  A key aspect of my design is that some updates are in distinct areas of the database and so I have different DAO's for each area (ex. one for "workflow" on for "document.")  

As currently implemented I am unable to take advantage of transactions because the two 
DAOs will be getting a connection indepently from the pool and they will most likely 
not obtain the connection each time.  If I could just get the same connection each 
time, then I could use setAutoCommit(false).
Proposed Solution:
==
I'm thinking I could set up a few chains for the various kind of updates.  The chains would be called by the POJO service layer (instead of calling the DAO's directly.)  The first Command in the chain would be to indentify all database updates in the chain as needing transactions.  This would be done through a static method on a new object called TransactionManager.  Basically I would have a hashtable that would maintain connections for the duration of the chain.  The connections would be stored by the current thread (use that as the key to the table.)  

Then when a command down the line needs a database connection, it would first check to 
see if there is one already set aside for it to use.  Actually the command would call 
the DAO and the DAO would check.  The command would also be decorated by a custom 
wrapper so that if the DAO's try to close the connection, I'll ignore it.  Then when 
the chain does the post processing in reverse order.  So the last clean up step will 
be to check for my custom DAOException.  If there is one, then rollback, otherwise 
commit.  Finally, the connection is removed from the TransactionManager.
I think this might be crazy enough to work.  I know we could allways use EJB and get 
transactions but that might be overkill since the volume is very light (this is custom 
software for a government agency not ecommerce.)  Please let me know what you think.  
A big question I have is about storing and retrieving the datbase connection using the 
current thread as the key to a hashtable.  Also, I know that I will have to be careful 
with thread synchronization.
Thanks,
sean
 

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


Idea for chain and DB transactions

2004-09-17 Thread Sean Schofield
I have a problem and a proposed solution.  I would greatly appreciate any feedback 
about the proposed solution.

Problem:
===
I'm currently using a Struts application with a connection pool (using DBCP as 
supplied by Tomat).  When a database update is needed, the Struts actions will call 
the facade which will talk to my service layer (currently POJO's which handle business 
logic.)  My service layer in turn talks to the appropriate DAO.  Each of these DAO's 
extends from a common abstract class that provides basic functionality including 
obtaining a connection from the DataSource (via the pool).  A key aspect of my design 
is that some updates are in distinct areas of the database and so I have different 
DAO's for each area (ex. one for "workflow" on for "document.")  

As currently implemented I am unable to take advantage of transactions because the two 
DAOs will be getting a connection indepently from the pool and they will most likely 
not obtain the connection each time.  If I could just get the same connection each 
time, then I could use setAutoCommit(false).

Proposed Solution:
==
I'm thinking I could set up a few chains for the various kind of updates.  The chains 
would be called by the POJO service layer (instead of calling the DAO's directly.)  
The first Command in the chain would be to indentify all database updates in the chain 
as needing transactions.  This would be done through a static method on a new object 
called TransactionManager.  Basically I would have a hashtable that would maintain 
connections for the duration of the chain.  The connections would be stored by the 
current thread (use that as the key to the table.)  

Then when a command down the line needs a database connection, it would first check to 
see if there is one already set aside for it to use.  Actually the command would call 
the DAO and the DAO would check.  The command would also be decorated by a custom 
wrapper so that if the DAO's try to close the connection, I'll ignore it.  Then when 
the chain does the post processing in reverse order.  So the last clean up step will 
be to check for my custom DAOException.  If there is one, then rollback, otherwise 
commit.  Finally, the connection is removed from the TransactionManager.

I think this might be crazy enough to work.  I know we could allways use EJB and get 
transactions but that might be overkill since the volume is very light (this is custom 
software for a government agency not ecommerce.)  Please let me know what you think.  
A big question I have is about storing and retrieving the datbase connection using the 
current thread as the key to a hashtable.  Also, I know that I will have to be careful 
with thread synchronization.

Thanks,
sean



Re: No Way to Put the init() Method Inside the ActionForward Execute( ... ) Method

2004-09-17 Thread Erik Weber
I would write a Struts Plug-In (very easy) and initialize the 
"smtpServer" variable (and similar variables) there, making the 
configured value available to the rest of the application (including 
your Actions) by setting an Application scope attribute (this also 
abstracts the configuration so that in the future you might configure it 
in a properties file or source file instead of web.xml).

For example:
form.getServlet().getServletContext().getAttribute("smtpServer");
Erik
Caroline Jen wrote:
We cannot put a method inside another method.
When using the Struts, we start with:
public final class MyClass extends Action
{
   public ActionForward execute( ActionMapping
mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response )
   throws java.lang.Exception
   {
   ...
   ...
   }
}
I have a void init( ...) { ... } method shown below. 
Of course, I cannot put this init( ... ) inside the
ActionForward Execute( ... ) { ... }

What am I supposed to do?  Do I put this void init(
... ) { ... } method before the ActionForward Execute(
... ) { ... } begins?
Code:
=
  String smtpServer;
 
  public void init(ServletConfig config) throws
ServletException
  {
 super.init(config);
 smtpServer =
config.getInitParameter("smtpServer");
  }
=

	
		
__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

-
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]


I'm going back to just using regular Actions.. a question

2004-09-17 Thread Rick Reumann
After thinking about the flavors of Dispatch actions I use, and after 
having used them as my primary type of Actions for the past 3+ years, 
I've decided to go back to just using regular Actions. I like the 
modular self contained Actions.

My question is more of design practice for those that just use standard 
Actions. How do you design your packages? For example...

EmployeeUpdateAction:

1) package com.acme.ui.action.employee;

or

2) package com.acme.ui.employee.action;

or just put them all in one package:

3) package com.acme.ui.action;
I'm leaning towards option 1 myself. Other thoughts?
--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


input parameter not context relative?

2004-09-17 Thread Dave Bender
Isn't an Action's 'input' parameter supposed to be context relative?  
I thought that it was supposed to be, but I'm seeing otherwise when 
my form, which is in a module, fails its validation test.

Instead of returning to the input form, it is forwarding to the input
form prefixed with the module name.   In my profile-config.xml file, 
which configures the module, I have this  Action:


  



When I fill in the form correctly, the request gets forwarded on to 
the next form, email.jsp, which is located in /jsp/pages/profile.

But if it fails validation, it is getting sent to 
/profile/jsp/pages/profile/index.jsp, which doesn't exist, which pops
 up an error message. 

Here's the log file output, which seems to confirm the problem:

-  Validation failed, returning to '/jsp/pages/profile/index.jsp'
-  Delegating via forward to '/profile/jsp/pages/profile/index.jsp'


How do I get around this?  Many thanks in advance.   I really 
appreciate the help I've gotten from folks on this list.


Dave

No Way to Put the init() Method Inside the ActionForward Execute( ... ) Method

2004-09-17 Thread Caroline Jen
We cannot put a method inside another method.

When using the Struts, we start with:

public final class MyClass extends Action
{
public ActionForward execute( ActionMapping
mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response )
throws java.lang.Exception
{

...
...

}
}

I have a void init( ...) { ... } method shown below. 
Of course, I cannot put this init( ... ) inside the
ActionForward Execute( ... ) { ... }

What am I supposed to do?  Do I put this void init(
... ) { ... } method before the ActionForward Execute(
... ) { ... } begins?

Code:
=
   String smtpServer;
  
   public void init(ServletConfig config) throws
ServletException
   {
  super.init(config);
  smtpServer =
config.getInitParameter("smtpServer");
   }
=




__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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



RE: Struts Taglib Question

2004-09-17 Thread ravi.vedala

If you want to have a default value, simply set the default value in the form bean.

Eg :

XYZForm{
String name = "Ryan";

public String getName(){
return name;
}
public String setName(String name){
this.name = name;
}
}

-Original Message-
From: Asleson, Ryan [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 7:27 PM
To: '[EMAIL PROTECTED]'
Subject: Struts Taglib Question



Hello,

Is there some sort of Struts tag that I can use to set the property of a bean?

I have a small fragment that I want to look like this:


<%-- Set the event.date property on formBean to a default value --%> 
  .


It says that "if the event.date property on formBean is an empty String then set it to 
a default value."  I want to do it because I want the following select tag to have a 
specific default date selected instead of a random one being the deault select.

I just want to be able to set the event.date property to a default value if it's 
already an empty String.  I'm looking for a tag to do it because this JSP page is 
generated via XSLT from another XML document, and there could be many bean properties 
that need to be defaulted.  I want to be able to preserve the use of the dot notation 
for nested parameters.

Basically, I want a tag something like this:



Is there any way I can do this?

Thanks!!



This e-mail message is being sent solely for use by the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please contact the 
sender by phone or reply by e-mail, delete the original message and destroy all 
copies. Thank you.

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




Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

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



FW: [Myfaces-develop] [FYI] Nirvana - HTML2JSF converter

2004-09-17 Thread Matthias Wessendorf
FYI

Regards,
Matthias

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Takashi Okamoto
Sent: Friday, September 17, 2004 6:23 PM
To: [EMAIL PROTECTED]
Subject: [Myfaces-develop] [FYI] Nirvana - HTML2JSF converter


Hi, 

I would like you to inform Nirvana which is HTML Compiler. You could
write your server pages as POHP(Plain Old HTML Pages) like POJO. Nirvana
compile HTML pages into JSF pages. It seems really cool.

[Nirvana Project]
https://enterprise-incubator.dev.java.net/

[Demo Applicaiton]
https://nirvana.dev.java.net/files/documents/2158/6900/demo.war

regards,

Takashi Okamoto



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
___
Myfaces-develop mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/myfaces-develop


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



Re: Setting initial value on html:radio

2004-09-17 Thread Ricardo Gladwell
Martin Schaefer wrote:
Can you set the
value somewhere in the session and pick it up again in the second
form's reset method? Maybe I didn't understand your problem entirely...
Thanks, that worked perfectly :) But, the JavaDoc states that the 
reset() method should not be used for initialisation. Should this be 
revised?

Ricardo Gladwell <[EMAIL PROTECTED]> schrieb am
17.09.2004, 17:08:33:
Hi All,
I'm trying to set the initial value on a set of  elements. 
Unlike other html tags, I notice there is no way to specify the initial 
value unless you specify the value in the form bean constructor/reset 
method itself.

I am forwarding to a page containing and html:form with radio buttons 
from another action. The action form bean for the pre-action has a value 
I would like to pass onto the new form. How do I transfer this 
information from one form bean to another? It seems the only means of 
communication is the JSP itself and I don't really want to hack it with 
scriplets to copy the value from one form bean to another.

Is there method of doing this?
Kind regards,
-- Ricardo Gladwell
-
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]


tiles-definition - role association issue

2004-09-17 Thread Ashutosh Satyam
As per the Tiles Definition file syntax
 In the tiles definition we can specify the role 
 (Role to be checked when definition will be inserted in a page.)
  
Similarly, It is possible to associate a role with tiles: put attribute.

I'm intending to allow the definition to be used based on the role.

The second scenario works fine for me.
I have my Login page for the application as stated below.

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











Depending upon the user's role, correct definition is inserted.

Now going on the same lines, when I have a definition with role specified, it  
doesn't seem to work. My tiles-definition is as follows.












 

This definition (Add) gets applied for each of my role, though I was presuming that
only for the user with 'admin' role this definition will be executed.

What am I missing? Is it not a correct approach?
Kindly give some solution to achieve it.


Regards,
Ashutosh




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



Test Mail - Ignore it

2004-09-17 Thread Ashutosh Satyam
This it test mail. Kindly ignore it.

 [EMAIL PROTECTED]

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



Re: Validator - Browser Compatibility Issue

2004-09-17 Thread Matt Bathje
Seyhan Basmaci wrote:
Hi,
We have upgraded to Struts 1.2.2 , but we have encountered a problem. Embedded 
JavaScript validators use the following code
function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
var formName = form.getAttributeNode("name");
...
However, getAttributeNode is compatible with IE6.0+. Still many clients use IE5.0 & 
5.5. Does anyone know whether this incopatibility will be fixed?
Regards,


Seyhan -
This is probably something you need to ask on the commons/validator user 
list and not on the struts list.

From what I remember, this change came about because of the new 
"multiple forms on the same page" feature of validator. The original 
patch used the form.name property, but that messed up if you had a form 
element with the name of "name". The options to fix that were to use 
getAttributeNode or a big nasty loop through the form elements, and 
getAttributeNode was chosen.

I would say this isn't a huge problem though, for 2 reasons. The first 
is that the purpose of using vaildator is that you have client and 
server side validation. In addition to that, most "browser statistics" 
sites put IE5.5 (and lower) as being less than 10% of usage. You would 
be doing a lot of work to support a very small population if you wanted 
this "fixed".

Also, just FYI, Struts 1.2.2 is not a good version to be using. It is 
probably best if you upgrade to the 1.2.4 build from the struts 
acquiring page. (not the downloads page!)

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


Re: Setting initial value on html:radio

2004-09-17 Thread Martin_Schaefer

On radio buttons
http://www.jguru.com/faq/view.jsp?EID=1028442
has helped me. With the special problem you described. Can you set the
value somewhere in the session and pick it up again in the second
form's reset method? Maybe I didn't understand your problem entirely...


Ricardo Gladwell <[EMAIL PROTECTED]> schrieb am
17.09.2004, 17:08:33:
> Hi All,
> 
> I'm trying to set the initial value on a set of  elements. 
> Unlike other html tags, I notice there is no way to specify the initial 
> value unless you specify the value in the form bean constructor/reset 
> method itself.
> 
> I am forwarding to a page containing and html:form with radio buttons 
> from another action. The action form bean for the pre-action has a value 
> I would like to pass onto the new form. How do I transfer this 
> information from one form bean to another? It seems the only means of 
> communication is the JSP itself and I don't really want to hack it with 
> scriplets to copy the value from one form bean to another.
> 
> Is there method of doing this?
> 
> Kind regards,
> -- Ricardo Gladwell
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Martin Schaefer
NAXOS Software Solutions GmbH i.G.
Herrenstr. 1
69502 Hemsbach
Germany
 
Phone:+49 (0) 6201 49298-2
Mobile: +49 (0) 172 6269246
Fax: +49 (0) 6201 49298-1
Mail: [EMAIL PROTECTED]

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



Re: "Resources not defined for Validator"

2004-09-17 Thread Andrew Close
Dave,

On Fri, 17 Sep 2004 10:20:53 -0500, Dave Bender <[EMAIL PROTECTED]> wrote:



> I'm concluding that if I have multiple modules, I need the Plug-Ins plugged into 
> each module, correct?  The benefit being I can keep validation rules contained in 
> different files for different modules if I so choose?  That is I could put the 
> 'profile' validation rules in profile-validation.xml with this:
> 
>   value="/WEB-INF/validator-rules.xml,/WEB-INF/profile-validation.xml" />

yes, it is my understanding that the plug-in needs to be defined in
the module you are working with.  so if you are using more than one
module you can validate some and not have to validate all by only
including the plug-in in those modules that you want validated.

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



RE: Struts Taglib Question

2004-09-17 Thread Asleson, Ryan

Fixed.

It needs to use the ${ } notation in c:set like shown below:


   



Thanks to everybody for their help.


-Original Message-
From: Asleson, Ryan 
Sent: Friday, September 17, 2004 10:05 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts Taglib Question


I tried the following:


   



and got this exception:

[ServletException in:/jsp/registration/register.jsp] Invalid property in
: "event.date"' javax.servlet.jsp.JspTagException: Invalid property in
: "event.date" at
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.j
ava:183) at



I have no idea why, because formBean does have a getEvent() method, and
event does have a setDate(String) method.  I can be sure because Struts
handles it correctly.

Any idea what I'm doing wrong??  I know it's finding the formBean because
the "if" test works if I comment out the c:set line.

Thanks!!





Try JSTL:


   


Note: this code has not been tested


--
Tim Slattery
[EMAIL PROTECTED]


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

This e-mail message is being sent solely for use by the intended
recipient(s) and may contain confidential information.  Any unauthorized
review, use, disclosure or distribution is prohibited.  If you are not the
intended recipient, please contact the sender by phone or reply by e-mail,
delete the original message and destroy all copies. Thank you.

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

This e-mail message is being sent solely for use by the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please contact the 
sender by phone or reply by e-mail, delete the original message and destroy all 
copies. Thank you.

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



RE: "Resources not defined for Validator"

2004-09-17 Thread Dave Bender
Clarification: I have this in my struts-config.xml file, but I have a modular 
application and the plug was not in the module's config file, profile-config.xml.  

I've added it an now I'm getting past the "Resources not defined..." exception.  
Instead, I'm getting "java.lang.NoSuchMethodException: 
org.apache.struts.validator.FieldChecks.validateRequired.  I'm hunting down the cause 
of that.

I'm concluding that if I have multiple modules, I need the Plug-Ins plugged into each 
module, correct?  The benefit being I can keep validation rules contained in different 
files for different modules if I so choose?  That is I could put the 'profile' 
validation rules in profile-validation.xml with this:

 

Dave





-Original Message-
From: Dave Bender [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 10:01 AM
To: Struts Users Mailing List
Subject: RE: "Resources not defined for Validator"


Yes, I have:

...
  

  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 9:37 AM
To: Struts Users Mailing List
Subject: Re: "Resources not defined for Validator"






Do you have the plug-in set in the struts-config.xml?





   
 "Dave Bender" 
 <[EMAIL PROTECTED]> 
To 
 09/17/2004 10:26  "Struts Users Mailing List" 
 AM<[EMAIL PROTECTED]>
cc 
   
 Please respond to Subject 
   "Struts Users   "Resources not defined for  
   Mailing List"   Validator"  
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   
   




I'm having a challenge getting the Validator plug-in to work.   It's my
first crack at it, so forgive if I'm missing something obvious.  Better
yet, if I am missing something obvious, tell me what it is.

When I call up my action, I'm getting a "Resources not defined for
Validator" exception.  My logs say:

87406 DEBUG [HttpProcessor[8080][2]]
org.apache.struts.action.RequestProcessor -  Validating input form
properties
121976 ERROR [HttpProcessor[8080][2]]
org.apache.struts.validator.ValidatorForm - Resources not defined for
Validator
org.apache.commons.validator.ValidatorException: Resources not defined for
Validator
 at org.apache.commons.validator.Validator.validate(Validator.java:574)
 at
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)

My web.xml contains this:

  
action
org.apache.struts.action.ActionServlet
...

  application
  ApplicationResources

...
  

I have a properties file at the base of my src tree named
ApplicationResources.properties and it contains :

profile.user.title=Title

A check of the .war file shows that this is in war file that's produced.


My validation.xml file is configured to validate just one field (hey, I'm
just getting going!):

 
 
 
 
 
 
 


What am I missing?

Any help would be appreciated.   This looks like a good plug-in to use.

Dave





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


Setting initial value on html:radio

2004-09-17 Thread Ricardo Gladwell
Hi All,
I'm trying to set the initial value on a set of  elements. 
Unlike other html tags, I notice there is no way to specify the initial 
value unless you specify the value in the form bean constructor/reset 
method itself.

I am forwarding to a page containing and html:form with radio buttons 
from another action. The action form bean for the pre-action has a value 
I would like to pass onto the new form. How do I transfer this 
information from one form bean to another? It seems the only means of 
communication is the JSP itself and I don't really want to hack it with 
scriplets to copy the value from one form bean to another.

Is there method of doing this?
Kind regards,
-- Ricardo Gladwell
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Struts Taglib Question

2004-09-17 Thread Asleson, Ryan
I tried the following:


   



and got this exception:

[ServletException in:/jsp/registration/register.jsp] Invalid property in
: "event.date"' javax.servlet.jsp.JspTagException: Invalid property in
: "event.date" at
org.apache.taglibs.standard.tag.common.core.SetSupport.doEndTag(SetSupport.j
ava:183) at



I have no idea why, because formBean does have a getEvent() method, and
event does have a setDate(String) method.  I can be sure because Struts
handles it correctly.

Any idea what I'm doing wrong??  I know it's finding the formBean because
the "if" test works if I comment out the c:set line.

Thanks!!





Try JSTL:


   


Note: this code has not been tested


--
Tim Slattery
[EMAIL PROTECTED]


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

This e-mail message is being sent solely for use by the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please contact the 
sender by phone or reply by e-mail, delete the original message and destroy all 
copies. Thank you.

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



Re: "Resources not defined for Validator"

2004-09-17 Thread Andrew Close
Dave,


On Fri, 17 Sep 2004 09:26:18 -0500, Dave Bender <[EMAIL PROTECTED]> wrote:



> When I call up my action, I'm getting a "Resources not defined for Validator" 
> exception.  My logs say:
> 
> 87406 DEBUG [HttpProcessor[8080][2]] org.apache.struts.action.RequestProcessor - 
>  Validating input form properties
> 121976 ERROR [HttpProcessor[8080][2]] org.apache.struts.validator.ValidatorForm 
> - Resources not defined for Validator
> org.apache.commons.validator.ValidatorException: Resources not defined for Validator
>  at org.apache.commons.validator.Validator.validate(Validator.java:574)
>  at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)
> 

looking at the error you're getting my first guess would be that the
page you are executing does not have the field listed in your
validation.xml.

also, look in your struts-config where you've defined your action.  do
you have validation="true" set for that action?


 
> My validation.xml file is configured to validate just one field (hey, I'm just 
> getting going!):
> 
> 
> 
> 
> 
> 
> 
> 
> 
> What am I missing?

is your formset wrapped in ?  or do you have
 as your root tag in the validation.xml?  i would guess that
this would give you a different error if you had the wrong root... 
but worth a look

HTH,
andy

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



RE: "Resources not defined for Validator"

2004-09-17 Thread Dave Bender
Yes, I have:

...
  

  

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 9:37 AM
To: Struts Users Mailing List
Subject: Re: "Resources not defined for Validator"






Do you have the plug-in set in the struts-config.xml?





   
 "Dave Bender" 
 <[EMAIL PROTECTED]> 
To 
 09/17/2004 10:26  "Struts Users Mailing List" 
 AM<[EMAIL PROTECTED]>
cc 
   
 Please respond to Subject 
   "Struts Users   "Resources not defined for  
   Mailing List"   Validator"  
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   
   




I'm having a challenge getting the Validator plug-in to work.   It's my
first crack at it, so forgive if I'm missing something obvious.  Better
yet, if I am missing something obvious, tell me what it is.

When I call up my action, I'm getting a "Resources not defined for
Validator" exception.  My logs say:

87406 DEBUG [HttpProcessor[8080][2]]
org.apache.struts.action.RequestProcessor -  Validating input form
properties
121976 ERROR [HttpProcessor[8080][2]]
org.apache.struts.validator.ValidatorForm - Resources not defined for
Validator
org.apache.commons.validator.ValidatorException: Resources not defined for
Validator
 at org.apache.commons.validator.Validator.validate(Validator.java:574)
 at
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)

My web.xml contains this:

  
action
org.apache.struts.action.ActionServlet
...

  application
  ApplicationResources

...
  

I have a properties file at the base of my src tree named
ApplicationResources.properties and it contains :

profile.user.title=Title

A check of the .war file shows that this is in war file that's produced.


My validation.xml file is configured to validate just one field (hey, I'm
just getting going!):

 
 
 
 
 
 
 


What am I missing?

Any help would be appreciated.   This looks like a good plug-in to use.

Dave





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


Re: "Resources not defined for Validator"

2004-09-17 Thread bmf5




Do you have the plug-in set in the struts-config.xml?





   
 "Dave Bender" 
 <[EMAIL PROTECTED]> 
To 
 09/17/2004 10:26  "Struts Users Mailing List" 
 AM<[EMAIL PROTECTED]>
cc 
   
 Please respond to Subject 
   "Struts Users   "Resources not defined for  
   Mailing List"   Validator"  
 <[EMAIL PROTECTED] 
  he.org>  
   
   
   
   




I'm having a challenge getting the Validator plug-in to work.   It's my
first crack at it, so forgive if I'm missing something obvious.  Better
yet, if I am missing something obvious, tell me what it is.

When I call up my action, I'm getting a "Resources not defined for
Validator" exception.  My logs say:

87406 DEBUG [HttpProcessor[8080][2]]
org.apache.struts.action.RequestProcessor -  Validating input form
properties
121976 ERROR [HttpProcessor[8080][2]]
org.apache.struts.validator.ValidatorForm - Resources not defined for
Validator
org.apache.commons.validator.ValidatorException: Resources not defined for
Validator
 at org.apache.commons.validator.Validator.validate(Validator.java:574)
 at
org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)

My web.xml contains this:

  
action
org.apache.struts.action.ActionServlet
...

  application
  ApplicationResources

...
  

I have a properties file at the base of my src tree named
ApplicationResources.properties and it contains :

profile.user.title=Title

A check of the .war file shows that this is in war file that's produced.


My validation.xml file is configured to validate just one field (hey, I'm
just getting going!):

 
 
 
 
 
 
 


What am I missing?

Any help would be appreciated.   This looks like a good plug-in to use.

Dave





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



RE: OT - way OT - WSAD 5.0

2004-09-17 Thread Mark Benussi
I experienced this last week, had to rebuild my projects and update WSAD to 
5.1. Just out of interest are you working for IBM, I know they are doing 
some work there.


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


OT - way OT - WSAD 5.0

2004-09-17 Thread bmf5





I use WSAD 5.0 for dev and out of nowhere it started using up all my
machine's memory (1G).  There's not much in the log which is below.  While
I'm waiting for support to call I was wondering if anybody has ever seen
anything like this?  This is happening when all I'm doing is editing a file
in my workspace.

!ENTRY org.eclipse.ui 4 4 Sep 17, 2004 08:20:58.393
!MESSAGE Unhandled exception caught in event loop.
!ENTRY org.eclipse.ui 4 0 Sep 17, 2004 08:20:58.433
!MESSAGE Failed to execute runnable (java.lang.OutOfMemoryError)


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



"Resources not defined for Validator"

2004-09-17 Thread Dave Bender
I'm having a challenge getting the Validator plug-in to work.   It's my first crack at 
it, so forgive if I'm missing something obvious.  Better yet, if I am missing 
something obvious, tell me what it is.

When I call up my action, I'm getting a "Resources not defined for Validator" 
exception.  My logs say:

87406 DEBUG [HttpProcessor[8080][2]] org.apache.struts.action.RequestProcessor -  
Validating input form properties
121976 ERROR [HttpProcessor[8080][2]] org.apache.struts.validator.ValidatorForm - 
Resources not defined for Validator
org.apache.commons.validator.ValidatorException: Resources not defined for Validator
 at org.apache.commons.validator.Validator.validate(Validator.java:574)
 at org.apache.struts.validator.ValidatorForm.validate(ValidatorForm.java:152)

My web.xml contains this:

  
action
org.apache.struts.action.ActionServlet
...

  application
  ApplicationResources

...
  

I have a properties file at the base of my src tree named 
ApplicationResources.properties and it contains :

profile.user.title=Title

A check of the .war file shows that this is in war file that's produced.


My validation.xml file is configured to validate just one field (hey, I'm just getting 
going!):










What am I missing?  

Any help would be appreciated.   This looks like a good plug-in to use.  

Dave




RE: Struts Taglib Question

2004-09-17 Thread Slattery, Tim - BLS
> By dot notation I just mean the dot notation for properties, 
> like event.date really means getEvent().getDate().  

Of course JSTL honors that convention. 

--
Tim Slattery
[EMAIL PROTECTED]


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



RE: Struts Taglib Question

2004-09-17 Thread Asleson, Ryan

By dot notation I just mean the dot notation for properties, like event.date
really means getEvent().getDate().  

Thank you very much for your help!


-Original Message-
From: Slattery, Tim - BLS [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 9:08 AM
To: 'Struts Users Mailing List'
Subject: RE: Struts Taglib Question


> I was hoping for something like this.  Does JSTL understand 
> the dot notation like Struts tags do?  

Not quite sure what you mean. Certainly JSTL's EL (expression language) is
the same as that used by the Struts-el tags.

--
Tim Slattery
[EMAIL PROTECTED]


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

This e-mail message is being sent solely for use by the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please contact the 
sender by phone or reply by e-mail, delete the original message and destroy all 
copies. Thank you.

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



RE: Struts Taglib Question

2004-09-17 Thread Slattery, Tim - BLS
> I was hoping for something like this.  Does JSTL understand 
> the dot notation like Struts tags do?  

Not quite sure what you mean. Certainly JSTL's EL (expression language) is
the same as that used by the Struts-el tags.

--
Tim Slattery
[EMAIL PROTECTED]


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



RE: Struts Taglib Question

2004-09-17 Thread Asleson, Ryan


I was hoping for something like this.  Does JSTL understand the dot notation
like Struts tags do?  

==
==

Try JSTL:


   


Note: this code has not been tested


--
Tim Slattery
[EMAIL PROTECTED]


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

This e-mail message is being sent solely for use by the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please contact the 
sender by phone or reply by e-mail, delete the original message and destroy all 
copies. Thank you.

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



RE: Struts Taglib Question

2004-09-17 Thread Slattery, Tim - BLS
> Is there some sort of Struts tag that I can use to set the 
> property of a bean?
> 
> I have a small fragment that I want to look like this:
> 
> 
> <%-- Set the event.date property on formBean to a default 
> value --%>   property="event.date"> 

Try JSTL:


   


Note: this code has not been tested


--
Tim Slattery
[EMAIL PROTECTED]


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



Re: Struts Taglib Question

2004-09-17 Thread Nicolas De Loof

JSTL :



Nico.


>
> Hello,
>
> Is there some sort of Struts tag that I can use to set the property of a
> bean?
>
> I have a small fragment that I want to look like this:
>
> 
> <%-- Set the event.date property on formBean to a default value --%>
> 
> 
> 
>
>
> It says that "if the event.date property on formBean is an empty String then
> set it to a default value."  I want to do it because I want the following
> select tag to have a specific default date selected instead of a random one
> being the deault select.
>
> I just want to be able to set the event.date property to a default value if
> it's already an empty String.  I'm looking for a tag to do it because this
> JSP page is generated via XSLT from another XML document, and there could be
> many bean properties that need to be defaulted.  I want to be able to
> preserve the use of the dot notation for nested parameters.
>
> Basically, I want a tag something like this:
>
> 
>
> Is there any way I can do this?
>
> Thanks!!
>
>
>
> This e-mail message is being sent solely for use by the intended recipient(s) and 
> may contain confidential
information.  Any unauthorized review, use, disclosure or distribution is prohibited.  
If you are not the intended
recipient, please contact the sender by phone or reply by e-mail, delete the original 
message and destroy all copies.
Thank you.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


This message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient,  you are not authorized to read, 
print, retain, copy, disseminate,  distribute, or use this message or any part 
thereof. If you receive this  message in error, please notify the sender immediately 
and delete all  copies of this message.


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



RE: Struts Taglib Question

2004-09-17 Thread Paul McCulloch
Is there a reason you can't do this in the action which precedes your jsp?

Anyway,  from JSTL does this for you.

Paul

> -Original Message-
> From: Asleson, Ryan [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 2:57 PM
> To: '[EMAIL PROTECTED]'
> Subject: Struts Taglib Question
> 
> 
> 
> Hello,
> 
> Is there some sort of Struts tag that I can use to set the 
> property of a
> bean?
> 
> I have a small fragment that I want to look like this:
> 
> 
> <%-- Set the event.date property on formBean to a default 
> value --%>
> 
> 
> 
> 
> 
> It says that "if the event.date property on formBean is an 
> empty String then
> set it to a default value."  I want to do it because I want 
> the following
> select tag to have a specific default date selected instead 
> of a random one
> being the deault select.
> 
> I just want to be able to set the event.date property to a 
> default value if
> it's already an empty String.  I'm looking for a tag to do it 
> because this
> JSP page is generated via XSLT from another XML document, and 
> there could be
> many bean properties that need to be defaulted.  I want to be able to
> preserve the use of the dot notation for nested parameters.
> 
> Basically, I want a tag something like this:
> 
>  value="10/10/2004"/>
> 
> Is there any way I can do this?
> 
> Thanks!!
> 
> 
> 
> This e-mail message is being sent solely for use by the 
> intended recipient(s) and may contain confidential 
> information.  Any unauthorized review, use, disclosure or 
> distribution is prohibited.  If you are not the intended 
> recipient, please contact the sender by phone or reply by 
> e-mail, delete the original message and destroy all copies. Thank you.
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


**
Axios Email Confidentiality Footer
Privileged/Confidential Information may be contained in this message. If you are not 
the addressee indicated in this message (or responsible for delivery of the message to 
such person), you may not copy or deliver this message to anyone. In such case, you 
should destroy this message, and notify us immediately. If you or your employer does 
not consent to Internet email messages of this kind, please advise us immediately. 
Opinions, conclusions and other information expressed in this message are not given or 
endorsed by my Company or employer unless otherwise indicated by an authorised 
representative independent of this message.
WARNING:
While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted 
via electronic mail attachments we cannot guarantee that attachments do not contain 
computer virus code.  You are therefore strongly advised to undertake anti virus 
checks prior to accessing the attachment to this electronic mail.  Axios Systems Ltd 
grants no warranties regarding performance use or quality of any attachment and 
undertakes no liability for loss or damage howsoever caused.
**


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



Struts Taglib Question

2004-09-17 Thread Asleson, Ryan

Hello,

Is there some sort of Struts tag that I can use to set the property of a
bean?

I have a small fragment that I want to look like this:


<%-- Set the event.date property on formBean to a default value --%>





It says that "if the event.date property on formBean is an empty String then
set it to a default value."  I want to do it because I want the following
select tag to have a specific default date selected instead of a random one
being the deault select.

I just want to be able to set the event.date property to a default value if
it's already an empty String.  I'm looking for a tag to do it because this
JSP page is generated via XSLT from another XML document, and there could be
many bean properties that need to be defaulted.  I want to be able to
preserve the use of the dot notation for nested parameters.

Basically, I want a tag something like this:



Is there any way I can do this?

Thanks!!



This e-mail message is being sent solely for use by the intended recipient(s) and may 
contain confidential information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please contact the 
sender by phone or reply by e-mail, delete the original message and destroy all 
copies. Thank you.

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



Re: Content Management Across Multiple Apps

2004-09-17 Thread josh
Still interested to hear if anyone has any ideas about this...

On Wed, 2004-09-15 at 10:47, josh wrote:
> Hi all,
> 
> I am writing multiple apps (~20) that all share the same sidebar
> navigation.
> 
> Is there a way to make multiple applications use a central library of
> tiles so that I would be able to change or add a link in the library and
> it would affect all applications?
> 
> In such a scenario could I add a link without redeployment of an app?
> (does restarting the tiles defs factory do this?)
> 
> If the above is not possible, I am also considering storing these links
> in a DB so that adding or changing a link can be done without restarting
> the app and it can be done in one simple step through an admin interface
> or something. (DB caching in sql Maps should keep my DB from doing too
> much extra work for this I hope) :O  
> 
> 
> (I have decided not to use modules because there will be about 20
> applications involved and I prefer to be able to reload them
> individually if one needs maintenance, not having to do one monolithic
> restart). 
>  
> -- thanks in advance, 
> 
> Joshua Cronemeyer



signature.asc
Description: This is a digitally signed message part


Re: file data source

2004-09-17 Thread James Mitchell
Ok, how do you plan to manage your connection pool?

--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: "liooil " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 8:50 AM
Subject: Re: file data source


yes, please. I would appreciate your help
so let's go...
Where i can i fin such a JDBC connector ?
And how i configure/use it ?

Thx,


___[ Pub ]
Inscrivez-vous gratuitement sur Tandaime, Le site de rencontres !
http://rencontre.rencontres.com/index.php?origine=4

_
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


-
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: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Allistair Crossley
not quite .. when i arrive initially at the view governed by somePage.jsp yes, there 
are a bunch of request attributes set up. on this page is my form. as a hidden 
variable to the form I copy the existing page id because this must be present for our 
SecuredBaseAction to know what properties to load into the "new" request. 

what i see as completely possible and useful is that for a DynaActionForm action's 
input="somePage.jsp" attribute, to use input="anActionExtendingSecuredBaseAction.do" 
so that when validator fails the form, it can call the action which can make sure to 
lookup the page id from the dyna form, query the backend for the attributes, whack 
them into the request and then return a view.

do you see what i mean :))
 
> > Now, my understanding was that DynaActionForm manages to 
> populate a map of
> > form fields, match them up against validation rules, and if 
> it fails, it
> > would KEEP the previous request but add errors into it and 
> FORWARD back to
> > the view, therefore KEEPING all the request attributes. It 
> does not appear
> > to work in this manner and I am confused.
> 
> I think you are confusing what is happening here.  If I understand you
> correctly, you are setting thing into the request, then 
> forwarding to a
> "somePage.jsp" page.  When the user submits that page, and 
> the validator
> fails, the request is forwarded to the input="somePage.jsp" 
> of that action
> mapping.  And you are wondering why those attributes you set 
> in the first
> request are not there for the second on?
> 
> Am I understanding you here?
> 
> If yes, then you should know that those are 2 separate 
> requests.  If you
> rely on some collection to be in the request for use with a 
> select box, that
> collection won't be there if the validator fails.  As I 
> understand it, you
> don't want to store thing in the session.  That's ok, there are many
> different approaches to get around this.  If you ask 5 
> developers, you'll
> likely get 6 different answers.  You should Google it, and/or 
> buy a book.  I
> would recommend that new one coming out by O'Reilly.  Bill 
> Siggelkow is one
> smart cookie (when sober ;).
> 
> 
> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> EdgeTech, Inc.
> 678.910.8017
> AIM: jmitchtx
> 
> - Original Message -
> From: "Allistair Crossley" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, September 17, 2004 7:00 AM
> Subject: DynaActionForm and previous request attributes (no 
> answer found in
> archives for similar problems)
> 
> 
> Hi All,
> 
> I am coming up against a limitation of using DynaActionForm 
> that I wonder if
> someone can confirm or deny.
> 
> All our Action classes extend a SecuredBaseAction. This 
> SecuredBaseAction
> does a few important things per request like making sure the user is
> validated and also loading page properties matching a page id that is
> assigned to each request so that when the Action returns the 
> view, that view
> is able to do stuff like build the navigation and a range of 
> other things I
> won't bore you with. This is an intranet system therefore 
> navigation needs
> to be present at all times and so on.
> 
> This is a per request attribute and so it should be.
> 
> Now, I am building a validator-based application that sits within this
> intranet framework. I do not want to get into ActionForms as 
> they are a
> ball-ache but I do like the validator framework, so I want to use
> DynaActionForms.
> I have setup my first form and have it validating without an 
> issue. However,
> there is an issue because when I get my input view back 
> following a failure,
> all my request attributes are gone from the previous request 
> and because I
> have to send a forward, my nav attributes and so on cannot be 
> reloaded. This
> is causing errors.
> 
> Now, my understanding was that DynaActionForm manages to 
> populate a map of
> form fields, match them up against validation rules, and if 
> it fails, it
> would KEEP the previous request but add errors into it and 
> FORWARD back to
> the view, therefore KEEPING all the request attributes. It 
> does not appear
> to work in this manner and I am confused.
> 
> A similar post I found suggests using SESSION but this is not 
> only poor
> practice but impossible for the operations we need to perform 
> per action.
> 
> Any comments are greatly appreciated else I am going to have 
> to scrap using
> validator which I don't want to do.
> 
> Cheers, ADC.
> 
> 
> 
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 

Re: file data source

2004-09-17 Thread liooil
yes, please. I would appreciate your help
so let's go...
Where i can i fin such a JDBC connector ?
And how i configure/use it ?

Thx,


___[ Pub ]
Inscrivez-vous gratuitement sur Tandaime, Le site de rencontres !
http://rencontre.rencontres.com/index.php?origine=4

_
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


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



RE: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Allistair Crossley
when i submit my form to the action, the action maps my form to a DynaActionForm and 
binds the values. 

now, along with my form, i actually do submit something called PID (page id) which is 
the current page at time of submission. therefore, my dyna form will have the page id 
for which i need to load navigational information. 

however, because I am forced to use a tile definition or JSP in the input parameter of 
the action for when the validation fails, i am unable to load page attributes for that 
pid from my backend navigation system and this is breaking my view.

now you might say that all i need to do is load the page attributes from the jsp 
because it will be in the dyna form when i get to the view after failure, but now we 
are talking about breaking the whole point of MVC as i would need to call my backend. 

can anybody see what i am getting at here?

> -Original Message-
> From: Adrian Kaminski [mailto:[EMAIL PROTECTED]
> Sent: 17 September 2004 13:33
> To: Struts Users Mailing List
> Subject: Re: DynaActionForm and previous request attributes (no answer
> found in archives for similar problems)
> 
> 
> > managing a request attribute in the session by setting it 
> and then making sure we pop it out at the view is messing and 
> defies the semantic use of the request scope.
> > 
> > that's why it is bad practice.
> > 
> Don't shoot me if I'm wrong but HTTP is stateless so without any of:
> cookie, session, browser politeness (HTTP referer), hidden field with
> url, server won't be know where you come from (and in request scope
> you will won't have any information where user was before clicking
> Submit) ...
> 
> Regards,
> Adrian
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


 
---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---




Re: Invalidating the session

2004-09-17 Thread Luis Urueña Frías
Hello,

You can create filter for the login page.
That filter should disconnect the user of the web application (if exists).
All users that access login page, will be forced to be authenticates again.
If problem persist, it could be web cache.


Luis Urueña Frías Oficina 101 - Edificio Galileo, módulo Rojo Parque
Tecnológico de Boecillo Valladolid - España



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



Re: [OT] JSP 2.0 tag files and expressions

2004-09-17 Thread Kris Schneider
This worked on TC 5.0.28:

/WEB-INF/tags/tag1.tag:
---
<%@ tag body-content="empty" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags/" %>



/WEB-INF/tags/tag2.tag:
---
<%@ tag body-content="empty" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"; %>


v: ${v}


tagfile.jsp:

<%@ taglib prefix="tags" tagdir="/WEB-INF/tags/" %>







Which generated:



v: 0
v: 1
v: 2
v: 3
v: 4



Is that what you were trying to do?

Quoting Laurie Harper <[EMAIL PROTECTED]>:

> Sorry for the off-topic post but I'm sure someone here will be able to 
> tell me what's going on with this... I'm trying to use the JSTL forEach 
> tag in a tag file invoked by another tag file and I'm getting an error. 
> Here's an example piece of JSP:
> 
>
>  v: ${v}
>
> 
> That works fine in a JSP. It works fine in a tag file invoked from a 
> JSP. But if the tag file is invoked from another tag file, I get the 
> error "According to TLD or attribute directive in tag file, attribute 
> end does not accept any expressions." I can use the expression language 
> in other places (e.g. outside of custom tags) though.
> 
> Is this a limitation of tag files or of Tomcat's implementation of them? 
> Or am I just doing something wrong? If it's a limitation of the JSP spec 
> and/or Tomcat, is there a work-around? Otherwise tag files are about to 
> become a whole lot less useful to me... :-(
> 
> L.

-- 
Kris Schneider 
D.O.Tech   

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



Re: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread James Mitchell
You can put JavaScript on every page that will attempt to send the browser
to a specific url when the browser is closing, but that would be browser
specific and it is VERY likely that your action will never get called for
most users.  This is the web, if you want that feature you will need to go
rich client.



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: "Kranti Parisa" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 8:09 AM
Subject: Re: DynaActionForm and previous request attributes (no answer found
in archives for similar problems)


> how to invalidate the session when user clicks the close(cross) button
> which will display at the right side of the browser when we open a
> page..
>
>
>
> On Fri, 17 Sep 2004 08:01:45 -0400, James Mitchell <[EMAIL PROTECTED]>
wrote:
> > What is 'bad practice'?
> >
> > --
> > James Mitchell
> > Software Engineer / Open Source Evangelist
> > EdgeTech, Inc.
> > 678.910.8017
> > AIM: jmitchtx
> >
> >
> >
> > - Original Message -
> > From: "Allistair Crossley" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Sent: Friday, September 17, 2004 7:58 AM
> > Subject: RE: DynaActionForm and previous request attributes (no answer
found
> > in archives for similar problems)
> >
> > but that's bad practice. very bad.
> >
> > > -Original Message-
> > > From: Jitender K Chukkavenkata [mailto:[EMAIL PROTECTED]
> > > Sent: 17 September 2004 12:51
> > > To: Struts Users Mailing List
> > > Subject: Re: DynaActionForm and previous request attributes (no answer
> > > found in archives for similar problems)
> > >
> > >
> > > I would agree with him.  I can suggest you the same.
> > >
> > > Jitender Kumar C.V.
> > >
> >
> > 
> > ---
> > QAS Ltd.
> > Developers of QuickAddress Software
> > http://www.qas.com";>www.qas.com
> > Registered in England: No 2582055
> > Registered in Australia: No 082 851 474
> > ---
> > 
> >
> > -
> > 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]
> >
> >
>
>
>
> --
> Kranti Kiran Kumar Parisa
> Software Engineer [ e-Biz ],
> Patni Computer Systems Ltd.,
> India
> Mobile: +91 98504 45977
>
> -
> 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: file data source

2004-09-17 Thread James Mitchell
You would need a JDBC driver that supports file based storage.  You are
better off using HSSQLDB.  I can help you with that.



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: "liooil " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 8:27 AM
Subject: file data source



Hello world,


Maybe, it's not designed for that, but i wonder if i can
use   struts conf to access a local
file system (file://...) ?
I know this request is a bit strange, but it's for a very
temporary solution. No sql server available for the moment ...

Is it possible?
If so, where should i get some clue to make it work?




___[ Pub ]
Inscrivez-vous gratuitement sur Tandaime, Le site de rencontres !
http://rencontre.rencontres.com/index.php?origine=4

_
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


-
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: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Adrian Kamiński
> managing a request attribute in the session by setting it and then making sure we 
> pop it out at the view is messing and defies the semantic use of the request scope.
> 
> that's why it is bad practice.
> 
Don't shoot me if I'm wrong but HTTP is stateless so without any of:
cookie, session, browser politeness (HTTP referer), hidden field with
url, server won't be know where you come from (and in request scope
you will won't have any information where user was before clicking
Submit) ...

Regards,
Adrian

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



file data source

2004-09-17 Thread liooil

Hello world,


Maybe, it's not designed for that, but i wonder if i can
use   struts conf to access a local
file system (file://...) ?
I know this request is a bit strange, but it's for a very
temporary solution. No sql server available for the moment ...

Is it possible?
If so, where should i get some clue to make it work?




___[ Pub ]
Inscrivez-vous gratuitement sur Tandaime, Le site de rencontres !
http://rencontre.rencontres.com/index.php?origine=4

_
Envie de discuter en "live" avec vos amis ? Télécharger MSN Messenger
http://www.ifrance.com/_reloc/m la 1ère messagerie instantanée de France


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



Re: Invalidating the session

2004-09-17 Thread Kranti Parisa
fine... n one more thing is.. if the user login to the system..from
the login page then the welcome page is displayed.. then if the user
clicks the back button from the browser he will visit the login page
...but if the user clicks the forward button session should be
invalid..how to do that?


On Fri, 17 Sep 2004 17:42:16 +0530, Jitender K Chukkavenkata
<[EMAIL PROTECTED]> wrote:
> Use javascript to load a function on window event close.  Let that
> javascript pass a request to an action (like InvalidateSessionAction that
> holds the logic to manage the same).  thats it.
> 
> Jitender Kumar C.V.
> 
> 



-- 
Kranti Kiran Kumar Parisa
Software Engineer [ e-Biz ],
Patni Computer Systems Ltd.,
India
Mobile: +91 98504 45977

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



Re: Invalidating the session

2004-09-17 Thread Jitender K Chukkavenkata
Use javascript to load a function on window event close.  Let that 
javascript pass a request to an action (like InvalidateSessionAction that 
holds the logic to manage the same).  thats it.



Jitender Kumar C.V.


Invalidating the session

2004-09-17 Thread Kranti Parisa
how to invalidate the session when user clicks the close(cross) button
which will display at the right side of the browser when we open a
page..
-- 
Kranti Kiran Kumar Parisa
Software Engineer [ e-Biz ],
Patni Computer Systems Ltd.,
India
Mobile: +91 98504 45977

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



Re: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Kranti Parisa
how to invalidate the session when user clicks the close(cross) button
which will display at the right side of the browser when we open a
page..



On Fri, 17 Sep 2004 08:01:45 -0400, James Mitchell <[EMAIL PROTECTED]> wrote:
> What is 'bad practice'?
> 
> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> EdgeTech, Inc.
> 678.910.8017
> AIM: jmitchtx
> 
> 
> 
> - Original Message -
> From: "Allistair Crossley" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, September 17, 2004 7:58 AM
> Subject: RE: DynaActionForm and previous request attributes (no answer found
> in archives for similar problems)
> 
> but that's bad practice. very bad.
> 
> > -Original Message-
> > From: Jitender K Chukkavenkata [mailto:[EMAIL PROTECTED]
> > Sent: 17 September 2004 12:51
> > To: Struts Users Mailing List
> > Subject: Re: DynaActionForm and previous request attributes (no answer
> > found in archives for similar problems)
> >
> >
> > I would agree with him.  I can suggest you the same.
> >
> > Jitender Kumar C.V.
> >
> 
> 
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
> 
> -
> 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]
> 
> 



-- 
Kranti Kiran Kumar Parisa
Software Engineer [ e-Biz ],
Patni Computer Systems Ltd.,
India
Mobile: +91 98504 45977

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



RE: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Allistair Crossley
what I have already described in some detail. the use of base actions is a good 
pattern to use as one can group common behaviour into them, such as authentication or 
ensuring other properties. in our case we do both, security AND ensuring some session 
lists for user (i.e those things that make sense to be in session because they don't 
change often at all for the lifetime of a user's visit) but also request attributes as 
I said .. the user clicks a nav link, that page's attributes get loaded as a map, and 
do not make sense to be in the session because it is per-request object.

now, my issue with DynaActionForm is that it ought to relise that if it has to forward 
the user page to the page they came from, it ought to also forward the request values 
back, OR at least be able to give you the opportunity to specify an Action rather than 
an ActionForward as the input parameter so that we can ensure those request vars are 
present for the view.

managing a request attribute in the session by setting it and then making sure we pop 
it out at the view is messing and defies the semantic use of the request scope.

that's why it is bad practice.

ADC

> -Original Message-
> From: James Mitchell [mailto:[EMAIL PROTECTED]
> Sent: 17 September 2004 13:02
> To: Struts Users Mailing List
> Subject: Re: DynaActionForm and previous request attributes (no answer
> found in archives for similar problems)
> 
> 
> What is 'bad practice'?
> 
> 
> 
> --
> James Mitchell
> Software Engineer / Open Source Evangelist
> EdgeTech, Inc.
> 678.910.8017
> AIM: jmitchtx
> 
> - Original Message -
> From: "Allistair Crossley" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Friday, September 17, 2004 7:58 AM
> Subject: RE: DynaActionForm and previous request attributes 
> (no answer found
> in archives for similar problems)
> 
> 
> but that's bad practice. very bad.
> 
> > -Original Message-
> > From: Jitender K Chukkavenkata [mailto:[EMAIL PROTECTED]
> > Sent: 17 September 2004 12:51
> > To: Struts Users Mailing List
> > Subject: Re: DynaActionForm and previous request attributes 
> (no answer
> > found in archives for similar problems)
> >
> >
> > I would agree with him.  I can suggest you the same.
> >
> > Jitender Kumar C.V.
> >
> 
> 
> 
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
> 
> 
> -
> 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: Hello Friends

2004-09-17 Thread Kranti Parisa
I am really sorry abt that...next time i wont repeat that


On Fri, 17 Sep 2004 17:27:58 +0530, Jitender K Chukkavenkata
<[EMAIL PROTECTED]> wrote:
> Let us respect group values...No personals pleasesend a personal mail
> if curious of knowing...
> 
> Jitender Kumar C.V.
> 
> 



-- 
Kranti Kiran Kumar Parisa
Software Engineer [ e-Biz ],
Patni Computer Systems Ltd.,
India
Mobile: +91 98504 45977

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



Re: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread James Mitchell
What is 'bad practice'?



--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: "Allistair Crossley" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 7:58 AM
Subject: RE: DynaActionForm and previous request attributes (no answer found
in archives for similar problems)


but that's bad practice. very bad.

> -Original Message-
> From: Jitender K Chukkavenkata [mailto:[EMAIL PROTECTED]
> Sent: 17 September 2004 12:51
> To: Struts Users Mailing List
> Subject: Re: DynaActionForm and previous request attributes (no answer
> found in archives for similar problems)
>
>
> I would agree with him.  I can suggest you the same.
>
> Jitender Kumar C.V.
>



---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



-
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: Hello Friends

2004-09-17 Thread Jitender K Chukkavenkata
Let us respect group values...No personals pleasesend a personal mail 
if curious of knowing...

Jitender Kumar C.V.



Re: Hello Friends

2004-09-17 Thread Kranti Parisa
Hi Jitender,

Thanx for ur warm welcome...
Hey r u from A.P.??
'coz ur names look like that..

iam from A.P., VIJAYAWADA

anyways it doesnt matter..nice to meet u ...


--
Kranti


On Fri, 17 Sep 2004 17:23:38 +0530, Jitender K Chukkavenkata
<[EMAIL PROTECTED]> wrote:
> Waaarm welcome Kranti...Have funn...
> 
> Jitender Kumar C.V.
> 
> 



-- 
Kranti Kiran Kumar Parisa
Software Engineer [ e-Biz ],
Patni Computer Systems Ltd.,
India
Mobile: +91 98504 45977

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



RE: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Allistair Crossley
but that's bad practice. very bad.

> -Original Message-
> From: Jitender K Chukkavenkata [mailto:[EMAIL PROTECTED]
> Sent: 17 September 2004 12:51
> To: Struts Users Mailing List
> Subject: Re: DynaActionForm and previous request attributes (no answer
> found in archives for similar problems)
> 
> 
> I would agree with him.  I can suggest you the same.
> 
> Jitender Kumar C.V.
> 


 
---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



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



Re: Hello Friends

2004-09-17 Thread Jitender K Chukkavenkata
Waaarm welcome Kranti...Have funn...



Jitender Kumar C.V.



Re: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Jitender K Chukkavenkata
I would agree with him.  I can suggest you the same.

Jitender Kumar C.V.


Hello Friends

2004-09-17 Thread Kranti Parisa
Hello Friends,
This is Kranti Parisa, Software Engineer.
I am working with Patni Computer Systems Ltd.
Our Project is using the Struts Framework.

So I will be in this mailing list from 2day onwards...

Have a nice time..

Bye for now

Kranti Parisa

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



suggestion needed.

2004-09-17 Thread DGraham

Return Receipt
   
Your  suggestion needed.   
document   
:  
   
was   Dennis Graham/EvergreenFunds 
received   
by:
   
at:   09/17/2004 07:49:12 AM   
   





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



problem in db access

2004-09-17 Thread DGraham

Return Receipt
   
Your  problem in db access 
document   
:  
   
was   Dennis Graham/EvergreenFunds 
received   
by:
   
at:   09/17/2004 07:49:08 AM   
   





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



Re: DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread James Mitchell
> Now, my understanding was that DynaActionForm manages to populate a map of
> form fields, match them up against validation rules, and if it fails, it
> would KEEP the previous request but add errors into it and FORWARD back to
> the view, therefore KEEPING all the request attributes. It does not appear
> to work in this manner and I am confused.

I think you are confusing what is happening here.  If I understand you
correctly, you are setting thing into the request, then forwarding to a
"somePage.jsp" page.  When the user submits that page, and the validator
fails, the request is forwarded to the input="somePage.jsp" of that action
mapping.  And you are wondering why those attributes you set in the first
request are not there for the second on?

Am I understanding you here?

If yes, then you should know that those are 2 separate requests.  If you
rely on some collection to be in the request for use with a select box, that
collection won't be there if the validator fails.  As I understand it, you
don't want to store thing in the session.  That's ok, there are many
different approaches to get around this.  If you ask 5 developers, you'll
likely get 6 different answers.  You should Google it, and/or buy a book.  I
would recommend that new one coming out by O'Reilly.  Bill Siggelkow is one
smart cookie (when sober ;).


--
James Mitchell
Software Engineer / Open Source Evangelist
EdgeTech, Inc.
678.910.8017
AIM: jmitchtx

- Original Message -
From: "Allistair Crossley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, September 17, 2004 7:00 AM
Subject: DynaActionForm and previous request attributes (no answer found in
archives for similar problems)


Hi All,

I am coming up against a limitation of using DynaActionForm that I wonder if
someone can confirm or deny.

All our Action classes extend a SecuredBaseAction. This SecuredBaseAction
does a few important things per request like making sure the user is
validated and also loading page properties matching a page id that is
assigned to each request so that when the Action returns the view, that view
is able to do stuff like build the navigation and a range of other things I
won't bore you with. This is an intranet system therefore navigation needs
to be present at all times and so on.

This is a per request attribute and so it should be.

Now, I am building a validator-based application that sits within this
intranet framework. I do not want to get into ActionForms as they are a
ball-ache but I do like the validator framework, so I want to use
DynaActionForms.
I have setup my first form and have it validating without an issue. However,
there is an issue because when I get my input view back following a failure,
all my request attributes are gone from the previous request and because I
have to send a forward, my nav attributes and so on cannot be reloaded. This
is causing errors.

Now, my understanding was that DynaActionForm manages to populate a map of
form fields, match them up against validation rules, and if it fails, it
would KEEP the previous request but add errors into it and FORWARD back to
the view, therefore KEEPING all the request attributes. It does not appear
to work in this manner and I am confused.

A similar post I found suggests using SESSION but this is not only poor
practice but impossible for the operations we need to perform per action.

Any comments are greatly appreciated else I am going to have to scrap using
validator which I don't want to do.

Cheers, ADC.



---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



-
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: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Manuel Wissmann
Now it works
Thank you very much!!
Jitender K Chukkavenkata schrieb:
hei
 just check this :+
Are you setting attribute message="true" ?

Thanks.
Jitender Kumar C.V.
 


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


Re: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Jitender K Chukkavenkata
hei

  just check this :+
Are you setting attribute message="true" ?

 


Thanks.
Jitender Kumar C.V.


Re: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Jitender K Chukkavenkata
Please tell me Y are you using the shaded code when the classes being used 
are depricated.

If i use this:

   


 i get no message in my jsp file.

 Once Again my Actionclass says:
ActionMessages messages = new ActionMessages();
errors.add(ActionErrors.GLOBAL_ERROR, new 
ActionError("error.mitarbeiter.anlegen"));
saveErrors(req, errors);
I guess it might be saying
   messages.add(ActionMessages.GLOBAL_MMESSAGE, new 
ActionMessage("error.mitarbeiter.anlegen")).

OK the next thing is: Can I c your struts-config.xml once?




Jitender Kumar C.V.


DynaActionForm and previous request attributes (no answer found in archives for similar problems)

2004-09-17 Thread Allistair Crossley
Hi All,

I am coming up against a limitation of using DynaActionForm that I wonder if someone 
can confirm or deny. 

All our Action classes extend a SecuredBaseAction. This SecuredBaseAction does a few 
important things per request like making sure the user is validated and also loading 
page properties matching a page id that is assigned to each request so that when the 
Action returns the view, that view is able to do stuff like build the navigation and a 
range of other things I won't bore you with. This is an intranet system therefore 
navigation needs to be present at all times and so on.

This is a per request attribute and so it should be. 

Now, I am building a validator-based application that sits within this intranet 
framework. I do not want to get into ActionForms as they are a ball-ache but I do like 
the validator framework, so I want to use DynaActionForms. 
I have setup my first form and have it validating without an issue. However, there is 
an issue because when I get my input view back following a failure, all my request 
attributes are gone from the previous request and because I have to send a forward, my 
nav attributes and so on cannot be reloaded. This is causing errors.

Now, my understanding was that DynaActionForm manages to populate a map of form 
fields, match them up against validation rules, and if it fails, it would KEEP the 
previous request but add errors into it and FORWARD back to the view, therefore 
KEEPING all the request attributes. It does not appear to work in this manner and I am 
confused.

A similar post I found suggests using SESSION but this is not only poor practice but 
impossible for the operations we need to perform per action.

Any comments are greatly appreciated else I am going to have to scrap using validator 
which I don't want to do.

Cheers, ADC.


 
---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---



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



Re: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Manuel Wissmann
If i use this:
   
  
   

i get no message in my jsp file.
Once Again my Actionclass says:
   ActionMessages messages = new ActionMessages();
   errors.add(ActionErrors.GLOBAL_ERROR, new 
ActionError("error.mitarbeiter.anlegen"));
   saveErrors(req, errors);

Do you have any Idea??
Jitender K Chukkavenkata schrieb:
U can use
First method:


 
Or, you can place specific messages at different locations

   


 

   
 
   


   
 
 
 

 
   

 
 


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


Re: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Jitender K Chukkavenkata
U can use
First method:


 
  

Or, you can place specific messages at different locations

 

 

  
 

  

 
 

  
  
  
 
  

 
  

Re: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Manuel Wissmann
Jitender K Chukkavenkata schrieb:
use  tag or  tag for accessing messages in the 
same way as you use  tag.

Jitender Kumar C.V.
 

Hi!
Can you give me an example how i use   in this case?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Honza Spurný
I would try this:



<%= actionMessages.getMessage(...) %>

I dont know if it works, since I have no way now to test it...


You have to find somewhere value of GLOBAL_ERROR and then it is easy, i
think.

-- Honza

Manuel Wissmann wrote:
> Hi Everbody!
>
> I've got the following problem:
>
> In my MitarbeiterAction.java   I've got the following Code:
>
> ...
> public ActionForward execute(ActionMapping mapping,
> ActionForm form, HttpServletRequest req,
>  HttpServletResponse res) throws Exception
> {
>ActionMessages messages = new ActionMessages();
>
> MitarbeiterForm mf = (MitarbeiterForm)form;
> Mitarbeiter mitarbeiter = mf.getMitarbeiter();
> mitarbeiter.anlegen();
>
> // checks if  Mitarbeiter  exists in the db
> if(
> !mitarbeiter.checkMitarbeiterExists(mitarbeiter.getStammNr()) )
> {
> errors.add(ActionErrors.GLOBAL_ERROR, new
> ActionError("error.mitarbeiter.anlegen"));
> saveErrors(req, errors);
> }
> else
> {
> messages.add(ActionMessages.GLOBAL_MESSAGE, new
> ActionMessage("mitarbeiter.angelegt"));
> saveMessages(req, messages);
> }
>  return mapping.findForward("MitarbeiterCreated");
> }
> ...
>
> My Question is now,  How can I access the ActionMessages in the jsp to
> which the Action is forwarded???
>
> THX
> Manu
>
>
> -
> 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: Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Jitender K Chukkavenkata
use  tag or  tag for accessing messages in the 
same way as you use  tag.

Jitender Kumar C.V.



Accessing ActionMessages in a jsp-File!

2004-09-17 Thread Manuel Wissmann
Hi Everbody!
I've got the following problem:
In my MitarbeiterAction.java   I've got the following Code:
...
public ActionForward execute(ActionMapping mapping,
   ActionForm form, HttpServletRequest req,
HttpServletResponse res) throws Exception
{
  ActionMessages messages = new ActionMessages();
 
   MitarbeiterForm mf = (MitarbeiterForm)form;
   Mitarbeiter mitarbeiter = mf.getMitarbeiter();
   mitarbeiter.anlegen();

   // checks if  Mitarbeiter  exists in the db
   if( 
!mitarbeiter.checkMitarbeiterExists(mitarbeiter.getStammNr()) )
   {
   errors.add(ActionErrors.GLOBAL_ERROR, new 
ActionError("error.mitarbeiter.anlegen"));
   saveErrors(req, errors);
   }
   else
   {
   messages.add(ActionMessages.GLOBAL_MESSAGE, new 
ActionMessage("mitarbeiter.angelegt"));
   saveMessages(req, messages);
   }
return mapping.findForward("MitarbeiterCreated");
}
...

My Question is now,  How can I access the ActionMessages in the jsp to 
which the Action is forwarded???

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


Re: Posting XML to Struts

2004-09-17 Thread Martin Schaefer

The code snippet below uses JDOM but should easily be adaptable to
anything else. Hope it helps. On the server side read the data from the
request's inputStream. If however you want to use multipart messages
things get slightly more tricky.

URLConnection conn = ...

// configure the connection

conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);

// output the document into a byte array output stream

ByteArrayOutputStream outputStream = new
ByteArrayOutputStream();
PrintWriter outputWriter = new PrintWriter(outputStream, true);

XMLOutputter outputter = new XMLOutputter("  ", true,
"ISO-8859-1");
outputter.setTextNormalize(true);
outputter.output(requestDocument, outputWriter);
outputWriter.flush();

// set the header fields

conn.setRequestProperty("Content-Type", "text/xml");
conn.setRequestProperty("Content-Length",
String.valueOf(outputStream.size()));

// write the data to the request body

outputStream.writeTo(conn.getOutputStream());
}


Mark Benussi <[EMAIL PROTECTED]> schrieb am 17.09.2004, 10:57:56:
> Has anyone got an example of posting an XML message via the web to a sruts 
> action on an external site and how I should handle that request in the 
> struts action?
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
-- 
Martin Schaefer
NAXOS Software Solutions GmbH i.G.
Herrenstr. 1
69502 Hemsbach
Germany
 
Phone:+49 (0) 6201 49298-2
Mobile: +49 (0) 172 6269246
Fax: +49 (0) 6201 49298-1
Mail: [EMAIL PROTECTED]

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



Re: Accesssing the multiple MessageResources

2004-09-17 Thread Honza Spurný
I've found it out! So simply and It wasnot clear to me!

I'm sorry for this question, since it is so easy:

When You specify additional resources, such


so You can sipmly access whole MessageResources class by for example in JSP:


So the key to access the whole class equals (is the same) as the bundle key!
Simply.

Sorry for my stupid questions...

Best Regards
Honza Spurny


Honza Spurný wrote:
> Hi there,
>
> since I've been searching for answer for hours and nothing have
> found, I'd like to ask You for help.
>
> I'd like to define 2 (or more) MessageResources files (two differents
> bundles) by inserting into struts-config.xml this:
>
>  parameter="cz.master.is.sources.ApplicationResources" />
>  parameter="cz.master.is.sources.Countries" />
>
> It's easy to access these message resources in jsp files. Since the
> first entry is stored under default key it can be accessed for
> example this way:
>
> 
>
> and the second entry is accessible under specified key this way:
>
>  key="country.usa.label" />
>
> This works fine. But sometimes I need to access MessageResources
> files in java classes. When I would like to access defualt messages
> object, I usually use this sequence:
>
> let's say request object is known...
> Locale locale = (Locale)request.getSession().getAttribute("locale");
> MessageResources messages =
> ((MessageResources)request.getAttribute(Globals.MESSAGES_KEY));
>
> This still works fine. I have problem (exactly said, I don't know how
> to) to access "countries" MessageResources. I have no idea how to
> access this additional Resources in java class. I've found out how to
> access them in the Action class:
>
> MessageResources countries = getResources(request, "countries");
>
> or
>
> MessageResources countries =
> (MessageResources)getServlet().getContext().getAttribute("countries");
>
> Please any idea how to do it?
>
> -
>
> And the next question is how to do it in JSP files different way.
> Sometimes I use this in JSP files:
>
>  type="org.apache.struts.util.MessageResources"/>
>
> what makes me able to access default MessegeResources as class in the
> JSP pages. Sometimes it's quite usefull for me. And according to
> this, I'd like to access the same way also my additional "Countries"
> MessageResources. But I don't know how to specify the bundle in the
> bean:define tag. I think there can be bundle specified only by name
> attribute. The way how to specify the bundle is probably the same, as
> above, but I have to enter there different value, that points on my
> additional resources. So where to find this value? If I would know
> this value, it could also help in the first question, that is above.
>
> 
>
> Thanks for Your hints.
> I hope You know some tricks, I don't, and that will help.
>
> Thanks for help
>
> Best Regards
> Have a nice rest of day
>
> Honza Spurny
>
>
> -
> 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: Posting XML to Struts

2004-09-17 Thread KhayOng
In the action class, just call request.getInputStream(). 


On Fri, 17 Sep 2004 08:57:56 +, Mark Benussi
<[EMAIL PROTECTED]> wrote:
> Has anyone got an example of posting an XML message via the web to a sruts
> action on an external site and how I should handle that request in the
> struts action?
> 
> -
> 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: problem in db access

2004-09-17 Thread Bj
you can do this in several ways but you always need to reload the JSP 
page and use a bit of javascript.

If you fill your combobox in the JSP, then simply reload the page with 
an additional request parameter containing the selected option. In your 
JSP code you must check the presence of this parameter and fill the 2nd 
combo calling your DAO layer.

If your fill your combobox in your Action and with Struts iteration 
tags. Submit your form to your action on the onChange of the 1st 
combobox. Then you will fill the corresponding ActionForm field and 
forward to your jsp.

Bj
PS : you should disable mail reading acknowledgment when posting to a 
mailing list.

viji.george a écrit :
 hello friends,
 
I have a form in a jsp page, where i have 2 select box .
The values of both come from the database(db). 
On the selection of first select box, the values should be fetched from 
the database for the second on the  basis of the value selected in the 
first.
 
When i load the page i call a action and then access the db with the BO  
and the DAO. Now how do i access the db from the jsp page and retain the 
value selected in the first select box.
 
 
eg
 
country<>
 
states<>
 
on the basis of selection of the country  select box, the stated select 
box should be populated.
 
 
 
Thank you all in advance.
 
 
 
*Viji George*
		


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


Posting XML to Struts

2004-09-17 Thread Mark Benussi
Has anyone got an example of posting an XML message via the web to a sruts 
action on an external site and how I should handle that request in the 
struts action?


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


Re: Accesssing the multiple MessageResources

2004-09-17 Thread Honza Spurný
Sachin Bhutada wrote:
> hi Honza Spurný ,
>
> Try this out ..
>
> RequestUtils.message(pageContext,"countries","locale",
> "country.usa.label", null);
> It will return u the appropriate string. It may work.

Hi there,

thanks for hint. This should work, there's no problem probably in it. Only
think I can see on first view is, that this method is deprecated - this is
still not the biggest problem, but this will return only one message. What I
need more is to get whole MessageResources class.

But thanks for hint. This is usable in limited number of cases I need it to
use. (but it's a step forward for me :)

Honza S.

>
> sachin
> xoriant, mumbai
>
> -Original Message-
> From: Honza Spurný [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 17, 2004 1:48 PM
> To: [EMAIL PROTECTED]
> Subject: Accesssing the multiple MessageResources
>
>
> Hi there,
>
> since I've been searching for answer for hours and nothing have
> found, I'd like to ask You for help.
>
> I'd like to define 2 (or more) MessageResources files (two differents
> bundles) by inserting into struts-config.xml this:
>
>  parameter="cz.master.is.sources.ApplicationResources" />
>  parameter="cz.master.is.sources.Countries" />
>
> It's easy to access these message resources in jsp files. Since the
> first entry is stored under default key it can be accessed for
> example this way:
>
> 
>
> and the second entry is accessible under specified key this way:
>
>  key="country.usa.label" />
>
> This works fine. But sometimes I need to access MessageResources
> files in java classes. When I would like to access defualt messages
> object, I usually use this sequence:
>
> let's say request object is known...
> Locale locale = (Locale)request.getSession().getAttribute("locale");
> MessageResources messages =
> ((MessageResources)request.getAttribute(Globals.MESSAGES_KEY));
>
> This still works fine. I have problem (exactly said, I don't know how
> to) to access "countries" MessageResources. I have no idea how to
> access this additional Resources in java class. I've found out how to
> access them in the Action class:
>
> MessageResources countries = getResources(request, "countries");
>
> or
>
> MessageResources countries =
> (MessageResources)getServlet().getContext().getAttribute("countries");
>
> Please any idea how to do it?
>
> -
>
> And the next question is how to do it in JSP files different way.
> Sometimes I use this in JSP files:
>
>  type="org.apache.struts.util.MessageResources"/>
>
> what makes me able to access default MessegeResources as class in the
> JSP pages. Sometimes it's quite usefull for me. And according to
> this, I'd like to access the same way also my additional "Countries"
> MessageResources. But I don't know how to specify the bundle in the
> bean:define tag. I think there can be bundle specified only by name
> attribute. The way how to specify the bundle is probably the same, as
> above, but I have to enter there different value, that points on my
> additional resources. So where to find this value? If I would know
> this value, it could also help in the first question, that is above.
>
> 
>
> Thanks for Your hints.
> I hope You know some tricks, I don't, and that will help.
>
> Thanks for help
>
> Best Regards
> Have a nice rest of day
>
> Honza Spurny
>
>
> -
> 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: suggestion needed.

2004-09-17 Thread Sachin Bhutada

hi vineesh , 

go to java.sun.com and search for tutorial they hv wonderfully designed
tutorials for the beginners .

sachin
xoriant, mumbai
-Original Message-
From: vineesh . kumar [mailto:[EMAIL PROTECTED]
Sent: Friday, September 17, 2004 1:19 PM
To: Struts Users Mailing List
Subject: Re: suggestion needed.


  

I do not under stand ur problem.
when u accessing the database some error occured?
 then plz specify the errorstring




On Fri, 17 Sep 2004 viji.george wrote :
>
>  hello people,
>
>can anyone suggest a site where i can find a sample application or the
>solution to the problem in accessing the database, i had mailed
earlier?
>
>can anybody suggest a good book???
>
>thanks again.
>
>regards,
>Viji George


  1   2   >