RE: How to turn off validation momentarily

2001-07-18 Thread Albert Wong

Shouldn't that be a separate "ConfirmDeletionAction" with it's action
mapping validate set to false?

If you wanted to combine multiple actions in one Action Handler but have
that action having auto-validationof formbeans you might try:
1.  Subclassing ActionServlet and overriding it's processValidate method
to not validate if a flag is sent in the HttpRequest (possibly a hidden
variable indicating "confirmDeletion". 
2.  Make your formBean's validate method check for the "do not validate
flag".

-Original Message-
From: Erik Hatcher [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 11:09 PM
To: [EMAIL PROTECTED]
Subject: Re: How to turn off validation momentarily


In struts-config you can specify that validation won't occur on a
per-action
basis like this:


  


Does that help?

Erik

- Original Message -
From: "Tom Miller" <[EMAIL PROTECTED]>
To: "struts-user" <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 8:24 PM
Subject: How to turn off validation momentarily


> Hello
>
> Is there a way to turn off form validation momentarily, say for just
one
> action.perform() invocation? I've tried placing a
> mapping.setValidation(false) in various places in my "edit" and "save"
> actions (a la struts-example). Basically, I do not want to validate a
> record that I'm presenting to the user in order to confirm a delete,
but
> the form is set up for validation, so that gets executed too. But
we're
> deleting, so why bother?
>
> Thanks in advance for any tips.
>
> --
> Tom Miller
> Miller Associates, Inc.
> [EMAIL PROTECTED]
> 641.469.3535 Phone
> 413.581.6326 FAX
>
>





Re: How to turn off validation momentarily

2001-07-18 Thread Erik Hatcher

In struts-config you can specify that validation won't occur on a per-action
basis like this:


  


Does that help?

Erik

- Original Message -
From: "Tom Miller" <[EMAIL PROTECTED]>
To: "struts-user" <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 8:24 PM
Subject: How to turn off validation momentarily


> Hello
>
> Is there a way to turn off form validation momentarily, say for just one
> action.perform() invocation? I've tried placing a
> mapping.setValidation(false) in various places in my "edit" and "save"
> actions (a la struts-example). Basically, I do not want to validate a
> record that I'm presenting to the user in order to confirm a delete, but
> the form is set up for validation, so that gets executed too. But we're
> deleting, so why bother?
>
> Thanks in advance for any tips.
>
> --
> Tom Miller
> Miller Associates, Inc.
> [EMAIL PROTECTED]
> 641.469.3535 Phone
> 413.581.6326 FAX
>
>





RE: Where do YOU put JDBC calls?

2001-07-18 Thread Vikramjit Singh



yups ryan even  iam using 
the same method for JDBC calls and i think that this provides quite a lot 
program modularity.
even i want to know whether is 
there a much better approach for JDBC calls.
 
Vikramjit singh, eAngel 
Team, Global Tele-systems Ltd. 
Ph. 7612929-3140 

  -Original 
  Message-From: Ryan Cornia 
  [mailto:[EMAIL PROTECTED]]Sent: Wednesday, July 18, 2001 
  6:56 AMTo: [EMAIL PROTECTED]Subject: Where 
  do YOU put JDBC calls?
  I'm wondering what people are considering best practices for 
  JDBC calls?
   
  I have been writing beans that wrap a database table, and 
  include functions "select", "insert", "delete". These functions either load 
  the bean, insert the bean values in the database, or delete the record from 
  the database. In all of these functions, I pass in a database connection from 
  the action. (Or whatever else is calling the bean.)
   
  ie- public boolean select(Connection cn1, String 
  primaryKey)
   
  How are others doing it? I think this is a good approach, 
  but want to see if someone has come up with something better.
   
  Thanks,
  Ryan
   


How to turn off validation momentarily

2001-07-18 Thread Tom Miller

Hello

Is there a way to turn off form validation momentarily, say for just one
action.perform() invocation? I've tried placing a
mapping.setValidation(false) in various places in my "edit" and "save"
actions (a la struts-example). Basically, I do not want to validate a
record that I'm presenting to the user in order to confirm a delete, but
the form is set up for validation, so that gets executed too. But we're
deleting, so why bother?

Thanks in advance for any tips.

--
Tom Miller
Miller Associates, Inc.
[EMAIL PROTECTED]
641.469.3535 Phone
413.581.6326 FAX





Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread David Winterfeldt

If you look at the jsType.jsp, you will see that it is
referencing an external JavaScript file called
staticJavascript.jsp.  You could put other JavaScript
methods in that and call them from onclick, etc. 
Although I'm not sure if that is what you mean. 
Otherwise you could do an xml include.  I think the
JavaScript associated with a java method should be
with it in the xml file.

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> Yes the javascript is being generated.  I think the
> problem is that I
> used the validation.xml that comes with the latest
> release or your
> validator and some of it appears to not be
> compatible with Netscape
> version I am testing with.  Java script has the
> great benefit of failing
> but not indicating where the problem is.  
> 
> I stripped out all but the required and mask code
> and it works.  
> 
> I can now go through function by funtion and see
> which one is
> incompatible.
> 
> Is there any stratgy that would allow you to
> reference javascript that
> is in a library so that we could use some of the
> current javascript
> libraries we have today with out copying the code
> into the
> validation.xml.
> 
> My next challenge is to get the generated validation
> to work with the
> formatting javascript I currently have on the page. 
> This is currently
> causing some issues.
> 
> Thanks for the help.
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 03:49PM >>>
> Do you see any JavaScript being generated in the
> html?
> 
> David
> 
> --- Scott Ryan <[EMAIL PROTECTED]> wrote:
> > I have now converted to the latest version of the
> > Validator and that
> > caused the server side validation to start working
> > but not the javascript client side doesn't work. 
> It
> > goes straight to
> > the server validation.  I double checked
> everything
> > mentioned in the documentation and in the previous
> > messages in this
> > list and everything appears ok.  The only things
> > I think I need is the onsubmit addition and the
> > javascript validator
> > tag.  
> > 
> > Any more suggestions.
> > 
> > Scott
> > 
> > Scott Ryan
> > Developer
> > First Bank Data Corporation
> > Work: (303) 235-1485
> > Cell:(303 263-3044
> > 
> > >>> [EMAIL PROTECTED] 07/18/01 10:06AM >>>
> > The JavaScript part shouldn't have anything to do
> > with
> > the server side other than it uses the same object
> > in
> > application scope.  Does the name attribute of
> your
> > action (which matches the key the ActionForm is
> > stored
> > under) in the struts-config.xml the same as the
> form
> > element's name attribute?  
> > 
> >  >   
> >
>
type="com.wintecinc.struts.example.validator.RegistrationAction"
> >name="registrationForm"
> >scope="request"
> >validate="true"
> >input="/registration.jsp">
> > > path="/index.jsp"/>
> > 
> > 
> >   
> >   
> > 
> > David
> > 
> > --- Scott Ryan <[EMAIL PROTECTED]> wrote:
> > > Yes I am extending ValidatorForm instead of
> > > ActionForm.  Did you mean
> > > ValidateForm or ValidatorForm.  
> > > 
> > > I originally commented out the validate method
> > that
> > > I had but after
> > > nothing happened I tried creating a validate
> > method
> > > that only called
> > > super.validate with the proper attributes but it
> > > returned an empty
> > > errors object.  
> > > 
> > > It almost appears that I have missed a flag
> > > somewhere.  It was easy to
> > > get the client side to work but unlike the rest
> of
> > > the user's I am
> > > having a problem getting the server side to fire
> > > correctly.  
> > > 
> > > I am going to try and remove the onsubmit from
> my
> > > jsp and see if the
> > > server side will fire then.
> > > 
> > > Thanks for your suggestions.
> > > 
> > > Scott Ryan
> > > Developer
> > > First Bank Data Corporation
> > > Work: (303) 235-1485
> > > Cell:(303 263-3044
> > > 
> > > >>> [EMAIL PROTECTED] 07/18/01 08:50AM
> >>>
> > > Are you extending ValidateForm instead of
> > > ActionForm?
> > > 
> > > If you have a validate method in your form, be
> > sure
> > > to call
> > > super.validate().
> > > 
> > > Ryan
> > > 
> > > 
> > > 
> > > >>> [EMAIL PROTECTED] 07/18/01 08:53AM
> >>>
> > > I am trying to use the Validator extension for
> > > struts.   I have the
> > > client side functioning correctly and it works
> > > great.  I then go into
> > > Netscape and turn off java script and the server
> > > side checking is not
> > > firing.  Am I missing some configuration
> > parameter? 
> > > I even tried
> > > calling super.validate from a validate method
> > within
> > > my ActionForm and
> > > this returned no information either.  Any ideas
> on
> > > where I can look?
> > > 
> > > Thanks
> > > 
> > > Scott Ryan
> > > Developer
> > > First Bank Data Corporation
> > > Work: (303) 235-1485
> > > Cell:(303 263-3044
> > 
> > 
> > ___

Re: html:select/options

2001-07-18 Thread Pham Thanh Quan

But how to keep the choice that user chose in the last time he submitted

- Original Message - 
From: Joe Clark <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 11:12 PM
Subject: RE: html:select/options


> Use the 'value' attribute to make the selection. For example assume you
> have a dropdown of countries and one entry is 'United States' the code
> below would select 'United States'.
>property="country" value="United States">
> ...
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] at INTERNET
> [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
> @alltel.com]
> Sent: Wednesday, July 18, 2001 10:38 AM
> To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
> Subject: html:select/options
> 
> 
>  Is there a way to dictate which "option" in a collection is initially
> set
> as
>  "selected" when the page is rendered?
>  ex
>
>  For example, I have a collection of projects that are rendered by the
>   project
>  description box when the selection is changed.  The problem is
>  when the page
>  is first rendered, the two don't always match up.  I initialize the
>  description box to the first item in the collection, but the
>  select doesn't
>  always choose the first item.
> 
>  Thanks
>  D
> 




beans:write bug?

2001-07-18 Thread Bud Gibson

We have a bean with properties where the setter takes a float, and the 
getter returns a string.  Using expressions and scriptlets, this all 
works fine.

For instance, I can write the following for a bean contained inside another:

<%= HagBean.getProduct().getPrice() %>

and a formatted string with the price will appear.  However, when we try 
the equivalent bean:write,



struts tells us that we are mismatching types with a float and String.

Is this a bean:write bug?  As I understand beans, setter methods are not 
even required.  I find it odd that bean:write seems to be assuming the 
type of the setter method and then becoming unhappy when it gets the 
type returned by the getter method.

Thanks,
Bud
-- 
___
Bud Gibson
e-Lab Czar
Assistant Professor
University of Michigan Business School
701 Tappan Street, C2424
Ann Arbor, MI 48109-1234
ph:  734\647-9200
fax:  734\764-3240
[EMAIL PROTECTED]




Application Server Restart

2001-07-18 Thread Pathangi, Rao H.

Iam trying to deploy a struts application on Websphere Application Server
3.5 Patch 2. Could some one explain what happens from a Struts Point of view
when we restart the application Server.

I think that the webapp is being started and in the process the servlets
will be added to the container. Now since the webapp failed to start there
is no way I can test the servlets or JSP.

I see the following text in the application log. What could possibly be
wrong?

(Checked with the kwicprototype.webapp file in servlets directory, it seems
to be OK)


Regards
pathangi r


[01.07.18 11:05:23:397 CDT] e0df446a ServletHost   A Restarting group:
"kwicprototype"
[01.07.18 11:05:23:403 CDT] e0df446a ServletInstan A SRVE0097I: Servlet
unload initiated: "Error Reporting Facility"
[01.07.18 11:05:23:404 CDT] e0df446a ServletInstan A SRVE0107I: Servlet has
become permanently unavailable for service: "Error Reporting Facility"
[01.07.18 11:05:23:404 CDT] e0df446a WebGroup  A SRVE0091I: [Servlet
LOG]: "Error Reporting Facility: destroy"
[01.07.18 11:05:23:406 CDT] e0df446a ServletInstan A SRVE0021I: Servlet
unloaded: "Error Reporting Facility"
[01.07.18 11:05:23:406 CDT] e0df446a ServletInstan A SRVE0097I: Servlet
unload initiated: "JSP 1.1 Processor"
[01.07.18 11:05:23:407 CDT] e0df446a ServletInstan A SRVE0107I: Servlet has
become permanently unavailable for service: "JSP 1.1 Processor"
[01.07.18 11:05:23:408 CDT] e0df446a ServletInstan A SRVE0021I: Servlet
unloaded: "JSP 1.1 Processor"
[01.07.18 11:05:23:460 CDT] e0df446a ServletInstan A SRVE0048I: Loading
servlet: "Error Reporting Facility"
[01.07.18 11:05:23:460 CDT] e0df446a WebGroup  A SRVE0091I: [Servlet
LOG]: "Error Reporting Facility: init"
[01.07.18 11:05:23:461 CDT] e0df446a ServletInstan A SRVE0130I: Servlet
available for service: "Error Reporting Facility"
[01.07.18 11:05:23:469 CDT] e0df446a ServletInstan A SRVE0048I: Loading
servlet: "JSP 1.1 Processor"
[01.07.18 11:05:23:470 CDT] e0df446a WebGroup  A SRVE0091I: [Servlet
LOG]: "JSP 1.1 Processor: init"
[01.07.18 11:05:23:471 CDT] e0df446a ServletInstan A SRVE0130I: Servlet
available for service: "JSP 1.1 Processor"
[01.07.18 11:05:23:471 CDT] e0df446a ServletHost   X Failed to
restartWebGroup {0}
 "kwicprototype"
 com.ibm.servlet.util.REException: /*
at com.ibm.servlet.util.RegexpPool.add(RegexpPool.java(Compiled
Code))
at com.ibm.servlet.util.RegexpPool.add(RegexpPool.java:55)
at com.ibm.servlet.util.StringMatcher.put(StringMatcher.java:136)
at
com.ibm.servlet.engine.ServletHost.restartWebGroup(ServletHost.java:157)
at
com.ibm.servlet.engine.ServletEngineDynamicUpdateSupport.restartWebGroup(Ser
vletEngineDynamicUpdateSupport.java:105)
at
com.ibm.ejs.sm.active.ActiveServletGroup.setRefreshConfigAction(ActiveServle
tGroup.java:193)
at java.lang.reflect.Method.invoke(Native Method)
at
com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.ja
va(Compiled Code))
at
com.ibm.ejs.sm.active.ActiveObject.invokeContainedObject(ActiveObject.java:4
73)
at
com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.ja
va(Compiled Code))
at
com.ibm.ejs.sm.active.ActiveObject.invokeContainedObject(ActiveObject.java:4
73)
at
com.ibm.ejs.sm.agent.AdminAgentImpl.activeObjectInvocation(AdminAgentImpl.ja
va(Compiled Code))
at
com.ibm.ejs.sm.agent.AdminAgentImpl.invokeActiveObject(AdminAgentImpl.java:6
2)
at com.ibm.ejs.sm.agent._AdminAgentImpl_Tie._invoke(Unknown Source)
at com.ibm.CORBA.iiop.ExtendedServerDelegate.dispatch(Unknown
Source)
at com.ibm.CORBA.iiop.ORB.process(Unknown Source)
at com.ibm.CORBA.iiop.WorkerThread.run(Unknown Source)
at
com.ibm.ejs.oa.pool.ThreadPool$PooledThread.run(ThreadPool.java(Compiled
Code)) 



Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread Scott Ryan

Yes the javascript is being generated.  I think the problem is that I
used the validation.xml that comes with the latest release or your
validator and some of it appears to not be compatible with Netscape
version I am testing with.  Java script has the great benefit of failing
but not indicating where the problem is.  

I stripped out all but the required and mask code and it works.  

I can now go through function by funtion and see which one is
incompatible.

Is there any stratgy that would allow you to reference javascript that
is in a library so that we could use some of the current javascript
libraries we have today with out copying the code into the
validation.xml.

My next challenge is to get the generated validation to work with the
formatting javascript I currently have on the page.  This is currently
causing some issues.

Thanks for the help.

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 07/18/01 03:49PM >>>
Do you see any JavaScript being generated in the html?

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> I have now converted to the latest version of the
> Validator and that
> caused the server side validation to start working
> but not the javascript client side doesn't work.  It
> goes straight to
> the server validation.  I double checked everything
> mentioned in the documentation and in the previous
> messages in this
> list and everything appears ok.  The only things
> I think I need is the onsubmit addition and the
> javascript validator
> tag.  
> 
> Any more suggestions.
> 
> Scott
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 10:06AM >>>
> The JavaScript part shouldn't have anything to do
> with
> the server side other than it uses the same object
> in
> application scope.  Does the name attribute of your
> action (which matches the key the ActionForm is
> stored
> under) in the struts-config.xml the same as the form
> element's name attribute?  
> 
>
>
type="com.wintecinc.struts.example.validator.RegistrationAction"
>name="registrationForm"
>scope="request"
>validate="true"
>input="/registration.jsp">
> path="/index.jsp"/>
> 
> 
>   
>   
> 
> David
> 
> --- Scott Ryan <[EMAIL PROTECTED]> wrote:
> > Yes I am extending ValidatorForm instead of
> > ActionForm.  Did you mean
> > ValidateForm or ValidatorForm.  
> > 
> > I originally commented out the validate method
> that
> > I had but after
> > nothing happened I tried creating a validate
> method
> > that only called
> > super.validate with the proper attributes but it
> > returned an empty
> > errors object.  
> > 
> > It almost appears that I have missed a flag
> > somewhere.  It was easy to
> > get the client side to work but unlike the rest of
> > the user's I am
> > having a problem getting the server side to fire
> > correctly.  
> > 
> > I am going to try and remove the onsubmit from my
> > jsp and see if the
> > server side will fire then.
> > 
> > Thanks for your suggestions.
> > 
> > Scott Ryan
> > Developer
> > First Bank Data Corporation
> > Work: (303) 235-1485
> > Cell:(303 263-3044
> > 
> > >>> [EMAIL PROTECTED] 07/18/01 08:50AM >>>
> > Are you extending ValidateForm instead of
> > ActionForm?
> > 
> > If you have a validate method in your form, be
> sure
> > to call
> > super.validate().
> > 
> > Ryan
> > 
> > 
> > 
> > >>> [EMAIL PROTECTED] 07/18/01 08:53AM >>>
> > I am trying to use the Validator extension for
> > struts.   I have the
> > client side functioning correctly and it works
> > great.  I then go into
> > Netscape and turn off java script and the server
> > side checking is not
> > firing.  Am I missing some configuration
> parameter? 
> > I even tried
> > calling super.validate from a validate method
> within
> > my ActionForm and
> > this returned no information either.  Any ideas on
> > where I can look?
> > 
> > Thanks
> > 
> > Scott Ryan
> > Developer
> > First Bank Data Corporation
> > Work: (303) 235-1485
> > Cell:(303 263-3044
> 
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/ 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: Problems with Struts on Weblogic 5.10 sp9

2001-07-18 Thread Jon Brisbin

it's my understanding that sp9 for weblogic has some problems (bugs
;-)...one user had to get a custom solution...

it's "supposed" to be fixed in sp10, for what it's worth... :-)

Jon Brisbin
Lamar, MO

- Original Message -
From: "Upadhye, Sujit (GEAE, Foreign National)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 5:00 PM
Subject: Problems with Struts on Weblogic 5.10 sp9


> Hi,
>
> We are facing some strange problems. The code that runs on Tomcat is not
> running on Weblogic.
>
> We are using Tomcat server on local development machines and Weblogic 5.10
> (sp9) on Development server. Further, we are using Struts model for our
> project. We have observed that the code that runs smoothly on Tomcat has
> some problems while running on Weblogic. They are as follows:
>
> 1. The URL gets modified: The 'wls' inside the URL disappears when a
request
> is submitted. We have traced the cause of this problem to an entry in
> config.xml. When ever we have 'redirect = true' in the action mapping, the
> URL gets modified. If we remove 'redirect = true', then the URL does not
get
> modified.
> However, all our control logic is based on 'redirect = true', which works
> well on Tomcat.
>
> 2. Struts architecture requires FormBeans to be associated with each view
> component (JSP). On Tomcat, when a page is submitted, corresponding
FormBean
> gets updated. However, on Weblogic, the FormBean is not getting updated.
> (In fact, only one out of some 70-odd parameters is getting populated in
the
> FormBean. This is strange - but true!)
> We are NOT using custom tags in the JSPs. We are using simple jsp:usebean
> and then access each property using its getter method.
> We have all setter methods as required.
>
> Any help on the above would be greatly appreciated.
>
> Regards,
>
> Sujit
>
> -Original Message-
> From: Upadhye, Sujit (GEAE, Foreign National)
> [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, July 14, 2001 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: Question: Struts on Weblogic - Urgent please
>
> Hi,
>
> I am using Struts on Weblogic 5.1 with SP9.
>
> Initially I developed my app on Tomcat. Here, I am forwarding control to
> another action object. So, in my config.xml, I have:
>
> 
>
> I start my app on Tomcat through URL:
> http://localhost/wls/cmweb/detrunselect.do. When I submit this page, the
new
>
> URL I get is:
> http://localhost/wls/cmweb/detcontrol.do.
>
> This is the expected behavior.
>
> However, when I try to run the same on Weblogic, the second URL comes up
as:
>
> http://localhost/cmweb/detcontrol.do.
>
> Please note that 'wls' get dropped from the URL. This causes the app to
> fail.
>
> If I remove the 'redirect = true' from config.xml, then the URL appears
as:
> http://localhost/wls/cmweb/detrunselect.do
>
> Please note, that 'wls' is not dropped. But the action object has also NOT
> changed. This is not what I want.
>
> So, I want to use 'redirect = true'. Can some one tell me how can I still
> get the 'wls' while using 'redirect = true'?
>
> Thanks in advance,
>
> Sujit




Problems with Struts on Weblogic 5.10 sp9

2001-07-18 Thread Upadhye, Sujit (GEAE, Foreign National)

Hi,

We are facing some strange problems. The code that runs on Tomcat is not
running on Weblogic.

We are using Tomcat server on local development machines and Weblogic 5.10
(sp9) on Development server. Further, we are using Struts model for our
project. We have observed that the code that runs smoothly on Tomcat has
some problems while running on Weblogic. They are as follows:

1. The URL gets modified: The 'wls' inside the URL disappears when a request
is submitted. We have traced the cause of this problem to an entry in
config.xml. When ever we have 'redirect = true' in the action mapping, the
URL gets modified. If we remove 'redirect = true', then the URL does not get
modified.
However, all our control logic is based on 'redirect = true', which works
well on Tomcat.

2. Struts architecture requires FormBeans to be associated with each view
component (JSP). On Tomcat, when a page is submitted, corresponding FormBean
gets updated. However, on Weblogic, the FormBean is not getting updated.
(In fact, only one out of some 70-odd parameters is getting populated in the
FormBean. This is strange - but true!)
We are NOT using custom tags in the JSPs. We are using simple jsp:usebean
and then access each property using its getter method.
We have all setter methods as required.

Any help on the above would be greatly appreciated.

Regards,

Sujit

-Original Message- 
From: Upadhye, Sujit (GEAE, Foreign National) 
[mailto:[EMAIL PROTECTED]] 
Sent: Saturday, July 14, 2001 3:55 PM 
To: [EMAIL PROTECTED] 
Subject: Question: Struts on Weblogic - Urgent please 

Hi, 

I am using Struts on Weblogic 5.1 with SP9. 

Initially I developed my app on Tomcat. Here, I am forwarding control to 
another action object. So, in my config.xml, I have: 

 

I start my app on Tomcat through URL: 
http://localhost/wls/cmweb/detrunselect.do. When I submit this page, the new

URL I get is: 
http://localhost/wls/cmweb/detcontrol.do. 

This is the expected behavior. 

However, when I try to run the same on Weblogic, the second URL comes up as:

http://localhost/cmweb/detcontrol.do. 

Please note that 'wls' get dropped from the URL. This causes the app to 
fail. 

If I remove the 'redirect = true' from config.xml, then the URL appears as: 
http://localhost/wls/cmweb/detrunselect.do 

Please note, that 'wls' is not dropped. But the action object has also NOT 
changed. This is not what I want. 

So, I want to use 'redirect = true'. Can some one tell me how can I still 
get the 'wls' while using 'redirect = true'? 

Thanks in advance, 

Sujit 



Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread David Winterfeldt

Do you see any JavaScript being generated in the html?

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> I have now converted to the latest version of the
> Validator and that
> caused the server side validation to start working
> but not the javascript client side doesn't work.  It
> goes straight to
> the server validation.  I double checked everything
> mentioned in the documentation and in the previous
> messages in this
> list and everything appears ok.  The only things
> I think I need is the onsubmit addition and the
> javascript validator
> tag.  
> 
> Any more suggestions.
> 
> Scott
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 10:06AM >>>
> The JavaScript part shouldn't have anything to do
> with
> the server side other than it uses the same object
> in
> application scope.  Does the name attribute of your
> action (which matches the key the ActionForm is
> stored
> under) in the struts-config.xml the same as the form
> element's name attribute?  
> 
>
>
type="com.wintecinc.struts.example.validator.RegistrationAction"
>name="registrationForm"
>scope="request"
>validate="true"
>input="/registration.jsp">
> path="/index.jsp"/>
> 
> 
>   
>   
> 
> David
> 
> --- Scott Ryan <[EMAIL PROTECTED]> wrote:
> > Yes I am extending ValidatorForm instead of
> > ActionForm.  Did you mean
> > ValidateForm or ValidatorForm.  
> > 
> > I originally commented out the validate method
> that
> > I had but after
> > nothing happened I tried creating a validate
> method
> > that only called
> > super.validate with the proper attributes but it
> > returned an empty
> > errors object.  
> > 
> > It almost appears that I have missed a flag
> > somewhere.  It was easy to
> > get the client side to work but unlike the rest of
> > the user's I am
> > having a problem getting the server side to fire
> > correctly.  
> > 
> > I am going to try and remove the onsubmit from my
> > jsp and see if the
> > server side will fire then.
> > 
> > Thanks for your suggestions.
> > 
> > Scott Ryan
> > Developer
> > First Bank Data Corporation
> > Work: (303) 235-1485
> > Cell:(303 263-3044
> > 
> > >>> [EMAIL PROTECTED] 07/18/01 08:50AM >>>
> > Are you extending ValidateForm instead of
> > ActionForm?
> > 
> > If you have a validate method in your form, be
> sure
> > to call
> > super.validate().
> > 
> > Ryan
> > 
> > 
> > 
> > >>> [EMAIL PROTECTED] 07/18/01 08:53AM >>>
> > I am trying to use the Validator extension for
> > struts.   I have the
> > client side functioning correctly and it works
> > great.  I then go into
> > Netscape and turn off java script and the server
> > side checking is not
> > firing.  Am I missing some configuration
> parameter? 
> > I even tried
> > calling super.validate from a validate method
> within
> > my ActionForm and
> > this returned no information either.  Any ideas on
> > where I can look?
> > 
> > Thanks
> > 
> > Scott Ryan
> > Developer
> > First Bank Data Corporation
> > Work: (303) 235-1485
> > Cell:(303 263-3044
> 
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread Scott Ryan

I have now converted to the latest version of the Validator and that
caused the server side validation to start working
but not the javascript client side doesn't work.  It goes straight to
the server validation.  I double checked everything
mentioned in the documentation and in the previous messages in this
list and everything appears ok.  The only things
I think I need is the onsubmit addition and the javascript validator
tag.  

Any more suggestions.

Scott

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 07/18/01 10:06AM >>>
The JavaScript part shouldn't have anything to do with
the server side other than it uses the same object in
application scope.  Does the name attribute of your
action (which matches the key the ActionForm is stored
under) in the struts-config.xml the same as the form
element's name attribute?  


   


  
  

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> Yes I am extending ValidatorForm instead of
> ActionForm.  Did you mean
> ValidateForm or ValidatorForm.  
> 
> I originally commented out the validate method that
> I had but after
> nothing happened I tried creating a validate method
> that only called
> super.validate with the proper attributes but it
> returned an empty
> errors object.  
> 
> It almost appears that I have missed a flag
> somewhere.  It was easy to
> get the client side to work but unlike the rest of
> the user's I am
> having a problem getting the server side to fire
> correctly.  
> 
> I am going to try and remove the onsubmit from my
> jsp and see if the
> server side will fire then.
> 
> Thanks for your suggestions.
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 08:50AM >>>
> Are you extending ValidateForm instead of
> ActionForm?
> 
> If you have a validate method in your form, be sure
> to call
> super.validate().
> 
> Ryan
> 
> 
> 
> >>> [EMAIL PROTECTED] 07/18/01 08:53AM >>>
> I am trying to use the Validator extension for
> struts.   I have the
> client side functioning correctly and it works
> great.  I then go into
> Netscape and turn off java script and the server
> side checking is not
> firing.  Am I missing some configuration parameter? 
> I even tried
> calling super.validate from a validate method within
> my ActionForm and
> this returned no information either.  Any ideas on
> where I can look?
> 
> Thanks
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: More to say about setTransactionIsolation and mysql?

2001-07-18 Thread Ted Husted

The Berkley versions of the mySQL tables are suppose to support
transactions and rollback, but don't have several other features
available in the trusty myISAM tables. So that might be what you are
seeing.

I have since heard that using the Early Release rowsets for anything but
the simplest updates may be unreliable regardless of what DBMS you are
using. Seem solid on retrievals though, and that's 80% of it ...

Eventually, some other vendor will provide a better RowSet
implementation, and hopefully these problems will go away. For now, I'm
burying the fact I'm still using Statements for updates deep in my Data
Access objects, so I can switch over when that brave new day comes ;-)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/


Cindy wrote:
> 
> Ted, while surfing for a solution to a mysql problem, I hit upon some
> email
> from you in which you wrote:
> 
> "Sadly, the current Sun implementations require transactions to update a
> JDBC table, and the (default) MySQL tables still don't support
> transactions. I tried turning transactions off
> (setTransactionIsolation(TRANSACTION_NONE), but it just laughed and
> tossed the exception anyway."
> 
> I realize that you are not in the business of providing free support,
> but hope
> you know that I appreciate any details you're willing to supply on the
> above.
> 
> I think I am encountering this problem, but don't understand why - the
> version of mysql I have is 3.23.39 for Solaris.  When I examine the
> properties
> of the driver (via Forte for Java), Transaction Support is set to True.
> Also,
> when I print out the result of getTransactionIsolation, I get "2".  So,
> it would
> seem to the uninitiated (me!) that transactions are supported by this
> version
> of MySQL.  But - I am getting the exception that you mentioned above, so
> I am misunderstanding something.
> 
> Can you elaborate on this problem - or can you steer me to some
> information?
> 
> Thanks,
>Cindy
> 
> --
> Cindy Gold
> Conduant Corporation
> 1823 Sunset Place, Suite D
> Longmont, Colorado 80501   Tel: 303-485-2721 ext. 106



Re: Begginer: how do i know what button is clicked from a strut form

2001-07-18 Thread William Jaynes

If your jsp has a submit tag like:



then your Action would contain something like

String okButton = request.getParameter("OK");
if (null != okButton) { ...code... }

However, RESET and CANCEL are generally something different. A standard reset
button is handled by the browser. The standard cancel button can be detected by
a call to isCancelled(request).

Will


- Original Message -
From: "BinhMinh Nguyen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 3:02 PM
Subject: Begginer: how do i know what button is clicked from a strut form


> I am new to struts and got stuck.
>
> Please anyone tell me how do i know what button is
> clicked to detect the event from a strut:form.
> For example, my form have three buttons: OK, RESET,
> CANCEL, I would like to perform tasks that are
> associated with these button, but I dont know how to
> detect what button is clicked.
>
> Please give me example if possible thank you
>
> BM Nguyen
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/




Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread Scott Ryan

I located the problem.  It was a combination of two things.  

1) The names in my form  and the validation tag did not match.  I had
two of them matching but all three needed to match.

2) I was using the .5 build which has an imcomplete validation.xml file
and the format has changed since that build.

Once question I have for those developing enterprise applications is
how to managed the validation.xml file.  It seems that is contains
application specific information as well as enterprise specific
information.

It seems that the file contains javascript validation code which could
be used throughout the enterprise on a number of applications. It also
contains validation rules specific to the application that you are
deploying.  It seems that you either have to duplicate the javascript
code to deploy in multiple validation.xml files or you have to include
the validation rules for all applications in every validation.xml file. 
I realize you can cut and paste but this opens up possibilities for
making mistakes.  

Has anyone come up with a way to package the inline javascript so it
can be used in multiple validation.xml files and you only have to change
one file to add additional javascript functions.



Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 07/18/01 10:06AM >>>
The JavaScript part shouldn't have anything to do with
the server side other than it uses the same object in
application scope.  Does the name attribute of your
action (which matches the key the ActionForm is stored
under) in the struts-config.xml the same as the form
element's name attribute?  


   


  
  

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> Yes I am extending ValidatorForm instead of
> ActionForm.  Did you mean
> ValidateForm or ValidatorForm.  
> 
> I originally commented out the validate method that
> I had but after
> nothing happened I tried creating a validate method
> that only called
> super.validate with the proper attributes but it
> returned an empty
> errors object.  
> 
> It almost appears that I have missed a flag
> somewhere.  It was easy to
> get the client side to work but unlike the rest of
> the user's I am
> having a problem getting the server side to fire
> correctly.  
> 
> I am going to try and remove the onsubmit from my
> jsp and see if the
> server side will fire then.
> 
> Thanks for your suggestions.
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 08:50AM >>>
> Are you extending ValidateForm instead of
> ActionForm?
> 
> If you have a validate method in your form, be sure
> to call
> super.validate().
> 
> Ryan
> 
> 
> 
> >>> [EMAIL PROTECTED] 07/18/01 08:53AM >>>
> I am trying to use the Validator extension for
> struts.   I have the
> client side functioning correctly and it works
> great.  I then go into
> Netscape and turn off java script and the server
> side checking is not
> firing.  Am I missing some configuration parameter? 
> I even tried
> calling super.validate from a validate method within
> my ActionForm and
> this returned no information either.  Any ideas on
> where I can look?
> 
> Thanks
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Begginer: how do i know what button is clicked from a strut form

2001-07-18 Thread BinhMinh Nguyen

I am new to struts and got stuck.

Please anyone tell me how do i know what button is
clicked to detect the event from a strut:form.
For example, my form have three buttons: OK, RESET,
CANCEL, I would like to perform tasks that are
associated with these button, but I dont know how to
detect what button is clicked.

Please give me example if possible thank you

BM Nguyen

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



RE: Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Jain, Shipra

Hartmut, this is answer to your question regarding having separate file for
error-keys.

Few weeks ago, I asked the same question, I wanted separate file for
image-keys. Here are links to the answer I got. I was able to do it.

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg11372.html 

Also, here is link to a mail thread regarding Struts supporting multiple
resource bundles. It might interest you.

http://www.mail-archive.com/struts-user@jakarta.apache.org/msg08725.html

Shipra Jain

-Original Message-
From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 7:46 AM
To: [EMAIL PROTECTED]
Subject: Re: Displaying errors when validating forms (ActionErrors)


OK, thank you, I got it!

I don't understand it, but the problems seems to be the place oft the
 tag within the JSP. I placed it at the end of the 
element with bad result. When I moved it top to the  element it is
ok. May be there is a problem with the html in the jsp-document ...

Do I am allowed to ask another question:
If I want the error-keys not to have in the main ressource-file
(web.xml:)
( ...
  
 application
 asim
  

... )
but in another separate file using 
,where do I have then to deploy the asim-form-validation.properties
File???

TIA

Guus Holshuijsen schrieb:
> 
> Hartmut,
> 
> I do it at the end of an action's perform() method using the
"construction"
> given in my previous reply!
> 
> What I describe is only valid if your controller checks for errors itself.
> In case you let Struts handle the validation automatically, I advice you
to
> look at the Struts source code.
> The following code snippet is from the Action.java class:
> 
> /**
>  * The request attributes key under which your action should store an
>  * org.apache.struts.action.ActionErrors object, if you
>  * are using the corresponding custom tag library elements.
>  */
> public static final String ERROR_KEY =
"org.apache.struts.action.ERROR";
> 
> Concluding: the errors are stored in the request (session?) attribute
> "org.apache.struts.action.ERROR".
> 
> Regards,
> Guus
> 
> - Original Message -
> From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 12:48
> Subject: Re: Displaying errors when validating forms (ActionErrors)
> 
> > No, I think I did not!
> > My validate Method looks like that, it returns Errors back to the
> > controller servlet.
> > - Where is the place to save the errors in the request???
> >
> >
> >public ActionErrors validate(ActionMapping pMapping,
> > HttpServletRequest pRequest)
> >{
> >   System.out.println("VALIDIERE");
> >   ActionErrors errors = new ActionErrors();
> >   if (iBenutzer == null || iBenutzer.length() < 1)
> >   {
> >  errors.add("benutzungsname",
> >  new ActionError("error.login.benutzername.required"));
> >   }
> >   if (iPasswort == null || iPasswort.length() < 1)
> >   {
> >  errors.add("passwort",
> >  new ActionError("error.login.passwort.required"));
> >   }
> >   if (iSprache == null || iSprache.length() < 2 ||
> > iSprache.equals("blank"))
> >   {
> >  errors.add("sprache",
> >  new ActionError("error.login.passwort.required"));
> >   }
> >
> >   return errors;
> >}
> >
> >
> >
> > Guus Holshuijsen schrieb:
> > >
> > > Do you save your errors?
> > >
> > > // Report any errors we have discovered
> > > if ( !errors.empty() )
> > > {
> > >   saveErrors( request, errors );
> > > }
> > >
> > > Regards,
> > > Guus
> > >
> > > - Original Message -
> > > From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, July 18, 2001 11:55
> > > Subject: Displaying errors when validating forms (ActionErrors)
> > >
> > > > Hallo,
> > > >
> > > > I have a problem to display ActionErrors. I use the validate-Method
to
> > > > validate forms, like that:
> > > >
> > > > --
> > > > public ActionErrors validate(ActionMapping mapping,
HttpServletRequest
> > > > request) {
> > > > ActionErrors errors = new ActionErrors();
> > > > if (iBenutzer == null || iBenutzer.length() < 1) {
> > > > errors.add("benutzungsname", new
> > > > ActionError("error.login.benutzername.required"));
> > > > }}
> > > > --
> > > >
> > > > But when I want to display that error, I can't see anything.
Why?
> > > >
> > > > * errors.header=
> > > >   errors.footer=
> > > >   error.login.benutzername.required=that is an error ...
> > > >
> > > >   is in the property-file! That property-file is available (set in
> > > > web.xml)!
> > > >
> > > > * the JSP contains:
> > > >   
> > > >   
> > > >
> > > > Who can help me?!
> > > > What is wrong??
> >

-- 
_

Hartmut Bernecker
Dipl.-Wirtschaftsinformatiker (BA)
Electronic Publishing
ASIM(r) - CONT

struts-user@jakarta.apache.org

2001-07-18 Thread Aaron Ravenberg

Hi,

My  are not working with my template set up.  When I include the
html and bean taglib directive in my login.jsp it my server throws a
"javax.servlet.ServletException: runtime failure in custom tag 'get'".  When
I move it to the template.jsp or index.jsp, the tags print out in the source
but do not do anything.  Any pointers would be appreciated.  Sample code
included below.  I am using weblogic 5.1 sp 9

Thank you,

Aaron Ravenberg


index.jsp


 
 



template.jsp


 
  
   
   
  
 


login.jsp


 
  
   
   
 


myHeader.jsp

Just static html




Concurrency with ActionForms

2001-07-18 Thread Kevin McLain

Does anybody know how Struts handles concurrency when it uses Reflection to
update ActionForm attributes? I am assuming that it doesn't but this can be
problematic if, in the case of a web application, you have two browser
windows - for the same session (this can de done in IE but opening a new
browser window from inside a current one) - accessing the same session
object concurrently. Just wondering

Cheers,

Struts Newbie



AW: getSession in xxxForm

2001-07-18 Thread Holger Wiechert

HI,
I'm having the same problem (and saw this posting right after I've put mine in).
Yes, getting the ActionServlet let's me access the ServletContext, but then I'm even
further away from getting the request that caused the ActionForm to be created, or do 
I see this wrong?

Well, I guess, that I could do something like: having always a different ActionMapping 
"in front"
of the one, where the ActionForm will be created. Within this pre-executed Action I 
use the same Form
(and have access to the request), change the Form according to the request and forward 
it to  the
real Action (just the first idea I had).

But isn't there a way of accessing the request somhow directly from within the 
constructor of the Form?

Holger



-Ursprungliche Nachricht-
Von: Rajan Gupta [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Juli 2001 16:13
An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Betreff: Re: getSession in xxxForm 


You have access to ActionServlet as a protected attribute in ActionForm.
do a getServletContext() on the instance & you are on your way 
--- Stefan Faist <[EMAIL PROTECTED]> wrote:
> Hello All,
> I have set an attribute into a session: "session.setAttribute("id",
> xxxForm.getId());"
> Now I want to get this attribute in a xxxForm:
> "session.getAttribute("id");". But I have no HttpRequest object.
> 
> How can I get the session in the xxxForm?
> Can someone help me?
> 
> Stefan
> --
> hmi-Informatik GmbH
> Zettachring 6 - D-70567 Stuttgart
> E-Mail: [EMAIL PROTECTED]
> http://www.hmi-informatik.de
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




Re: Access to HttpServletRequest within ActionForm

2001-07-18 Thread Erik Hatcher

Look at the ActionForm's reset method.   That gives you the request and is
called when its instantiated by the ActionServlet prior to population from
the request.

One note - reset is not currently called when instantiated from the
 tag unfortunately, but apparently this will be alleviated in the
near future.   I'll submit a patch for this eventually if Craig doesn't get
to it first.

Erik


- Original Message -
From: "Holger Wiechert" <[EMAIL PROTECTED]>
To: "User-Struts (E-Mail)" <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 10:44 AM
Subject: Access to HttpServletRequest within ActionForm


Hi,

is there a way of getting access within an ActionForm to the request that
caused the ActionServlet using this ActionForm?

Something like:

public class MyActionForm extends ActionForm
{
public MyActionForm
{
super();
HttpServletRequest request = getItSomeHow();
...
}
...
}

When the ActionForm is getting created, I need access to some objects that
are placed within the current session.
Depending on those values, the ActionForm shall be set up differently.

Thanks in advance,
Holger





Access to HttpServletRequest within ActionForm

2001-07-18 Thread Holger Wiechert

Hi,

is there a way of getting access within an ActionForm to the request that caused the 
ActionServlet using this ActionForm?

Something like:

public class MyActionForm extends ActionForm
{
public MyActionForm
{
super();
HttpServletRequest request = getItSomeHow();
...
}
...
}

When the ActionForm is getting created, I need access to some objects that are placed 
within the current session.
Depending on those values, the ActionForm shall be set up differently.

Thanks in advance,
Holger




RE: html:errors tag?

2001-07-18 Thread David Winterfeldt

Ignore what I said about the logic tags since that
doesn't tell you whether a specific field has an
error.  You could use the errorsExists tag from my
Validator package if you want to though.  And you
could make errorsNotExist version of the tag.


   red label


David
http://home.earthlink.net/~dwinterfeldt

--- "Gogineni, Pratima" <[EMAIL PROTECTED]>
wrote:
> Hi - I just did this in my form.
> 
> html:errors itself doesnt do this. My actionform
> holds the   row and column
> index of my error field which are set at the of
> validation.
> 
> what i do is check if the error object exists and if
> the row and column
> indices match one of the fields being displayed -
> the cell is colored red.
> 
> Pratima
> 
> 
> 
> -Original Message-
> From: Matthias Brahm [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 9:25 AM
> To: '[EMAIL PROTECTED]'
> Subject: html:errors tag?
> 
> 
> Hi,
> 
> is it possible to do something like this with
> struts:
> 
> I have a form with labels for the input fields.
> These labels have the font color blue.
> 
> The Form is validated by the FormBean.
> When one or more fields of the form are invalid
> and the control is forwarded back to the input form,
> the labels of the invalid input fields should have
> the font color red.
> 
> In general, is it possible to output one text and in
> case of an error 
> another one?
> 
> Can I do this with the struts-tag-libs
> (html:errors)?
> 
> Thanls


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: html:errors tag?

2001-07-18 Thread David Winterfeldt

You can check if there is an errors object in scope
using the logic tags to change the color of a label.

  
red label1
  
  
blue lable2
  

If you want to display the error message next to a 
field, you can do this.  This will display all error
messages that have been set for the 'name' property.



David

--- Matthias Brahm <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> is it possible to do something like this with
> struts:
> 
> I have a form with labels for the input fields.
> These labels have the font color blue.
> 
> The Form is validated by the FormBean.
> When one or more fields of the form are invalid
> and the control is forwarded back to the input form,
> the labels of the invalid input fields should have
> the font color red.
> 
> In general, is it possible to output one text and in
> case of an error 
> another one?
> 
> Can I do this with the struts-tag-libs
> (html:errors)?
> 
> Thanls
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



RE: Where do YOU put JDBC calls?

2001-07-18 Thread Ritter, Steve

Ryan, you should really read the J2EE blueprints on DAO.  It covers everything you 
need to know.
 
Search aroun javasoft.com for the blueprints (they are documents, not software).
 
--Steve

-Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 7:36 AM
To: [EMAIL PROTECTED]
Subject: RE: Where do YOU put JDBC calls?


>From my understanding then - 
 
I would have my Business Object class that wraps the table, lets call it Address.
I would have a DAO object that is specific to that Business object for the JDBC calls, 
lets call it AddressDAO.
 
In Address, I would have loadAddress, DeleteAddress, InsertAddress, all of which would 
call AddressDAO to do the actual JDBC call?
 
Any simple examples of these two classes that are not EJB's? Is this the route to go 
if I'm not using EJB's?
 
Thanks,
Ryan
 


>>> [EMAIL PROTECTED] 07/18/01 08:17AM >>>
Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.

regards
pathangi r

-Original Message-
From: Ryan Cornia [ mailto:[EMAIL PROTECTED]] 
 
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?

I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)

ie- public boolean select(Connection cn1, String primaryKey)

How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.

Thanks,
Ryan







RE: html:errors tag?

2001-07-18 Thread Gogineni, Pratima

Hi - I just did this in my form.

html:errors itself doesnt do this. My actionform holds the   row and column
index of my error field which are set at the of validation.

what i do is check if the error object exists and if the row and column
indices match one of the fields being displayed - the cell is colored red.

Pratima



-Original Message-
From: Matthias Brahm [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 9:25 AM
To: '[EMAIL PROTECTED]'
Subject: html:errors tag?


Hi,

is it possible to do something like this with struts:

I have a form with labels for the input fields.
These labels have the font color blue.

The Form is validated by the FormBean.
When one or more fields of the form are invalid
and the control is forwarded back to the input form,
the labels of the invalid input fields should have the font color red.

In general, is it possible to output one text and in case of an error 
another one?

Can I do this with the struts-tag-libs (html:errors)?

Thanls



html:errors tag?

2001-07-18 Thread Matthias Brahm

Hi,

is it possible to do something like this with struts:

I have a form with labels for the input fields.
These labels have the font color blue.

The Form is validated by the FormBean.
When one or more fields of the form are invalid
and the control is forwarded back to the input form,
the labels of the invalid input fields should have the font color red.

In general, is it possible to output one text and in case of an error 
another one?

Can I do this with the struts-tag-libs (html:errors)?

Thanls




RE: html:select/options

2001-07-18 Thread DHarty

Thank you!



> -Original Message-
> From: Joe Clark [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 12:12 PM
> To: undisclosed-recipients:
> Subject: RE: html:select/options
> 
> 
>  Use the 'value' attribute to make the selection. For example assume you
> have a dropdown of countries and one entry is 'United States' the code
> below would select 'United States'.
>property="country" value="United States">
> ...
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED] at INTERNET
> [mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
> @alltel.com]
> Sent: Wednesday, July 18, 2001 10:38 AM
> To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
> Subject: html:select/options
> 
> 
>  Is there a way to dictate which "option" in a collection is initially
> set
> as
>  "selected" when the page is rendered?
>  ex
>
>  For example, I have a collection of projects that are rendered by the
>   project
>  description box when the selection is changed.  The problem is
>  when the page
>  is first rendered, the two don't always match up.  I initialize the
>  description box to the first item in the collection, but the
>  select doesn't
>  always choose the first item.
> 
>  Thanks
>  D



RE: html:select/options

2001-07-18 Thread Joe Clark

 Use the 'value' attribute to make the selection. For example assume you
have a dropdown of countries and one entry is 'United States' the code
below would select 'United States'.
  
...


-Original Message-
From: [EMAIL PROTECTED] at INTERNET
[mailto:IMCEACCMAIL-struts-user+40jakarta+2Eapache+2Eorg+20at+20INTERNET
@alltel.com]
Sent: Wednesday, July 18, 2001 10:38 AM
To: Clark, Joe; [EMAIL PROTECTED] at INTERNET
Subject: html:select/options


 Is there a way to dictate which "option" in a collection is initially
set
as
 "selected" when the page is rendered?
 ex
  


Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread David Winterfeldt

The JavaScript part shouldn't have anything to do with
the server side other than it uses the same object in
application scope.  Does the name attribute of your
action (which matches the key the ActionForm is stored
under) in the struts-config.xml the same as the form
element's name attribute?  


   


  
  

David

--- Scott Ryan <[EMAIL PROTECTED]> wrote:
> Yes I am extending ValidatorForm instead of
> ActionForm.  Did you mean
> ValidateForm or ValidatorForm.  
> 
> I originally commented out the validate method that
> I had but after
> nothing happened I tried creating a validate method
> that only called
> super.validate with the proper attributes but it
> returned an empty
> errors object.  
> 
> It almost appears that I have missed a flag
> somewhere.  It was easy to
> get the client side to work but unlike the rest of
> the user's I am
> having a problem getting the server side to fire
> correctly.  
> 
> I am going to try and remove the onsubmit from my
> jsp and see if the
> server side will fire then.
> 
> Thanks for your suggestions.
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044
> 
> >>> [EMAIL PROTECTED] 07/18/01 08:50AM >>>
> Are you extending ValidateForm instead of
> ActionForm?
> 
> If you have a validate method in your form, be sure
> to call
> super.validate().
> 
> Ryan
> 
> 
> 
> >>> [EMAIL PROTECTED] 07/18/01 08:53AM >>>
> I am trying to use the Validator extension for
> struts.   I have the
> client side functioning correctly and it works
> great.  I then go into
> Netscape and turn off java script and the server
> side checking is not
> firing.  Am I missing some configuration parameter? 
> I even tried
> calling super.validate from a validate method within
> my ActionForm and
> this returned no information either.  Any ideas on
> where I can look?
> 
> Thanks
> 
> Scott Ryan
> Developer
> First Bank Data Corporation
> Work: (303) 235-1485
> Cell:(303 263-3044


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Wer is d/load 4 Actions.classes - need 2 reinstall !!

2001-07-18 Thread Chuck Amadi

Hi, all i previously had config/editing problems regarding Action
Classes.ie ActionMappings,ActionForward, and ApplicationMappings .
Thus Pls can someone direct me to what download file as i have checked
my jakarta-struts-1.0-b2,struts-trail-map.
Thus there are no examples and in relation to the sutruts-examples
either as on open the .java file in a editor (notepad) the code is
encrypted/un-readable.

Thus Pls point me were i can check or obviously download again.As this
has now caused me to fall back a fair bit .

Cheers All Chuck

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at [EMAIL PROTECTED]) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.





Re: Editing and Saving a Form

2001-07-18 Thread dsf65b y b3763476b3

Hi there!  [Windows NT, VAJ 3.5.3 WTE]


I'm trying to use the approach from the "struts-example" application to edit 
and save a form. The user is directed to "editInfo.do" which populates the 
form and forwards to "editinfo.jsp" which, on submit (starting a new 
request?), invokes the "saveInfo.do". But when I enter the perform method of 
the Action object associated with the "saveInfo" mapping a new form has been 
created and I can no longer access the values from the editInfo form. I can 
see that it hasn't merely been cleared (ActionForm.reset(...)) because I 
dump it to stdout.

I brutally 'clipboarded' the code from the struts-example app (see bottom of 
message) so I'm having a really really hard time trying to understand why it 
wont work! If you could offer any advice I would be extremely grateful.

brgds,
S. Bro



[struts-config.xml]













[/struts-config.xml]


[EditInfoAction.perform()]

public ActionForward perform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {

// Extract attributes we will need
Locale locale = getLocale(request);
MessageResources messages = getResources();
HttpSession session = request.getSession();

// retreive the form or create a new one if it isn't there >>

if (form == null) {
if (servlet.getDebug() >= 1)
servlet.log(" Creating new EditInfoForm bean under key " + 
mapping.getAttribute());
form = new EditInfoForm();
if ("request".equals(mapping.getScope()))
request.setAttribute(mapping.getAttribute(), form);
else
session.setAttribute(mapping.getAttribute(), form);
}

// FORM IS POPULATED HERE

System.out.println(form);

// Forward control to the specified success URI
return (mapping.findForward("success"));
}
[/EditInfoAction.perform()]

[SaveInfoAction.perform()]

public ActionForward perform(
ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {

// Extract attributes we will need
Locale locale = getLocale(request);
MessageResources messages = getResources();

EditInfoForm infoForm = (EditInfoForm)form;// <-- NEWLY CREATED  
FORM :(

// TODO:Update personal info >>
System.out.println("SaveInfoAction.perform(): Updating info:");
System.out.println("\t" + infoForm);



// Forward control to the specified success URI
return (mapping.findForward("success"));
}
[/SaveInfoAction.perform()]

Ofcourse there's alot more to the jsp file than shown here but for clarity's 
sake:

[editinfo.jsp]




[/editinfo.jsp]



_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




html:select/options

2001-07-18 Thread DHarty


 Is there a way to dictate which "option" in a collection is initially set
as
 "selected" when the page is rendered?
 ex



RE: Multiple Language Support with struts

2001-07-18 Thread Mahesh Bhagia

Also make sure to locale based on client, since  locale for the server
is based on single JVM
 
Mahesh

-Original Message-
From: "Meißner, Heinz" [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 11:32 AM
To: '[EMAIL PROTECTED]'
Subject: AW: Multiple Language Support with struts


hi
 
if u set session  u can do more than 1 language .
 
c ya heinz

-Ursprüngliche Nachricht-
Von: Robert Mayhew [mailto:[EMAIL PROTECTED]]
Gesendet: Mittwoch, 18. Juli 2001 17:27
An: 'Struts Users'
Betreff: Multiple Language Support with struts



I am currently developing a multi-language web application that will
require the support of different languages (locale) per user. The goal
is to have a site that displays information in a users selected
language. So different application resources would be used depending on
the selected language.

I have 2 questions. 

Does struts allow only one locale is run at a time? (Meaning the
application is ether running Japanese, Arabic, or English, but not all
at once)

Is the standard way to operate a multi-lingual web app to have different
instances of application? Each one set to a different locale?


Thanks 

Rob Mayhew 




AW: Multiple Language Support with struts

2001-07-18 Thread "Meißner, Heinz"
Title: Multiple Language Support with struts



hi
 
if u 
set session  u can do more than 1 language .
 
c ya 
heinz

  -Ursprüngliche Nachricht-Von: Robert Mayhew 
  [mailto:[EMAIL PROTECTED]]Gesendet: Mittwoch, 18. Juli 2001 
  17:27An: 'Struts Users'Betreff: Multiple Language 
  Support with struts
  I am currently developing a multi-language web 
  application that will require the support of different languages (locale) per 
  user. The goal is to have a site that displays information in a users selected 
  language. So different application resources would be used depending on the 
  selected language.
  I have 2 questions. 
  Does struts allow only one locale is run at a time? 
  (Meaning the application is ether running Japanese, Arabic, or English, but 
  not all at once)
  Is the standard way to operate a multi-lingual web 
  app to have different instances of application? Each one set to a different 
  locale?
  Thanks 
  Rob Mayhew 


Multiple Language Support with struts

2001-07-18 Thread Robert Mayhew
Title: Multiple Language Support with struts





I am currently developing a multi-language web application that will require the support of different languages (locale) per user. The goal is to have a site that displays information in a users selected language. So different application resources would be used depending on the selected language.

I have 2 questions.


Does struts allow only one locale is run at a time? (Meaning the application is ether running Japanese, Arabic, or English, but not all at once)

Is the standard way to operate a multi-lingual web app to have different instances of application? Each one set to a different locale?


Thanks


Rob Mayhew





Indexed properties with multiple select options

2001-07-18 Thread Michael Terry

Hi -

In my JSP I'm generating (a small unknown number) of multiselect
SELECT drop-down lists with values taken from a Hashtable containing
ArrayLists, such that each drop-down corresponds to the strings in
an ArrayList in the Hashtable:

  <% int n = 0; %>
  
<%
  prop = "attributeKeys[" + n + "]";
  n++;
%>


  

  

In the associated form bean, I assume I need to use an ArrayList (named attList
below) which will contain the String[] arrays of selected values passed back
from my SELECTs. So I have my indexed property String[] attributeKeys with
getter and setter thus:

public String[] getAttList(int idx) {
return (String[])attList.get(idx);
}

public void setAttList(int idx, String[] keys) {
attList.set(idx, keys);
}

But the problem is that this collapses in BeanUtils.populate with a
type mismatch error:

  javax.servlet.ServletException: BeanUtils.populate
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:486)
  Root cause: 
  java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at 
org.apache.struts.util.PropertyUtils.setIndexedProperty(PropertyUtils.java:688)

I'm quite new to Struts, and can't understand what I'm doing wrong!
Is it actually possible to use multiple select options with indexed
properties? Any ideas? Thanks!

Michael




Re: Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread Scott Ryan

Yes I am extending ValidatorForm instead of ActionForm.  Did you mean
ValidateForm or ValidatorForm.  

I originally commented out the validate method that I had but after
nothing happened I tried creating a validate method that only called
super.validate with the proper attributes but it returned an empty
errors object.  

It almost appears that I have missed a flag somewhere.  It was easy to
get the client side to work but unlike the rest of the user's I am
having a problem getting the server side to fire correctly.  

I am going to try and remove the onsubmit from my jsp and see if the
server side will fire then.

Thanks for your suggestions.

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044

>>> [EMAIL PROTECTED] 07/18/01 08:50AM >>>
Are you extending ValidateForm instead of ActionForm?

If you have a validate method in your form, be sure to call
super.validate().

Ryan



>>> [EMAIL PROTECTED] 07/18/01 08:53AM >>>
I am trying to use the Validator extension for struts.   I have the
client side functioning correctly and it works great.  I then go into
Netscape and turn off java script and the server side checking is not
firing.  Am I missing some configuration parameter?  I even tried
calling super.validate from a validate method within my ActionForm and
this returned no information either.  Any ideas on where I can look?

Thanks

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044



HTTP request lost using HTTPS

2001-07-18 Thread Joe.Clark

> My environment is configured to run on Tomcat 3.2 and Struts 1.0.
> When I run my application in an internal http environment, all is
> well.  My http request and form beans are created and forwarded to my
> Actions accordingly.  However, when I make my application available as
> an external https environment, I lose my http request and my form
> beans are not populated.  My page navigation is working, thus I know
> that my action mappings are correct.  I enabled SSL as per the
> instructions inside the server.xml file, but still no luck. Any help
> would be greatly appreciated!
> Thanks in advance!
> 
> Joe Clark



Directory Problem

2001-07-18 Thread Soniya Satbhai

Hello,
 I am not clear about the following things:- While developing
struts applications , in which directory should I place my jsp files ,
java files , struts-config.xml and struts-config_1_0.dtd?
Also , if I place my java files in a package , under which
directory should the package be placed?
Thanks,
Soniya.




Trapping an value

2001-07-18 Thread Melissa Rabin

Hello.  I am fiddling with an application that uses Struts  &
 tags, and I need to generate some DHTML depending on which
option is selected.  However, only the  tag accepts javascript
events;  therefore, any onClick event will be triggered when the user pulls
down the menu, not when they actually make a selection.  Can anyone give me
some suggestions on how to trap the value selected?

Code:

   Lookup an Entry in the JNDI
Tree
   Make an Entry in the JNDI Tree
   Change An Entry In The JNDI
Tree
   Remove An Entry In The JNDI
Tree



Melissa Rabin
Web Developer




Re: Server Side Validation not firing for Validator whenJava Script is off

2001-07-18 Thread Ryan Cornia



Are you extending ValidateForm instead of 
ActionForm?
 
If you have a validate method in your form, be sure to call 
super.validate().
 
Ryan
 
>>> [EMAIL PROTECTED] 07/18/01 08:53AM 
>>>I am trying to use the Validator extension for 
struts.   I have theclient side functioning correctly and it works 
great.  I then go intoNetscape and turn off java script and the server 
side checking is notfiring.  Am I missing some configuration 
parameter?  I even triedcalling super.validate from a validate method 
within my ActionForm andthis returned no information either.  Any ideas 
on where I can look?ThanksScott RyanDeveloperFirst Bank 
Data CorporationWork: (303) 235-1485Cell:    (303 
263-3044


RE: Where do YOU put JDBC calls?

2001-07-18 Thread Pathangi, Rao H.

Well, I too thought about this...

Then I thought, If I leave the getConnection() open and let the DAO take
care of it, I thought the same DAO can be used for multiple datasources. The
way you get a connection does not matter.

Well, I am still 50/50 about this idea though. I am thinking of another
approach

Lets say I have an abstract class DAOFactory.(A factory that creates DAO's)

so now My ABCDaofactory extends DAOFactory. (ABCDaoFactory is a singleton)

In ABCDaoFactory, i write an init method which sets the connection
Manager(It could be an Oracle manager or a DB2Connection manager).

Also, the ABCDaofactory  has a method getMyBottleOfPicklesDao() which
returns MyBottleOfPicklesDao (A data access object).

This factory would get you a ready made DAO and all you got to do is use
it.(Bruce Eckel calls these people who use these as Client Developers Hee
ha!!)

The MyBottleOfPicklesDao would extend a BAseDAO which has a concrete (not
abstract) getConnection method which says 

abstract class BaseDAO 

getConnection()
{

// This way you delegete the getConnection in the base class and that
connection depends on the Connection Manager //which is another layer of
abstraction that is set in the ABCDaoFactory.
conn = connectionManager.getConnection();// the connectionManager
variable is set in the factory
}

this way your DAo doesnt need to know how to get a connection


regards
pathangi r






-Original Message-
From: Geddes, Mark (ANTS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 9:39 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


This is a nice pattern, but I do not want my DAO to be responsible for
getting the connection. I need to use them in the web-tier (no EJBs) and
possibly also the middle tier. In each case the DataSource may be obtained
in a different manner and it is not the DAO's responsibility to know how.

mark

-Original Message-
From: Pathangi, Rao H. [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 15:33
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Mark

To handle this situation, I wrote a base class which has the connection
Object as a protected variable. Lets say you have a method readOrder(String
orderId)..

Write another abstract method getConnection() in your BaseDAO. Use
connection manager or pooling or whatever, but get a connection in this
method and implement it in your DAo that extends the BaseDAo

Now in the method readOrder can read something like this

readOrder(String OrderId)
{
try
{
   Connection con = getConnection(); // Your DAO is now plugged
   // Do something with the connection...   

}
catch{}
finally
{
//close connection, unplug your DAO
}
}


Hope that helps
pathangi r

-Original Message-
From: Geddes, Mark (ANTS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 9:23 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


ditto.
I am always reading that the Connection reference should be passed into the
method. After writing a few DAOs in this manner, I found the exception
handling too tedious - I was checking for closed connections both within the
DAO method and also in the calling method. So I usually pass in a DataSource
and ensure that my DAO method obtains and closes the connection. Shoot me
down if you like.

Mark

-Original Message-
From: Pathangi, Rao H. [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 15:18
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.
 
regards
pathangi r
 
 -Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.
 
Thanks,
Ryan
 


***
This email message contains confidential information for the above addressee
only.  If you are not

Server Side Validation not firing for Validator when Java Script is off

2001-07-18 Thread Scott Ryan

I am trying to use the Validator extension for struts.   I have the
client side functioning correctly and it works great.  I then go into
Netscape and turn off java script and the server side checking is not
firing.  Am I missing some configuration parameter?  I even tried
calling super.validate from a validate method within my ActionForm and
this returned no information either.  Any ideas on where I can look?

Thanks

Scott Ryan
Developer
First Bank Data Corporation
Work: (303) 235-1485
Cell:(303 263-3044



RE: Where do YOU put JDBC calls?

2001-07-18 Thread Ryan Cornia



From my understanding then - 
 
I would have my Business Object class that wraps the table, 
lets call it Address.
I would have a DAO object that is specific to that Business 
object for the JDBC calls, lets call it AddressDAO.
 
In Address, I would have loadAddress, DeleteAddress, 
InsertAddress, all of which would call AddressDAO to do the actual JDBC 
call?
 
Any simple examples of these two classes that are not EJB's? 
Is this the route to go if I'm not using EJB's?
 
Thanks,
Ryan
 
>>> [EMAIL PROTECTED] 07/18/01 08:17AM 
>>>Iam using the DAO(Data Access Object) design pattern for such 
Data accesssituations. DAO is a layer of abstraction that works in 
conjunction with theBusiness Object which is nothing but a container for 
business data. theBusiness Object calls the DAO's business methods. The 
DAO's Business methodswrap the JDBC Code for data base interaction. Its been 
explained clearly onthe J2EE blueprints section.Once you are done writing 
your DAO's, extend theDAO into a session bean or use it 
seperately.regardspathangi r-Original 
Message-From: Ryan Cornia [mailto:[EMAIL PROTECTED]]Sent: 
Wednesday, July 18, 2001 8:56 AMTo: 
[EMAIL PROTECTED]Subject: Where do YOU put JDBC 
calls?I'm wondering what people are considering best practices 
for JDBC calls?I have been writing beans that wrap a database table, and 
include functions"select", "insert", "delete". These functions either load 
the bean, insertthe bean values in the database, or delete the record from 
the database. Inall of these functions, I pass in a database connection from 
the action. (Orwhatever else is calling the bean.)ie- public boolean 
select(Connection cn1, String primaryKey)How are others doing it? I 
think this is a good approach, but want to see ifsomeone has come up with 
something better.Thanks,Ryan


RE: Where do YOU put JDBC calls?

2001-07-18 Thread Geddes, Mark (ANTS)

This is a nice pattern, but I do not want my DAO to be responsible for
getting the connection. I need to use them in the web-tier (no EJBs) and
possibly also the middle tier. In each case the DataSource may be obtained
in a different manner and it is not the DAO's responsibility to know how.

mark

-Original Message-
From: Pathangi, Rao H. [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 15:33
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Mark

To handle this situation, I wrote a base class which has the connection
Object as a protected variable. Lets say you have a method readOrder(String
orderId)..

Write another abstract method getConnection() in your BaseDAO. Use
connection manager or pooling or whatever, but get a connection in this
method and implement it in your DAo that extends the BaseDAo

Now in the method readOrder can read something like this

readOrder(String OrderId)
{
try
{
   Connection con = getConnection(); // Your DAO is now plugged
   // Do something with the connection...   

}
catch{}
finally
{
//close connection, unplug your DAO
}
}


Hope that helps
pathangi r

-Original Message-
From: Geddes, Mark (ANTS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 9:23 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


ditto.
I am always reading that the Connection reference should be passed into the
method. After writing a few DAOs in this manner, I found the exception
handling too tedious - I was checking for closed connections both within the
DAO method and also in the calling method. So I usually pass in a DataSource
and ensure that my DAO method obtains and closes the connection. Shoot me
down if you like.

Mark

-Original Message-
From: Pathangi, Rao H. [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 15:18
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.
 
regards
pathangi r
 
 -Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.
 
Thanks,
Ryan
 


***
This email message contains confidential information for the above addressee
only.  If you are not the intended addressee you must not disclose or use
the information in any manner whatsoever.

Any opinion or views contained in this email message are those of the
sender, do not represent those of the Company in any way and reliance should
not be placed upon its contents.

Unless otherwise stated this email message is not intended to be
contractually binding.  Where an Agreement exists between our respective
companies and there is conflict between the contents of this email message
and the Agreement then the terms of that Agreement shall prevail.

Abbey National Treasury Services plc. Registered in England. Registered
Office:  Abbey House, Baker Street, London NW1 6XL.  Company Registration
No: 2338548.  Regulated by the SFA
***



RE: Where do YOU put JDBC calls?

2001-07-18 Thread Pathangi, Rao H.

Mark

To handle this situation, I wrote a base class which has the connection
Object as a protected variable. Lets say you have a method readOrder(String
orderId)..

Write another abstract method getConnection() in your BaseDAO. Use
connection manager or pooling or whatever, but get a connection in this
method and implement it in your DAo that extends the BaseDAo

Now in the method readOrder can read something like this

readOrder(String OrderId)
{
try
{
   Connection con = getConnection(); // Your DAO is now plugged
   // Do something with the connection...   

}
catch{}
finally
{
//close connection, unplug your DAO
}
}


Hope that helps
pathangi r

-Original Message-
From: Geddes, Mark (ANTS) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 9:23 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


ditto.
I am always reading that the Connection reference should be passed into the
method. After writing a few DAOs in this manner, I found the exception
handling too tedious - I was checking for closed connections both within the
DAO method and also in the calling method. So I usually pass in a DataSource
and ensure that my DAO method obtains and closes the connection. Shoot me
down if you like.

Mark

-Original Message-
From: Pathangi, Rao H. [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 15:18
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.
 
regards
pathangi r
 
 -Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.
 
Thanks,
Ryan
 


***
This email message contains confidential information for the above addressee
only.  If you are not the intended addressee you must not disclose or use
the information in any manner whatsoever.

Any opinion or views contained in this email message are those of the
sender, do not represent those of the Company in any way and reliance should
not be placed upon its contents.

Unless otherwise stated this email message is not intended to be
contractually binding.  Where an Agreement exists between our respective
companies and there is conflict between the contents of this email message
and the Agreement then the terms of that Agreement shall prevail.

Abbey National Treasury Services plc. Registered in England. Registered
Office:  Abbey House, Baker Street, London NW1 6XL.  Company Registration
No: 2338548.  Regulated by the SFA
***



RE: Where do YOU put JDBC calls?

2001-07-18 Thread Geddes, Mark (ANTS)

ditto.
I am always reading that the Connection reference should be passed into the
method. After writing a few DAOs in this manner, I found the exception
handling too tedious - I was checking for closed connections both within the
DAO method and also in the calling method. So I usually pass in a DataSource
and ensure that my DAO method obtains and closes the connection. Shoot me
down if you like.

Mark

-Original Message-
From: Pathangi, Rao H. [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 15:18
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.
 
regards
pathangi r
 
 -Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.
 
Thanks,
Ryan
 


***
This email message contains confidential information for the above addressee only.  If 
you are not the intended addressee you must not disclose or use the information in any 
manner whatsoever.

Any opinion or views contained in this email message are those of the sender, do not 
represent those of the Company in any way and reliance should not be placed upon its 
contents.

Unless otherwise stated this email message is not intended to be contractually 
binding.  Where an Agreement exists between our respective companies and there is 
conflict between the contents of this email message and the Agreement then the terms 
of that Agreement shall prevail.

Abbey National Treasury Services plc. Registered in England. Registered Office:  Abbey 
House, Baker Street, London NW1 6XL.  Company Registration No: 2338548.  Regulated by 
the SFA
***



RE: Where do YOU put JDBC calls?

2001-07-18 Thread Pathangi, Rao H.

Please ignore my statement "the Business Object calls the DAO's business
methods". It need not always do that.
You could implement a factoryObject that does it for you and by using a
factoryObject you can maintain the anonymity between the Business Object and
the DAO.

thanks
pathangi r



-Original Message-
From: Pathangi, Rao H. 
Sent: Wednesday, July 18, 2001 9:18 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Where do YOU put JDBC calls?


Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.
 
regards
pathangi r
 
 -Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.
 
Thanks,
Ryan
 



RE: Where do YOU put JDBC calls?

2001-07-18 Thread Pathangi, Rao H.

Iam using the DAO(Data Access Object) design pattern for such Data access
situations. DAO is a layer of abstraction that works in conjunction with the
Business Object which is nothing but a container for business data. the
Business Object calls the DAO's business methods. The DAO's Business methods
wrap the JDBC Code for data base interaction. Its been explained clearly on
the J2EE blueprints section.Once you are done writing your DAO's, extend the
DAO into a session bean or use it seperately.
 
regards
pathangi r
 
 -Original Message-
From: Ryan Cornia [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 18, 2001 8:56 AM
To: [EMAIL PROTECTED]
Subject: Where do YOU put JDBC calls?



I'm wondering what people are considering best practices for JDBC calls?
 
I have been writing beans that wrap a database table, and include functions
"select", "insert", "delete". These functions either load the bean, insert
the bean values in the database, or delete the record from the database. In
all of these functions, I pass in a database connection from the action. (Or
whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String primaryKey)
 
How are others doing it? I think this is a good approach, but want to see if
someone has come up with something better.
 
Thanks,
Ryan
 




Re: Where do YOU put JDBC calls?

2001-07-18 Thread Oleg V Alexeev

Hello Ryan,

Wednesday, July 18, 2001, 5:55:46 PM, you wrote:

RC> I'm wondering what people are considering best practices for JDBC calls?

RC> I have been writing beans that wrap a database table, and include functions 
"select", "insert", "delete". These functions either load the bean, insert the bean 
values in the database, or delete
RC> the record from the database. In all of these functions, I pass in a database 
connection from the action. (Or whatever else is calling the bean.)

RC> ie- public boolean select(Connection cn1, String primaryKey)

RC> How are others doing it? I think this is a good approach, but want to see if 
someone has come up with something better.

RC> Thanks,
RC> Ryan

Take a look to the jdbc-example in validator - it contains sample of
jdbc calls similar to Command pattern.

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





URI is null error on ActionForward

2001-07-18 Thread Jon Brisbin

I have a really simple action forward just like many I've used in the past.
I am getting this error on JRun 3.1 EE.  I have included an excerpt from my
struts-config.xml and my action class to see if you y'all see something I
just do not...I just added the redirect="true" and it does the same thing.

Thanks for any help you can give me here! :-)

Jon Brisbin
Lamar, MO
[EMAIL PROTECTED]


java.lang.IllegalArgumentException: URI is null
 at
allaire.jrun.servlet.JRunSE.getRequestDispatcher(../servlet/JRunSE.java:1937
)
 at
org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
va:1750)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
 at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1416)
 at
allaire.jrun.session.JRunSessionService.service(../session/JRunSessionServic
e.java:1082)
 at allaire.jrun.servlet.JRunSE.runServlet(../servlet/JRunSE.java:1270)
 at
allaire.jrun.servlet.JRunRequestDispatcher.forward(../servlet/JRunRequestDis
patcher.java:89)
 at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1552)
 at allaire.jrun.servlet.JRunSE.service(../servlet/JRunSE.java:1542)
 at allaire.jrun.servlet.JvmContext.dispatch(../servlet/JvmContext.java:364)
 at allaire.jrun.http.WebEndpoint.run(../http/WebEndpoint.java:115)
 at allaire.jrun.ThreadPool.run(../ThreadPool.java:272)
 at allaire.jrun.WorkerThread.run(../WorkerThread.java:75)


My struts config excerpt follows:

  
  



 


  


My action class forwards like such:

// Set our utility objects
HttpSession session = request.getSession(true);
MessageResources messages = getResources();
CategoryForm form = (CategoryForm)actionForm;

request.setAttribute("formxml", form.getXml());

getServlet().getServletContext().log("Forwarding to success.");
return (new ActionForward("success"));





Re: getSession in xxxForm

2001-07-18 Thread Rajan Gupta

You have access to ActionServlet as a protected attribute in ActionForm.
do a getServletContext() on the instance & you are on your way 
--- Stefan Faist <[EMAIL PROTECTED]> wrote:
> Hello All,
> I have set an attribute into a session: "session.setAttribute("id",
> xxxForm.getId());"
> Now I want to get this attribute in a xxxForm:
> "session.getAttribute("id");". But I have no HttpRequest object.
> 
> How can I get the session in the xxxForm?
> Can someone help me?
> 
> Stefan
> --
> hmi-Informatik GmbH
> Zettachring 6 - D-70567 Stuttgart
> E-Mail: [EMAIL PROTECTED]
> http://www.hmi-informatik.de
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



Re: Subclass ActionServlet to behave as central controller

2001-07-18 Thread Oleg V Alexeev

Hello Peter,

Wednesday, July 18, 2001, 5:53:01 PM, you wrote:

PS> Hi ppl,

PS> Would it be possible to subclass the ActionServlet to add behaviour
PS> needed for it to behave as central controller so it could handle all the
PS> requests coming to the web application, not only the action execution
PS> requests ? In the subclassed ActionServlet I want to be able to add some
PS> logic which will determine where the request should be forwarded in case
PS> where isn't any action to be processed by ActionServlet. For example a
PS> request for /example/some_page.do could be forwarded to /some_page.jsp
PS> OR /WEB-INF/jsp/some_page.jsp. I don't want to add mappings in
PS> struts-config.xml for each page I have in the application.

Yes, of course. You can extend ActionServlet and append your own logic
to support additional behaviors.

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: Ant Q regarding deployment of jar's

2001-07-18 Thread Chuck Amadi

Hi, all from a created build file project i have the following error:-
C:\development\test\build.xml:6: Document root element is missing.
Any Takers Cheers Chuck

Calvin Yu wrote:

> I wouldn't do this.  What kind of jars are you dealing with?  If the
> jars are used by Ant to run tasks, then put them in ANT_HOME/lib.  If
> they belong to your project and only required to build your project, I
> would recommend putting them in a 'lib' directory under your project
> directory.  You could put them in C:\jars, but that might cause some
> confusion later on if you're building different projects with
> conflicting libraries in C:\jars.
>
> Calvin
>
> On 18 Jul 2001 13:52:26 +0100, Chuck Amadi wrote:
> > Hi, I am currently working thru ant's and from a few articles and
> example they
> > lay claim to create & deploying all jar's to C:\jar .
> >
> > Thus within the - the property name- value would
> be
> > "C:\jars"/>
> > Is this the correct procedure as i will be downloading the auxillary
> jars and i
> > want to no do i deploy to by ant/lib dir with the ant.jar , parser.jar
> &
> > jaxp.jar. Or as long as i add them to my classpath ie
> >
> >
> > set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2
> > set ANT_HOME=C:\ant
> > set classpath=%ANT_HOME%\lib\ant.jar
> > set ANT_HOME=C:\jars --// will this locate all my
> jars
> > set PATH=%PATH%;%ANT_HOME%\bin
> > set JAVA_HOME=C:\JDK1.3
> >  Pls advise Cheers Chuck
> >
> > "Hampton, Paul" wrote:
> >
> > > Chuck,
> > > The error that you mentioned was on line 35 of your build
> file, for
> > > some reason though word is corrupting the xml & all I get on line 35
> is
> > > Error! Hyperlink reference not valid.  which I
> assume
> > > has been added by word as it attempts to interpret the xml as html.
> Could
> > > you open your build.xml up in notepad & copy+paste the entire thing
> into an
> > > email to me? - hopefully I'll be able to spot your problem...
> > >
> > > Paul
> > >
> > > > -Original Message-
> > > > From: Chuck Amadi [SMTP:[EMAIL PROTECTED]]
> > > > Sent: Monday, July 16, 2001 10:39 AM
> > > > To:   Hampton, Paul
> > > > Subject:  Ant Problem - Copy of Build.xml File
> > > >
> > > >
> > > > Cheers 4 taking a peek.
> > > > --
> > > > The views expressed by the sender of this message don't
> > > > necessarily represent those of Brecon Beacons National Park
> > > > Authority. This message is intended for the addressee(s) only
> > > > and is sent in confidence; if you receive it in error, please can
> you
> > > > let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> > > > Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> > > > adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> > > > Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> > > > yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> > > > mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> > > > ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
> > > >  << File: buildxml.doc >>
> > >
> > > This private and confidential e-mail has been sent to you by Egg.
> > > The Egg group of companies comprises Prudential Banking plc
> > > (registered no. 2999842), Egg Financial Products Ltd (registered
> > > no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
> > > carries out investment business on behalf of Egg and is regulated
> > > by the Personal Investment Authority.  All members of the Egg group
> > > are registered in England and Wales. Registered offices: 142
> > > Holborn Bars, London EC1N 2NH
> > >
> > > If you are not the intended recipient of this e-mail and have
> > > received it in error, please notify the sender by replying with
> > > 'received in error' as the subject and then delete it from your
> > > mailbox.
> >
> > --
> > The views expressed by the sender of this message don't
> > necessarily represent those of Brecon Beacons National Park
> > Authority. This message is intended for the addressee(s) only
> > and is sent in confidence; if you receive it in error, please can you
> > let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> > Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> > adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> > Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> > yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> > mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> > ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
> >

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at [EMAIL PROTECTED]) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar g

Re: Bug?

2001-07-18 Thread suhas

suppose u have something like this in Jsp


In this case u need not to mention the name and type attribute for the
 tag
But  there should be some action mapping in the struts-config.xml file which
points to form to be used .
I mean






So when the  gets parsed it will
definitely try to look for form ("myForm") based on the struts.xml file .

Regards
Suhas





- Original Message -
From: Michael Q. Ma <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:19 AM
Subject: Re:  Bug?


> Have you associate a particular FormBean with the new action defined in
> your  tag, I mean check your struts-config.xml file.
>
> - Original Message -
> From: "Steven Leija" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 9:07 AM
> Subject:  Bug?
>
>
> > Hello All,
> >
> > I've developed many forms using only the standard attribute of
> "action" in
> > my  tag.  Today I started on a new form, and after six
> hours of
> > banging my head, I found out that I had to add the "type" and "name"
> > attribute to my  tag.  Is this a bug?  My other forms work
> just
> > fine without these, but when dealing with this form, it required me to
> put
> > these attributes into the tag.  With my other forms, I was using beans
> from
> > the following package:
> >
> >
> > com.steven.MyForm
> >
> >
> > and with the new form I was using a Form from the following package:
> >
> >
> > com.vfs.action.BeneficiaryForm
> >
> >
> > Is this because of the package difference?  Please let me know and
> save my
> > sanity!
> >
> > Have a good one,
> >
> > Steven
> >
> >
> >




Where do YOU put JDBC calls?

2001-07-18 Thread Ryan Cornia



I'm wondering what people are considering best practices for 
JDBC calls?
 
I have been writing beans that wrap a database table, and 
include functions "select", "insert", "delete". These functions either load the 
bean, insert the bean values in the database, or delete the record from the 
database. In all of these functions, I pass in a database connection from the 
action. (Or whatever else is calling the bean.)
 
ie- public boolean select(Connection cn1, String 
primaryKey)
 
How are others doing it? I think this is a good approach, but 
want to see if someone has come up with something better.
 
Thanks,
Ryan
 


Re: Ant Q regarding deployment of jar's

2001-07-18 Thread Chuck Amadi


They belong to my project so i will create a lib dir under my project
dir .
Cheers again
Calvin Yu wrote:
I wouldn't do this.  What kind of jars are you
dealing with?  If the
jars are used by Ant to run tasks, then put them in ANT_HOME/lib. 
If
they belong to your project and only required to build your project,
I
would recommend putting them in a 'lib' directory under your project
directory.  You could put them in C:\jars, but that might cause
some
confusion later on if you're building different projects with
conflicting libraries in C:\jars.
Calvin
On 18 Jul 2001 13:52:26 +0100, Chuck Amadi wrote:
> Hi, I am currently working thru ant's and from a few articles and
example they
> lay claim to create & deploying all jar's to C:\jar .
>
> Thus within the - the property name- value
would
be
> "C:\jars"/>
> Is this the correct procedure as i will be downloading the auxillary
jars and i
> want to no do i deploy to by ant/lib dir with the ant.jar , parser.jar
&
> jaxp.jar. Or as long as i add them to my classpath ie
>
>
> set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2
> set ANT_HOME=C:\ant
> set classpath=%ANT_HOME%\lib\ant.jar
> set ANT_HOME=C:\jars --// will this locate all
my
jars
> set PATH=%PATH%;%ANT_HOME%\bin
> set JAVA_HOME=C:\JDK1.3
>  Pls advise Cheers Chuck
>
> "Hampton, Paul" wrote:
>
> > Chuck,
> > The error that
you mentioned was on line 35 of your build
file, for
> > some reason though word is corrupting the xml & all I get on
line 35
is
> > Error! Hyperlink reference not valid.  which
I
assume
> > has been added by word as it attempts to interpret the xml as html.
Could
> > you open your build.xml up in notepad & copy+paste the entire
thing
into an
> > email to me? - hopefully I'll be able to spot your problem...
> >
> > Paul
> >
> > > -Original Message-
> > > From: Chuck Amadi [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, July 16, 2001 10:39 AM
> > > To:   Hampton, Paul
> > > Subject:  Ant Problem - Copy of
Build.xml File
> > >
> > >
> > > Cheers 4 taking a peek.
> > > --
> > > The views expressed by the sender of this message don't
> > > necessarily represent those of Brecon Beacons National Park
> > > Authority. This message is intended for the addressee(s) only
> > > and is sent in confidence; if you receive it in error, please
can
you
> > > let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> > > Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid
yn
> > > adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> > > Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> > > yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> > > mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> > > ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
> > >  << File: buildxml.doc >>
> >
> > This private and confidential e-mail has been sent to you by Egg.
> > The Egg group of companies comprises Prudential Banking plc
> > (registered no. 2999842), Egg Financial Products Ltd (registered
> > no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
> > carries out investment business on behalf of Egg and is regulated
> > by the Personal Investment Authority.  All members of the
Egg group
> > are registered in England and Wales. Registered offices: 142
> > Holborn Bars, London EC1N 2NH
> >
> > If you are not the intended recipient of this e-mail and have
> > received it in error, please notify the sender by replying with
> > 'received in error' as the subject and then delete it from your
> > mailbox.
>
> --
> The views expressed by the sender of this message don't
> necessarily represent those of Brecon Beacons National Park
> Authority. This message is intended for the addressee(s) only
> and is sent in confidence; if you receive it in error, please can
you
> let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
>

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at [EMAIL PROTECTED]) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
 


Subclass ActionServlet to behave as central controller

2001-07-18 Thread Peter Severin

Hi ppl,

Would it be possible to subclass the ActionServlet to add behaviour
needed for it to behave as central controller so it could handle all the
requests coming to the web application, not only the action execution
requests ? In the subclassed ActionServlet I want to be able to add some
logic which will determine where the request should be forwarded in case
where isn't any action to be processed by ActionServlet. For example a
request for /example/some_page.do could be forwarded to /some_page.jsp
OR /WEB-INF/jsp/some_page.jsp. I don't want to add mappings in
struts-config.xml for each page I have in the application.

Peter.





Re: getting an action mapping into a servlet

2001-07-18 Thread Peter Alfors

check out:

org.apache.struts.taglib.html.FormTag.getActionMappingURL()

HTH,
Pete

Matt Raible wrote:

> Here's the entry for this mapping in the struts-config.xml
>
> path="/signIn"
>
> type="us.co.douglas.application.timetracker.presentationlogic.SignInAction"
>name="signInForm"
>scope="request"
>validate="true"
>input="/signIn">
> name="success"
>   path="/mainMenu" />
>   
>
> I'd like to get this "/NASAppdo" value into my servlet without adding
> anything to jsp's.
>
> Thanks,
>
> Matt
>
> --- Matt Raible <[EMAIL PROTECTED]> wrote:
> > I have the following struts tag in my form:
> >
> > 
> >
> > That changes to the following when the jsp is compiled:
> >
> > 
> >
> > What I'd like to do is get the action string into a session variable, or some
> > variable, so I can grab it and use it in a servlet.  Does anyone know how to
> > do
> > this?
> >
> > Thanks,
> >
> > Matt
> >
> > __
> > Do You Yahoo!?
> > Get personalized email addresses from Yahoo! Mail
> > http://personal.mail.yahoo.com/
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/




Re: Ant Q regarding deployment of jar's

2001-07-18 Thread Calvin Yu


I wouldn't do this.  What kind of jars are you dealing with?  If the
jars are used by Ant to run tasks, then put them in ANT_HOME/lib.  If
they belong to your project and only required to build your project, I
would recommend putting them in a 'lib' directory under your project
directory.  You could put them in C:\jars, but that might cause some
confusion later on if you're building different projects with
conflicting libraries in C:\jars.

Calvin


On 18 Jul 2001 13:52:26 +0100, Chuck Amadi wrote:
> Hi, I am currently working thru ant's and from a few articles and
example they
> lay claim to create & deploying all jar's to C:\jar .
> 
> Thus within the - the property name- value would
be
> "C:\jars"/>
> Is this the correct procedure as i will be downloading the auxillary
jars and i
> want to no do i deploy to by ant/lib dir with the ant.jar , parser.jar
&
> jaxp.jar. Or as long as i add them to my classpath ie
> 
> 
> set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2
> set ANT_HOME=C:\ant
> set classpath=%ANT_HOME%\lib\ant.jar
> set ANT_HOME=C:\jars --// will this locate all my
jars
> set PATH=%PATH%;%ANT_HOME%\bin
> set JAVA_HOME=C:\JDK1.3
>  Pls advise Cheers Chuck
> 
> "Hampton, Paul" wrote:
> 
> > Chuck,
> > The error that you mentioned was on line 35 of your build
file, for
> > some reason though word is corrupting the xml & all I get on line 35
is
> > Error! Hyperlink reference not valid.  which I
assume
> > has been added by word as it attempts to interpret the xml as html.
Could
> > you open your build.xml up in notepad & copy+paste the entire thing
into an
> > email to me? - hopefully I'll be able to spot your problem...
> >
> > Paul
> >
> > > -Original Message-
> > > From: Chuck Amadi [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, July 16, 2001 10:39 AM
> > > To:   Hampton, Paul
> > > Subject:  Ant Problem - Copy of Build.xml File
> > >
> > >
> > > Cheers 4 taking a peek.
> > > --
> > > The views expressed by the sender of this message don't
> > > necessarily represent those of Brecon Beacons National Park
> > > Authority. This message is intended for the addressee(s) only
> > > and is sent in confidence; if you receive it in error, please can
you
> > > let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> > > Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> > > adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> > > Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> > > yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> > > mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> > > ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
> > >  << File: buildxml.doc >>
> >
> > This private and confidential e-mail has been sent to you by Egg.
> > The Egg group of companies comprises Prudential Banking plc
> > (registered no. 2999842), Egg Financial Products Ltd (registered
> > no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
> > carries out investment business on behalf of Egg and is regulated
> > by the Personal Investment Authority.  All members of the Egg group
> > are registered in England and Wales. Registered offices: 142
> > Holborn Bars, London EC1N 2NH
> >
> > If you are not the intended recipient of this e-mail and have
> > received it in error, please notify the sender by replying with
> > 'received in error' as the subject and then delete it from your
> > mailbox.
> 
> --
> The views expressed by the sender of this message don't
> necessarily represent those of Brecon Beacons National Park
> Authority. This message is intended for the addressee(s) only
> and is sent in confidence; if you receive it in error, please can you
> let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
> 





Re: getting an action mapping into a servlet

2001-07-18 Thread Matt Raible

Here's the entry for this mapping in the struts-config.xml


 
  

I'd like to get this "/NASAppdo" value into my servlet without adding
anything to jsp's.

Thanks,

Matt

--- Matt Raible <[EMAIL PROTECTED]> wrote:
> I have the following struts tag in my form:
> 
> 
> 
> That changes to the following when the jsp is compiled:
> 
> 
> 
> What I'd like to do is get the action string into a session variable, or some
> variable, so I can grab it and use it in a servlet.  Does anyone know how to
> do
> this?
> 
> Thanks,
> 
> Matt
> 
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



getting an action mapping into a servlet

2001-07-18 Thread Matt Raible

I have the following struts tag in my form:



That changes to the following when the jsp is compiled:



What I'd like to do is get the action string into a session variable, or some
variable, so I can grab it and use it in a servlet.  Does anyone know how to do
this?

Thanks,

Matt

__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



getSession in xxxForm

2001-07-18 Thread Stefan Faist

Hello All,
I have set an attribute into a session: "session.setAttribute("id",
xxxForm.getId());"
Now I want to get this attribute in a xxxForm:
"session.getAttribute("id");". But I have no HttpRequest object.

How can I get the session in the xxxForm?
Can someone help me?

Stefan
--
hmi-Informatik GmbH
Zettachring 6 - D-70567 Stuttgart
E-Mail: [EMAIL PROTECTED]
http://www.hmi-informatik.de




Re: Ant Q regarding deployment of jar's

2001-07-18 Thread Chuck Amadi


Hi, I am currently working thru ant's and from a few articles and example
they lay claim to create & deploying all jar's to C:\jar .
Thus within the - the property name- value would
be "C:\jars"/>
Is this the correct procedure as i will be downloading the auxillary
jars and i want to no do i deploy to by ant/lib dir with the ant.jar ,
parser.jar & jaxp.jar. Or as long as i add them to my classpath ie
 
set TOMCAT_HOME=C:\jakarta-tomcat-3.2.2
set ANT_HOME=C:\ant
set classpath=%ANT_HOME%\lib\ant.jar
set ANT_HOME=C:\jars --// will this locate
all my jars
set PATH=%PATH%;%ANT_HOME%\bin
set JAVA_HOME=C:\JDK1.3
 Pls advise Cheers Chuck
"Hampton, Paul" wrote:
Chuck,
    The error that you mentioned
was on line 35 of your build file, for
some reason though word is corrupting the xml & all I get on line
35 is
Error! Hyperlink reference not valid.  which
I assume
has been added by word as it attempts to interpret the xml as html.
Could
you open your build.xml up in notepad & copy+paste the entire thing
into an
email to me? - hopefully I'll be able to spot your problem...
Paul
> -Original Message-
> From: Chuck Amadi [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, July 16, 2001 10:39 AM
> To:   Hampton, Paul
> Subject:  Ant Problem - Copy of Build.xml
File
>
>
> Cheers 4 taking a peek.
> --
> The views expressed by the sender of this message don't
> necessarily represent those of Brecon Beacons National Park
> Authority. This message is intended for the addressee(s) only
> and is sent in confidence; if you receive it in error, please can
you
> let us know (at [EMAIL PROTECTED]) and then destroy all copies.
> Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
> adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
> Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
> yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
> mewn camgymeriad, a fyddech gystal â rhoi gwybod i
> ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
>  << File: buildxml.doc >>
This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies comprises Prudential Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Personal Investment Authority.  All members of the Egg
group
are registered in England and Wales. Registered offices: 142
Holborn Bars, London EC1N 2NH
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at [EMAIL PROTECTED]) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn [EMAIL PROTECTED]) ac yna dilëwch bob copi.
 


RE: Using Frames within STRUTS

2001-07-18 Thread devon . bowen

> I would like to make use of frames within my STRUTS application but am
> unsure how the framework handles frames.  For example, if I 
> have a form
> within a JSP page (form.jsp) and that page is presented to 
> the user within a
> frame (frame.jsp), how should I associate the ActionForm to 
> the form.jsp
> within the struts-config.xml file.  I want the app to navigate to the
> frame.jsp page but cannot associate the ActionBean to this 
> jsp as it does
> not have a form tag.  Is there a recommended solution ?

Not sure I fully understand but here goes...

When form.jsp starts generating the HTML for the form, it will look for
an ActionForm from which it can get default values. The name it will
use to look for this bean is defined in the struts-config.xml under the
Action to which you will be submitting the form. So the ActionForm name
is associated with the Action that receives it rather than the JSP that
generates it. So the fact that the JSP that generates it is wrapped
inside a frame isn't really an issue.

There are at least two other possible problems, though:

1) If you want the previous Action to preload the ActionForm with
   some information (from a database, for example) you can do
   this by making your own ActionForm bean, filling it in, and
   then saving it in the session scope under the name which is
   declared in the Action that will receive it. It will then be
   found automatically when form.jsp generates the HTML.

2) If you choose to automatically validate the ActionForm, you
   need to specify the "input" page so that Struts can
   automatically send you back there in case of an error. I don't
   have experience with this but you should be able to specify
   your frame.jsp file as the input source. When it then
   renders form.jsp within, this inner page will still find the
   ActionForm in the context if it were the highest level page.

Does that help?

Devon




Re: Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Hartmut Bernecker

OK, thank you, I got it!

I don't understand it, but the problems seems to be the place oft the
 tag within the JSP. I placed it at the end of the 
element with bad result. When I moved it top to the  element it is
ok. May be there is a problem with the html in the jsp-document ...

Do I am allowed to ask another question:
If I want the error-keys not to have in the main ressource-file
(web.xml:)
( ...
  
 application
 asim
  

... )
but in another separate file using 
,where do I have then to deploy the asim-form-validation.properties
File???

TIA

Guus Holshuijsen schrieb:
> 
> Hartmut,
> 
> I do it at the end of an action's perform() method using the "construction"
> given in my previous reply!
> 
> What I describe is only valid if your controller checks for errors itself.
> In case you let Struts handle the validation automatically, I advice you to
> look at the Struts source code.
> The following code snippet is from the Action.java class:
> 
> /**
>  * The request attributes key under which your action should store an
>  * org.apache.struts.action.ActionErrors object, if you
>  * are using the corresponding custom tag library elements.
>  */
> public static final String ERROR_KEY = "org.apache.struts.action.ERROR";
> 
> Concluding: the errors are stored in the request (session?) attribute
> "org.apache.struts.action.ERROR".
> 
> Regards,
> Guus
> 
> - Original Message -
> From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 12:48
> Subject: Re: Displaying errors when validating forms (ActionErrors)
> 
> > No, I think I did not!
> > My validate Method looks like that, it returns Errors back to the
> > controller servlet.
> > - Where is the place to save the errors in the request???
> >
> >
> >public ActionErrors validate(ActionMapping pMapping,
> > HttpServletRequest pRequest)
> >{
> >   System.out.println("VALIDIERE");
> >   ActionErrors errors = new ActionErrors();
> >   if (iBenutzer == null || iBenutzer.length() < 1)
> >   {
> >  errors.add("benutzungsname",
> >  new ActionError("error.login.benutzername.required"));
> >   }
> >   if (iPasswort == null || iPasswort.length() < 1)
> >   {
> >  errors.add("passwort",
> >  new ActionError("error.login.passwort.required"));
> >   }
> >   if (iSprache == null || iSprache.length() < 2 ||
> > iSprache.equals("blank"))
> >   {
> >  errors.add("sprache",
> >  new ActionError("error.login.passwort.required"));
> >   }
> >
> >   return errors;
> >}
> >
> >
> >
> > Guus Holshuijsen schrieb:
> > >
> > > Do you save your errors?
> > >
> > > // Report any errors we have discovered
> > > if ( !errors.empty() )
> > > {
> > >   saveErrors( request, errors );
> > > }
> > >
> > > Regards,
> > > Guus
> > >
> > > - Original Message -
> > > From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, July 18, 2001 11:55
> > > Subject: Displaying errors when validating forms (ActionErrors)
> > >
> > > > Hallo,
> > > >
> > > > I have a problem to display ActionErrors. I use the validate-Method to
> > > > validate forms, like that:
> > > >
> > > > --
> > > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > > > request) {
> > > > ActionErrors errors = new ActionErrors();
> > > > if (iBenutzer == null || iBenutzer.length() < 1) {
> > > > errors.add("benutzungsname", new
> > > > ActionError("error.login.benutzername.required"));
> > > > }}
> > > > --
> > > >
> > > > But when I want to display that error, I can't see anything. Why?
> > > >
> > > > * errors.header=
> > > >   errors.footer=
> > > >   error.login.benutzername.required=that is an error ...
> > > >
> > > >   is in the property-file! That property-file is available (set in
> > > > web.xml)!
> > > >
> > > > * the JSP contains:
> > > >   
> > > >   
> > > >
> > > > Who can help me?!
> > > > What is wrong??
> >

-- 
_

Hartmut Bernecker
Dipl.-Wirtschaftsinformatiker (BA)
Electronic Publishing
ASIM(r) - CONTENT MANAGEMENT AT ITS BEST

Druckhaus Waiblingen
Siemenstrasse 10
D-71332 Waiblingen, Germany

Tel.:   +49 (0)71 51 / 5 66 - 4 48
Fax:+49 (0)71 51 / 5 66 - 3 23
Mail:   mailto:[EMAIL PROTECTED]
Web:http://www.dhw.de/
_



Re: Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Guus Holshuijsen

Hartmut,

I do it at the end of an action's perform() method using the "construction"
given in my previous reply!

What I describe is only valid if your controller checks for errors itself.
In case you let Struts handle the validation automatically, I advice you to
look at the Struts source code.
The following code snippet is from the Action.java class:

/**
 * The request attributes key under which your action should store an
 * org.apache.struts.action.ActionErrors object, if you
 * are using the corresponding custom tag library elements.
 */
public static final String ERROR_KEY = "org.apache.struts.action.ERROR";

Concluding: the errors are stored in the request (session?) attribute
"org.apache.struts.action.ERROR".

Regards,
Guus

- Original Message -
From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 12:48
Subject: Re: Displaying errors when validating forms (ActionErrors)


> No, I think I did not!
> My validate Method looks like that, it returns Errors back to the
> controller servlet.
> - Where is the place to save the errors in the request???
>
>
>public ActionErrors validate(ActionMapping pMapping,
> HttpServletRequest pRequest)
>{
>   System.out.println("VALIDIERE");
>   ActionErrors errors = new ActionErrors();
>   if (iBenutzer == null || iBenutzer.length() < 1)
>   {
>  errors.add("benutzungsname",
>  new ActionError("error.login.benutzername.required"));
>   }
>   if (iPasswort == null || iPasswort.length() < 1)
>   {
>  errors.add("passwort",
>  new ActionError("error.login.passwort.required"));
>   }
>   if (iSprache == null || iSprache.length() < 2 ||
> iSprache.equals("blank"))
>   {
>  errors.add("sprache",
>  new ActionError("error.login.passwort.required"));
>   }
>
>   return errors;
>}
>
>
>
> Guus Holshuijsen schrieb:
> >
> > Do you save your errors?
> >
> > // Report any errors we have discovered
> > if ( !errors.empty() )
> > {
> >   saveErrors( request, errors );
> > }
> >
> > Regards,
> > Guus
> >
> > - Original Message -
> > From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, July 18, 2001 11:55
> > Subject: Displaying errors when validating forms (ActionErrors)
> >
> > > Hallo,
> > >
> > > I have a problem to display ActionErrors. I use the validate-Method to
> > > validate forms, like that:
> > >
> > > --
> > > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > > request) {
> > > ActionErrors errors = new ActionErrors();
> > > if (iBenutzer == null || iBenutzer.length() < 1) {
> > > errors.add("benutzungsname", new
> > > ActionError("error.login.benutzername.required"));
> > > }}
> > > --
> > >
> > > But when I want to display that error, I can't see anything. Why?
> > >
> > > * errors.header=
> > >   errors.footer=
> > >   error.login.benutzername.required=that is an error ...
> > >
> > >   is in the property-file! That property-file is available (set in
> > > web.xml)!
> > >
> > > * the JSP contains:
> > >   
> > >   
> > >
> > > Who can help me?!
> > > What is wrong??
>




html:img questions

2001-07-18 Thread Jake Thompson

Hi all,
I'm new to the list, so sorry if this has come up before.

When I use the  or , it
will encode the session id into this a cause the images not to load.  Is
there a fix or am I doing somthing wrong?

Thanks in advance,
Jake T.



Using Frames within STRUTS

2001-07-18 Thread Alexander, Glynn (LIT)

Hi,
I would like to make use of frames within my STRUTS application but am
unsure how the framework handles frames.  For example, if I have a form
within a JSP page (form.jsp) and that page is presented to the user within a
frame (frame.jsp), how should I associate the ActionForm to the form.jsp
within the struts-config.xml file.  I want the app to navigate to the
frame.jsp page but cannot associate the ActionBean to this jsp as it does
not have a form tag.  Is there a recommended solution ?

Thanks in advance for any help 

Glynn Alexander 
Senior Software Developer 
Liberty Information Technology  Direct Line: ++44 (0) 28 9044 5621
Clarendon House   Fax:   ++44 (0) 28 9044 5511
9-21 Adelaide StreetSwitchboard:   ++44 (0) 28 9044 5500
Belfast, Northern Ireland BT2 8DJ  Email:
[EMAIL PROTECTED]

Disclaimer: The contents of this e-mail and attached files in no way reflect
any policies of Liberty Information Technology Ltd.






Hello & Best Practises Question

2001-07-18 Thread Emaho, Ghoot

Hi,
 
I have a question regarding what the community would consider to be Best
Practises when using Struts. I am doing an internal review of our own
usage of Struts within our products, and I have constructed an example
application to highlight my question(s) and talk around. I would
appreciate any feedback, insight or help that the community can offer.
 
I appreciate that this question requires a bit of effort on the readers
part ! Hopefully I have explained the context in enough detail to
solicit decent responses, but not so detailed as to tire you out !
 
Most Web Applications perform similar tasks which could be considered
generic regardless of domain. I have taken some of these tasks and
bundled them into this simple example. The example is a simplification
of an application I am building at the moment - a Struts based Wiki
called 'ChiKi'. For those who are not aware of what a wiki is, refer to
http://www.c2.com/cgi/wiki?WikiWikiWeb
  for details.
 
Given an object that is to manipulated, core tasks that could be
performed on that object would include

*   View
*   Edit
*   Save
*   Create [not considered in example]
*   Delete [not considered in example]

In this example, we have the object is called 'Page' which has 'id' and
'content' as string attributes. I wish to be able to View, Edit, Save,
Create and Delete 'Pages'.
 
So here are some of my questions  - all implementation details can be
found at the end of the email:

*   given the details of the components and the xml configuration at
the end of this email, how does this implementation compare to how you
would do it ? i.e. what other ways would people 'configure' to achieve
the same end result ?
*   are there any given Best Practises that could apply ?
*   other areas to consider could include:

*   separation: save and edit could be encapsualted in the same
action, would you ?
*   Page & EditForm: essentially the same, how would people avoid
duplication ? or would they bother ?
*   usage of request scope
*   ...

I appreciate that this is a simple example, but I would like to get a
feel for how people would do this, and ascertain if there are differing
strategies - and the various pros/cons of each strategy.
 
It is my intention to offer up the full blown ChiKi as an example app
for Struts development once it is ready, and I would like to be able to
take feedback from this post into account. This will hopefully be useful
for developers using Struts - it's always helpful to have other ex
amples ! and it will certainly be used internally for my developers
training/introduction to Struts - as well as actually being used within
our development team as a tool - wiki's are great :)
 
[We are about to release v1.0 of our current Struts based application -
a large enterprise application globally deployed for a large
multinational. I will post more details about this as I'm sure there is
interest in Real World developments. Of particular interest may be the
results from our Performance testing, the overall Architecture and so
on. This may be one of the largest and certainly most complex Struts
based applications to go into production, and I would like to share the
experience with the community. More details to follow shortly]
 
So thank you for making it this far, and if you have any feedback at
all, please let me know. 
 
Many thanks
 
Ghoot Emaho
Development Team Leader
Petrotechnics Ltd  

 

In the implementation, I have the following components:

*   Page.java

*   simple bean with accessor methods for 'id' and 'content'
attributes

*   ChikiService.java

*   provides methods getPage(String pageId) and setPage(Page p) to
be used by the Actions

*   View.java

*   extends Action
*   accepts 1 request parameter 'pageId' which uniqely identifies
the page
*   requests Page 'pageId' from ChikiService
*   puts the returned Page object into the request
*   returns a forward to View.jsp


*   View.jsp

*   displays the Page object in the request, using:

*   
*   

*   provides a hyperlink to 'Edit' this page:

*   Edit


*   EditForm.java

*   simple bean with accessor methods for 'id' and 'content'
attributes
*   identical to the 'Page' object, except it extends ActionForm

*   Edit.java

*   extends Action

*   accepts 1 request parameter 'pageId' which uniqely identifies
the page
*   requests Page 'pageId' from ChikiService
*   populates EditForm with values from the returned Page Object
*   returns a forward to Edit.jsp


*   Edit.jsp

*   displays the page to be edited. 'id' attribute is a text label
and the 'content' is in a text area which the user can edit and then
submit to be saved

*   






*   Submits the EditForm to the 'Save' action for processing

*   Save.java

*

Re: Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Hartmut Bernecker

No, I think I did not!
My validate Method looks like that, it returns Errors back to the
controller servlet.
- Where is the place to save the errors in the request???


   public ActionErrors validate(ActionMapping pMapping,
HttpServletRequest pRequest)
   {
  System.out.println("VALIDIERE");
  ActionErrors errors = new ActionErrors();
  if (iBenutzer == null || iBenutzer.length() < 1)
  {
 errors.add("benutzungsname",
 new ActionError("error.login.benutzername.required"));
  }
  if (iPasswort == null || iPasswort.length() < 1)
  {
 errors.add("passwort",
 new ActionError("error.login.passwort.required"));
  }
  if (iSprache == null || iSprache.length() < 2 ||
iSprache.equals("blank"))
  {
 errors.add("sprache",
 new ActionError("error.login.passwort.required"));
  }

  return errors;
   }



Guus Holshuijsen schrieb:
> 
> Do you save your errors?
> 
> // Report any errors we have discovered
> if ( !errors.empty() )
> {
>   saveErrors( request, errors );
> }
> 
> Regards,
> Guus
> 
> - Original Message -
> From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, July 18, 2001 11:55
> Subject: Displaying errors when validating forms (ActionErrors)
> 
> > Hallo,
> >
> > I have a problem to display ActionErrors. I use the validate-Method to
> > validate forms, like that:
> >
> > --
> > public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> > request) {
> > ActionErrors errors = new ActionErrors();
> > if (iBenutzer == null || iBenutzer.length() < 1) {
> > errors.add("benutzungsname", new
> > ActionError("error.login.benutzername.required"));
> > }}
> > --
> >
> > But when I want to display that error, I can't see anything. Why?
> >
> > * errors.header=
> >   errors.footer=
> >   error.login.benutzername.required=that is an error ...
> >
> >   is in the property-file! That property-file is available (set in
> > web.xml)!
> >
> > * the JSP contains:
> >   
> >   
> >
> > Who can help me?!
> > What is wrong??



html:text filter=false

2001-07-18 Thread "Schröder, Veit"


Is there any way the to prevent the html:text Tag from filtering 
the value? Like the bean:write filter=false?

Thanx Veit
 



RE: Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Firmin David

It might be worthwhile doublechecking the "input" attribute in your xml
mapping for the request URI you're handling.
If there is no input page specified, the ActionServlet will not know which
page to return control to in order to display the errors it receives from
the validate() method.

HTH
Dave

-Original Message-
From: Hartmut Bernecker [mailto:[EMAIL PROTECTED]]
Sent: 18 July 2001 10:56
To: [EMAIL PROTECTED]
Subject: Displaying errors when validating forms (ActionErrors)


Hallo,

I have a problem to display ActionErrors. I use the validate-Method to
validate forms, like that:

--
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
if (iBenutzer == null || iBenutzer.length() < 1) {
errors.add("benutzungsname", new
ActionError("error.login.benutzername.required"));
}}
--

But when I want to display that error, I can't see anything. Why?

* errors.header=
  errors.footer=
  error.login.benutzername.required=that is an error ...

  is in the property-file! That property-file is available (set in
web.xml)!

* the JSP contains:
  
  

Who can help me?!
What is wrong??


The information in this email is confidential and is intended solely
for the addressee(s).
Access to this email by anyone else is unauthorised. If you are not
an intended recipient, you must not read, use or disseminate the
information contained in the email.
Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Capco.

http://www.capco.com
***




Re: Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Guus Holshuijsen

Do you save your errors?

// Report any errors we have discovered
if ( !errors.empty() )
{
  saveErrors( request, errors );
}

Regards,
Guus

- Original Message - 
From: "Hartmut Bernecker" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 18, 2001 11:55
Subject: Displaying errors when validating forms (ActionErrors)


> Hallo,
> 
> I have a problem to display ActionErrors. I use the validate-Method to
> validate forms, like that:
> 
> --
> public ActionErrors validate(ActionMapping mapping, HttpServletRequest
> request) {
> ActionErrors errors = new ActionErrors();
> if (iBenutzer == null || iBenutzer.length() < 1) {
> errors.add("benutzungsname", new
> ActionError("error.login.benutzername.required"));
> }}
> --
> 
> But when I want to display that error, I can't see anything. Why?
> 
> * errors.header=
>   errors.footer=
>   error.login.benutzername.required=that is an error ...
> 
>   is in the property-file! That property-file is available (set in
> web.xml)!
> 
> * the JSP contains:
>   
>   
> 
> Who can help me?!
> What is wrong??
> 




500 Servlet Exception

2001-07-18 Thread Stanley Tan

Hi, I get a 500 servlet exception when trying to access 
"struts-example".  I am using Resin 2.0.1.  What could be wrong?  On Resin 
1.2.3, it does work but not on 2.0.1.

What should I do?

Thanks!

java.lang.NoSuchMethodError
 at com.caucho.jsp.Taglib.fillTag(Taglib.java:406)
 at com.caucho.jsp.Taglib.fillTagLibraryInfo(Taglib.java:336)
 at com.caucho.jsp.Taglib.(Taglib.java:164)
 at com.caucho.jsp.JspParser.parseTaglibDirective(JspParser.java:975)
 at com.caucho.jsp.JspParser.parseDirective(JspParser.java:685)
 at com.caucho.jsp.JspParser.parseScriptlet(JspParser.java:554)
 at com.caucho.jsp.JspParser.parseNode(JspParser.java:309)
 at com.caucho.jsp.JspParser.parseJsp(JspParser.java:289)
 at com.caucho.jsp.JspParser.parse(JspParser.java:187)
 at com.caucho.jsp.JspParser.parse(JspParser.java:135)
 at com.caucho.jsp.JspManager.createPage(JspManager.java:122)
 at com.caucho.jsp.PageManager.getPage(PageManager.java:332)
 at com.caucho.jsp.PageManager.getPage(PageManager.java:195)
 at com.caucho.jsp.QServlet.getPage(QServlet.java:215)
 at 
com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:126)
 at com.caucho.server.http.Invocation.service(Invocation.java:272)
 at 
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:128)
 at 
com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:209)
 at 
com.caucho.server.http.QRequestDispatcher.forward(QRequestDispatcher.java:96)
 at com.caucho.server.http.FileServlet.service(FileServlet.java:288)
 at 
com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:82)
 at com.caucho.server.http.Invocation.service(Invocation.java:272)
 at 
com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:128)
 at 
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:216)
 at 
com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:158)
 at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
 at java.lang.Thread.run(Thread.java:484)




Displaying errors when validating forms (ActionErrors)

2001-07-18 Thread Hartmut Bernecker

Hallo,

I have a problem to display ActionErrors. I use the validate-Method to
validate forms, like that:

--
public ActionErrors validate(ActionMapping mapping, HttpServletRequest
request) {
ActionErrors errors = new ActionErrors();
if (iBenutzer == null || iBenutzer.length() < 1) {
errors.add("benutzungsname", new
ActionError("error.login.benutzername.required"));
}}
--

But when I want to display that error, I can't see anything. Why?

* errors.header=
  errors.footer=
  error.login.benutzername.required=that is an error ...

  is in the property-file! That property-file is available (set in
web.xml)!

* the JSP contains:
  
  

Who can help me?!
What is wrong??



Book Announcement

2001-07-18 Thread Marc Schmidt



#
 Java Server Pages and J2EE
Web-based Applications for Enterprises
#

Book Announcement, now available:

Java Server Pages and J2EE
Web-based Applications for Enterprises
By Volker Turau, Krister Saleck and Marc Schmidt
Publisher: dpunkt.verlag 2001
514 Pages
ISBN 3-89864-112-0

This book provides a comprehensive in-depth treatement of the new
standard for developing multi-tier applications: the Java 2 Enterprise
Edition J2EE. The focus is on web-centric applications based on JSP
and servlets. The book includes numerous examples that you can use as
the basis for your own applications. The examples are available online
(including the complete source code).

What's inside:
Chapter 1: Java 2 Enterprise Edition
Chapter 2: Java Server Pages
Chapter 3: Architectures and application patterns
Chapter 4: Deployment descriptors for web-applications
Chapter 5: Implementing the MVC pattern with the Struts framework
Chapter 6: Integration of databases with JDBC 2
Chapter 7: Autorization and Authentication mit J2EE
Chapter 8: Tomcat 3.2, Tomcat 4.0, Tomcat and Apache with mod_jk
Chapter 9: Case Study: The Wizard

The book is written in GERMAN. The web-site for the book

http://www.informatik.fh-wiesbaden.de/~turau/jsp/index.html

may be of interest to you, even if you do not speak German. It has

-- a complete outline of the book
-- all examples online
   http://shannon.informatik.fh-wiesbaden.de:8057/buch2/
-- the complete source code of all examples, with installation
   instructions for Tomcat and teh Orion Application Server :
   http://shannon.informatik.fh-wiesbaden.de/jsp/j2ee/download.html
-- A sample of the book as a PDF file
   http://shannon.informatik.fh-wiesbaden.de/jsp/j2ee/download/jsp-j2ee.pdf
-- lots of usefull links to JSP resources
   http://shannon.informatik.fh-wiesbaden.de/jsp/jsp/ressourcen.html