Javascript Validation

2001-06-08 Thread Satish Khanzode

Hi
Has anyone used client-side validations (using Javascript) in jsp pages
created Struts ? Pls help.
Thanks,
Satish Khanzode




Struts Beta 03 Build Problem

2001-06-08 Thread David McLure

Any idea why I am consistently getting an 
"org.apache.tools.ant.taskdefs.optional.TraXLiason" ClassNotFoundException when trying 
an "ant dist" build of jakarta-struts-1.0-b3-src using Ant 1.3 on both NT and Linux?  
I have what seem to be the only required jars in my path: xalan.jar and jaxp.jar from 
jaxp-1_1.zip, and jdbc2_0-stdext.jar, with jdk1.3.1?

Thanks

David McLure
 
__
Get your own FREE, personal Netscape Webmail account today at 
http://webmail.netscape.com/


Script started on Thu Jun  7 23:01:33 2001
May need to do the following...
/sbin/route add default gw 192.168.1.1
[root@skye jakarta-struts-1.0-b3-src]# env|grep PATH
CLASSPATH=.:/home/jak/jdbc2_0-stdext.jar:/home/jak/jaxp-1.1/xalan.jar:/home/jak/jaxp-1.1/jaxp.jar
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin:/usr/local/ant/bin
[root@skye jakarta-struts-1.0-b3-src]# ant dist
Buildfile: build.xml

init:
 [echo] - jakarta-struts 1.0-b1 -
 [echo] 
 [echo] java.class.path = 
.:/home/jak/jdbc2_0-stdext.jar:/home/jak/jaxp-1.1/xalan.jar:/home/jak/jaxp-1.1/jaxp.jar::/usr/local/ant/lib/ant.jar:/usr/local/ant/lib/jaxp.jar:/usr/local/ant/lib/parser.jar:/usr/java/jdk1.3.1/lib/tools.jar
 [echo] java.home = /usr/java/jdk1.3.1/jre
 [echo] user.home = /root

prepare.dist:

prepare.library:

compile.library:
[style] Transforming into /home/jak/jakarta-struts-1.0-b3-src/target/library

BUILD FAILED

/home/jak/jakarta-struts-1.0-b3-src/build.xml:188: java.lang.ClassNotFoundException: 
org.apache.tools.ant.taskdefs.optional.TraXLiaison
--- Nested Exception ---
java.lang.ClassNotFoundException: org.apache.tools.ant.taskdefs.optional.TraXLiaison
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at org.apache.tools.ant.taskdefs.XSLTProcess.setProcessor(XSLTProcess.java:229)
at org.apache.tools.ant.taskdefs.XSLTProcess.execute(XSLTProcess.java:137)
at org.apache.tools.ant.Target.execute(Target.java:153)
at org.apache.tools.ant.Project.runTarget(Project.java:898)
at org.apache.tools.ant.Project.executeTarget(Project.java:536)
at org.apache.tools.ant.Project.executeTargets(Project.java:510)
at org.apache.tools.ant.Main.runBuild(Main.java:421)
at org.apache.tools.ant.Main.main(Main.java:149)

Total time: 8 seconds
[root@skye jakarta-struts-1.0-b3-src]# ls
INSTALL  WhoWeAre  build-webapps.xml
build.xml*  doc/ web/
LICENSE  build-tests.xml   build.properties 
conf/   src/
README   build-webapp.xml  build.properties.sample  
dist/   target/
[root@skye jakarta-struts-1.0-b3-src]# c exit
exit

Script done on Thu Jun  7 23:02:19 2001

 build.properties


Re: Struts Beta 03 Build Problem

2001-06-08 Thread Oleg V Alexeev

Hello David,

Friday, June 08, 2001, 9:06:12 AM, you wrote:

DM> Any idea why I am consistently getting an 
"org.apache.tools.ant.taskdefs.optional.TraXLiason" ClassNotFoundException when trying 
an "ant dist" build of jakarta-struts-1.0-b3-src using Ant 1.3 on
DM> both NT and Linux?  I have what seem to be the only required jars in my path: 
xalan.jar and jaxp.jar from jaxp-1_1.zip, and jdbc2_0-stdext.jar, with jdk1.3.1?

Place crimson.jar, jaxp.jar, xalan.jar files from jaxp-1_1.zip to the
jdk extension dir - x:\jdk1.3.1\jre\lib\ext for example.

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





RE: Javascript Validation

2001-06-08 Thread Dudley [EMAIL PROTECTED]

i find using struts to do validation works way better than jscript. To date
i haven't used 1 line of jscript in the project.
this is what we do

have a look, this is one of our actionhandlers

/**
 * Used to update the return of a specific taxpayer
 * @author: Dudley Butt
 *
 */

public class Vat201ReturnActionHandlerUpdate implements IActionHandler{

   Vat201ReturnActionForm actionFormObject = null;
   HttpServletRequest aRequest = null;
   User user = null;
   String errMsg = "";
public ActionHandlerResponse executeAction(ActionMapping mapping,
ActionForm form, HttpServletRequest request){

System.out.println("In " + this.getClass());
actionFormObject = (Vat201ReturnActionForm)form;
aRequest = request;
ActionErrors errors = null;
if (actionFormObject.getRefreshOption()){
return new
ActionHandlerResponse(errors,mapping.findForward("success"));
}
errors = doFieldValidation(); //this is what u want
if (errors != null) {
actionFormObject.setAction("Edit");
return new ActionHandlerResponse(errors, new
ActionForward(mapping.getInput()));
}
else {
errors = doReturnUpdate();
if (errors == null){

return new
ActionHandlerResponse(errors,mapping.findForward("success"));
}
else {
actionFormObject.setAction("Edit");
return new ActionHandlerResponse(errors, new
ActionForward(mapping.getInput()));
}
}
//return new ActionHandlerResponse(errors,
mapping.findForward("mainMenu"));
}

  public ActionErrors doReturnUpdate(){

ActionErrors errors = null;

try {

HttpSession session = null;
if (aRequest.getSession(false) == null){
  System.out.println("Session is null");
  session = (HttpSession)aRequest.getSession(true);
}
else{
  session = (HttpSession)aRequest.getSession(false);
}

user = new User();
user = (User)session.getAttribute(Constants.USER_KEY);
Object obj =
(Object)EJBUtil.getBeanHome(EFilerSessionHome.JNDI_NAME, user.getUsername(),
user.getPassword());
obj = (Object)EJBUtil.getBeanHome(TaxFormSessionHome.JNDI_NAME,
user.getUsername(), user.getPassword());
TaxFormSessionHome taxFormSessionHome =
(TaxFormSessionHome)PortableRemoteObject.narrow(obj,
TaxFormSessionHome.class);
TaxFormSession taxFormSession = taxFormSessionHome.create();

actionFormObject.getFormProperties();

FieldErrorList fldErr = null;
fldErr = actionFormObject.getTaxReturn().validate();
if (fldErr !=null && fldErr.size() > 0) {
return errors = ErrorUtil.toActionErrors(fldErr);
}
actionFormObject.getTaxForm().calculate();
actionFormObject.setFormProperties();
taxFormSession.updateTaxForm(actionFormObject.getTaxForm());



}
catch (Exception ex) {
  ex.printStackTrace();
  errors = new ActionErrors();
  errors.add("taxPayerEdit", new ActionError("error.taxPayerEdit"));
}
return errors;
  }
   public ActionErrors doFieldValidation(){
  ActionErrors errors = null;
  errMsg = "";
  errMsg = StringUtil.checkValue("1- Standard
Rate",actionFormObject.getStandardRate1(),false,15,1,0,0,new
Double("999.0"), new Double("0.0"));
  if (!errMsg.equals("")) {
errors = new ActionErrors();
errors.add("standardRate1", new
ActionError("error.validateVat201", "standardRate1" ,errMsg));
  }

  errMsg = "";
  errMsg = StringUtil.checkValue("1A- Standard
Rate",actionFormObject.getStandardRate1A(),false,15,1,0,0,new
Double("999.0"), new Double("0.0"));
  if (!errMsg.equals("")) {
errors = new ActionErrors();
errors.add("standardRate1A", new
ActionError("error.validateVat201", "standardRate1A" ,errMsg));
  }

  errMsg = "";
  errMsg = StringUtil.checkValue("2- Zero
Rate",actionFormObject.getZeroRate2(),false,15,1,0,0,new
Double("999.0"), new Double("0.0"));
  if (!errMsg.equals("")) {
errors = new ActionErrors();
errors.add("zeroRate2", new ActionError("error.validateVat201",
"zeroRate2" ,errMsg));
  }

  errMsg = "";
  errMsg = StringUtil.checkValue("3- Exempt and not
Supplies",actionFormObject.getExemptAndNonSupplies3(),false,15,1,0,0,new
Double("999.0"), new Double("0.0"));
  if (!errMsg.equals("")) {
errors = new ActionErrors();
errors.add("exemptAndNonSupplies3", new
ActionError("error.validateVat201", "exemptAndNonSupplies3" ,errMsg));
  }

  errMsg = "";
  errMsg = StringUtil.checkValue("5- Accomodation Exceeding 45
days",actionFormObject.getAccomodationExceeding45Days(),false,15,1,0,0,new
Double("999.0"), new Double("0.0"));
  if (!errMsg.equals("")) {
  

JSP expressions inside custom tags

2001-06-08 Thread Erich Meier

Hi!

I am evaluating struts for a new project. One problem I wasn't able to solve
was the integration of JSP expressions inside the attributes of
custom tags.

My code looks like this:


 <% String name = ((PElement)pelement).getName(); %>
 
   ^^^ Here is my problem!

 


The links always contain the <%= name %> string instead of the evaluated
expression. I tried it with different quoting techniques but without luck.

What is the correct solution here?

TIA,
Erich



Re: JSP expressions inside custom tags

2001-06-08 Thread Jim Richards


try

">

You need to have the <%= %> present the whole string, not just the single part.


At 10:56 AM 8/06/01 +0200, you wrote:
>Hi!
>
>I am evaluating struts for a new project. One problem I wasn't able to solve
>was the integration of JSP expressions inside the attributes of
>custom tags.
>
>My code looks like this:
>
>
> <% String name = ((PElement)pelement).getName(); %>
> 
>   ^^^ Here is my problem!
>
> 
>
>
>The links always contain the <%= name %> string instead of the evaluated
>expression. I tried it with different quoting techniques but without luck.
>
>What is the correct solution here?
>
>TIA,
>Erich
> 
--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
http://www.cyber4.org/kumera/index.html



Re: struts-example - handle of ServletException

2001-06-08 Thread Andreas Dejung


Hi Peter


I like to handle the errors as you have described. First a user friendly
page and then for the developers the error details.

But how do I do this


Could you give me an example??

Thanks a lot

Andy







*** PLEASE NOTE ***
This message, along with any attachments, may be confidential or legally
privileged.  It is intended only for the named person(s), who is/are the
only authorized recipients. If this message has reached you in error,
kindly destroy it without review and notify the sender immediately. Thank
you for your help.
**




Re: problem with invoking struts-template!!

2001-06-08 Thread Chuck Amadi


Hi, the container is now throwing up -  http://localhost:8080/struts-template/css/bbnpa.css
even when i type struts-bbnpa as opposed struts-template.!!
Thus my bbnpa.css file appears in the browser as below.You mentioned
moving CSS up to tomcat where i.e to struts-bbnpa (my web application)
/* BBNP Site Style Sheet */
h1, h2, h3, h4, h5, h6  {color:green; font-family: arial, helvetica,
sans-serif}
h1 {font-size: 20pt}
h4 {font-size: 10pt}
h1.cymraeg {position:relative; left:20px; top:0px; z-index:2}
h1.english {position:relative; left:30px; top:-28px; z-index:1; font-weight:200}
div.pageIntro {color:green; font-family:arial, helvetica, sans-serif;
font-size:12pt; margin-left:50px; margin-right:100px; margin-top:10px}
div.index {color:green; font-family:arial, helvetica, sans-serif;
    font-size:12pt; margin-left:30px}
div.textNav { color:teal; font-family: arial, helvetica, sans-serif;
    font-size:10pt; margin-bottom:
10px; text-align: center
Cheers making steady progress.Chuck
Ted Husted wrote:
I don't believe that the JSP templates and CSS files
are strongly
coupled. I believe the browser applies the CSS, not the template. You
might just want to move the CSS up to where Tomcat is looking for it.
Chuck Amadi wrote:
>
> I have created a index.jsp that has the content of our company
> web-site, thus the index.jsp  is located
> C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\index.jsp
>
> Thus i have set up the tag libraries in the web.xml file and
> referenced the taglib at the top of my index.jsp page as
> below.Nevertheless i recieve a Not Found Error.My struts-template
is
> located
>
> C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\struts-template\css\bbnpa.css
>
> <%@ taglib uri="/WEB-INF/struts-template.tld"  prefix="template"
%>
>
>
> Not Found (404)
>
> Original request: /struts-bbnpa/css/bbnpa.css
>
> Not found request: /struts-bbnpa/css/bbnpa.css
>
> Any suggestions please .
>
> --
> 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 dilwch bob copi.
>
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

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

begin:vcard 
n:amadi;chuck
tel;cell:07970 972534
tel;fax:01874 622574
tel;home:[EMAIL PROTECTED]
tel;work:Brecon Beacons National Park
x-mozilla-html:FALSE
url:http://www.breconbeacons.org
org:Brecon Beacons National Park;I.T
version:2.1
email;internet:[EMAIL PROTECTED]
title:I.T Systems Programmer
adr;quoted-printable:;;7 Glamorgan Street=0D=0ABrecon=0D=0APowys;Brecon;Powys;LD3 7DP;Wales (United Kingdom)
fn:chuck amadi
end:vcard



RE: Can anyone help with solving the "BACK" button problem, in th e browser?

2001-06-08 Thread Dudley [EMAIL PROTECTED]
Title: RE: Can anyone help with solving the "BACK" button problem, in th e browser?



well, 
this will blow all your socks off.
I got 
something to work, and remaining in line with my "REDUCE THE JAVASCRIPT" 
policy
here 
is what i did...
 
I just 
plugged some code into my actionhandler to evaluate a state property on my 
actionform. If it was a certain state i either perform usual processing or just 
by pass the processing and show the JSP which gets rebuilt 
anyways...
 
great!!
 
    public ActionHandlerResponse 
executeAction(ActionMapping mapping, ActionForm form, HttpServletRequest 
request){
 
    System.out.println("In " + 
this.getClass());    actionFormObject 
= (Vat201ReturnActionForm)form;    
aRequest = request;    ActionErrors 
errors = null;    if 
(actionFormObject.getRefreshOption()){   // IF THIS IS TRUE DONT ALLOW 
ANY PROCESSING JUST REBUILD JSP
// 
THIS boolean GETS SET AFTER FIRST TIME PROCESSING 
    
return new 
ActionHandlerResponse(errors,mapping.findForward("success"));    
}    errors = 
doFieldValidation();    if (errors != 
null) {    
actionFormObject.setAction("Edit");    
return new ActionHandlerResponse(errors, new 
ActionForward(mapping.getInput()));    
}    else 
{    errors = 
doReturnUpdate();    
if (errors == null){
 
    
return new 
ActionHandlerResponse(errors,mapping.findForward("success"));    
}    else 
{    
actionFormObject.setAction("Edit");    
return new ActionHandlerResponse(errors, new 
ActionForward(mapping.getInput()));    
}    
}    //return new 
ActionHandlerResponse(errors, 
mapping.findForward("mainMenu"));    
}
 
 

  -Original Message-From: Spencer Smith 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, June 07, 2001 7:44 
  PMTo: [EMAIL PROTECTED]Subject: Re: Can 
  anyone help with solving the "BACK" button problem, in th e 
  browser?
  That won't work.  I solved the problem using 
  javascript.  Javascript doesn't cache like JSP pages does, so you can get 
  around this problem using javascript.
   
  If you want, I can send you the code I 
  use.
  
- Original Message - 
From: 
Thane Eisener 
To: '[EMAIL PROTECTED]' 

Sent: Thursday, June 07, 2001 10:12 
AM
Subject: RE: Can anyone help with 
solving the "BACK" button problem, in th e browser?

Oops, I guess I should test before I post. It looks like 
newer browsers don't support this as a META tag only as a header.
I added the following to one of my action classes and the 
perform() method was called when I pressed 'Back': 
response.addHeader("Pragma","no-cache"); response.addHeader("Cache-control","no-cache"); 
Hope it helps, Thane 
-Original Message- From: 
Peter Alfors [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 07, 2001 11:35 AM To: [EMAIL PROTECTED] Subject: 
Re: Can anyone help with solving the "BACK" button problem, in 
th e browser? 
Thane , 
I am using:     
 in 
my header, and my action is not re-executed when I use the browser 
back button. Is there another 
option I should be using? 
thanks,     
Pete 
Thane Eisener wrote: 
> > > I seem to recall a META tag called something like 
pragma-no-cache that > you can embed in your page 
which will force the page to reload (not > just 
display a snapshot). This should enable handling the situation in 
> scriptlets or your action class. > > -Original Message- 
> From: Peter Alfors [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, June 07, 2001 9:52 AM > To: [EMAIL PROTECTED] > 
Subject: Re: Can anyone help with solving the "BACK" button problem, 
> in > the browser? 
> > Depending on which 
browser you use, and the data on the page, the back > button > may cause (or ask) the page 
to reload. > However, some browsers (like IE) 
only display a snapshot of what the > last 
page > rendered to. > 
Therefore, you cannot use scriptlets or the action class.  
However, > you are able > to kick-off javascript. > If you can 
gaurantee that your users will have javascript enabled, you > can write > a simple test to see if 
this page was already displayed to the user. > 
You could > check a flag (hidden field) when the 
page loads.  If the flag is true, > then 
use > the javascript to reload to your desired 
page. > > HTH, 
> Pete > > "Dudley Butt@i-Commerce" 
wrote: > > > Please 
help, > > > > 
When the user pushes the back button, I want the page to redirect or 
> refresh > > to a 
different page, please, any ideas? > > 
> > Thanx guys and gals > 
> Dudley 


RE: Javascript Validation

2001-06-08 Thread Eelco van Kuik

I don't understand why Dudley thought it was necessary to send java code,
but I think what you need you can find at:

http://javascript.internet.com/forms/

I don't have internet from this place, but know there are many javascript
examples there.

Regards,

Eelco



-Original Message-
From: Satish Khanzode [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 7:42 AM
To: [EMAIL PROTECTED]
Subject: Javascript Validation


Hi
Has anyone used client-side validations (using Javascript) in jsp pages
created Struts ? Pls help.
Thanks,
Satish Khanzode



RE: Can anyone help with solving the "BACK" button problem, in th e browser?

2001-06-08 Thread Dudley [EMAIL PROTECTED]
Title: RE: Can anyone help with solving the "BACK" button problem, in th e browser?



the 
solution i posted means that the user can push the BACK button, but we have full 
control via the actionhandler, as to how much processing we will allow the user 
to perform, simply just by evaluating some previously set 
form properties
[Dudley Butt@i-Commerce] 
 -Original 
Message-From: Spencer Smith 
[mailto:[EMAIL PROTECTED]]Sent: Thursday, June 07, 2001 7:44 
PMTo: [EMAIL PROTECTED]Subject: Re: Can 
anyone help with solving the "BACK" button problem, in th e 
browser?

  That won't work.  I solved the problem using 
  javascript.  Javascript doesn't cache like JSP pages does, so you can get 
  around this problem using javascript.
   
  If you want, I can send you the code I 
  use.
  
- Original Message - 
From: 
Thane Eisener 
To: '[EMAIL PROTECTED]' 

Sent: Thursday, June 07, 2001 10:12 
AM
Subject: RE: Can anyone help with 
solving the "BACK" button problem, in th e browser?

Oops, I guess I should test before I post. It looks like 
newer browsers don't support this as a META tag only as a header.
I added the following to one of my action classes and the 
perform() method was called when I pressed 'Back': 
response.addHeader("Pragma","no-cache"); response.addHeader("Cache-control","no-cache"); 
Hope it helps, Thane 
-Original Message- From: 
Peter Alfors [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, June 07, 2001 11:35 AM To: [EMAIL PROTECTED] Subject: 
Re: Can anyone help with solving the "BACK" button problem, in 
th e browser? 
Thane , 
I am using:     
 in 
my header, and my action is not re-executed when I use the browser 
back button. Is there another 
option I should be using? 
thanks,     
Pete 
Thane Eisener wrote: 
> > > I seem to recall a META tag called something like 
pragma-no-cache that > you can embed in your page 
which will force the page to reload (not > just 
display a snapshot). This should enable handling the situation in 
> scriptlets or your action class. > > -Original Message- 
> From: Peter Alfors [mailto:[EMAIL PROTECTED]] 
> Sent: Thursday, June 07, 2001 9:52 AM > To: [EMAIL PROTECTED] > 
Subject: Re: Can anyone help with solving the "BACK" button problem, 
> in > the browser? 
> > Depending on which 
browser you use, and the data on the page, the back > button > may cause (or ask) the page 
to reload. > However, some browsers (like IE) 
only display a snapshot of what the > last 
page > rendered to. > 
Therefore, you cannot use scriptlets or the action class.  
However, > you are able > to kick-off javascript. > If you can 
gaurantee that your users will have javascript enabled, you > can write > a simple test to see if 
this page was already displayed to the user. > 
You could > check a flag (hidden field) when the 
page loads.  If the flag is true, > then 
use > the javascript to reload to your desired 
page. > > HTH, 
> Pete > > "Dudley Butt@i-Commerce" 
wrote: > > > Please 
help, > > > > 
When the user pushes the back button, I want the page to redirect or 
> refresh > > to a 
different page, please, any ideas? > > 
> > Thanx guys and gals > 
> Dudley 


RE: Javascript Validation

2001-06-08 Thread Dudley [EMAIL PROTECTED]

i just find it sometimes easier to move all validation off the jsp, and
hence all java off the jsp. I think its just basically a personal
preference. This way I'm making full use of the struts error handling model
and keep all my java in one place. There always seems to be more than one
way to do things, just depends on what u need to do and whats your
preference
Thanx for all the help guys

-Original Message-
From: Eelco van Kuik [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 11:32 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Javascript Validation


I don't understand why Dudley thought it was necessary to send java code,
but I think what you need you can find at:

http://javascript.internet.com/forms/

I don't have internet from this place, but know there are many javascript
examples there.

Regards,

Eelco



-Original Message-
From: Satish Khanzode [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 7:42 AM
To: [EMAIL PROTECTED]
Subject: Javascript Validation


Hi
Has anyone used client-side validations (using Javascript) in jsp pages
created Struts ? Pls help.
Thanks,
Satish Khanzode



Re: JSP expressions inside custom tags

2001-06-08 Thread Oleg V Alexeev

Hello Erich,

Friday, June 08, 2001, 12:56:42 PM, you wrote:

EM> My code looks like this:

EM> 
EM>  <% String name = ((PElement)pelement).getName(); %>
EM>  
EM>^^^ Here is my problem!
EM> 
EM>  
EM> 

try this -

 
   
 


-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: problem with invoking struts-template!!

2001-06-08 Thread Chuck Amadi

Hi, am i correct that the struts- template is a webapp and can i
physically move it's content to my struts-bbnpa thus move it up to where
tomcat is looking.Thus if this correct must i then constantly only refer
to content in my web app named struts-bbnpa.

Cheers chuck



Ted Husted wrote:

> I don't believe that the JSP templates and CSS files are strongly
> coupled. I believe the browser applies the CSS, not the template. You
> might just want to move the CSS up to where Tomcat is looking for it.
>
> Chuck Amadi wrote:
> >
> > I have created a index.jsp that has the content of our company
> > web-site, thus the index.jsp  is located
> > C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\index.jsp
> >
> > Thus i have set up the tag libraries in the web.xml file and
> > referenced the taglib at the top of my index.jsp page as
> > below.Nevertheless i recieve a Not Found Error.My struts-template is
> > located
> >
> > C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\WEB-INF\struts-template\css\bbnpa.css
> >
> > <%@ taglib uri="/WEB-INF/struts-template.tld"  prefix="template" %>
> >
> >
> > Not Found (404)
> >
> > Original request: /struts-bbnpa/css/bbnpa.css
> >
> > Not found request: /struts-bbnpa/css/bbnpa.css
> >
> > Any suggestions please .
> >
> > --
> > 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 dilwch bob copi.
> >
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/

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



begin:vcard 
n:amadi;chuck
tel;cell:07970 972534
tel;fax:01874 622574
tel;home:[EMAIL PROTECTED]
tel;work:Brecon Beacons National Park
x-mozilla-html:FALSE
url:http://www.breconbeacons.org
org:Brecon Beacons National Park;I.T
version:2.1
email;internet:[EMAIL PROTECTED]
title:I.T Systems Programmer
adr;quoted-printable:;;7 Glamorgan Street=0D=0ABrecon=0D=0APowys;Brecon;Powys;LD3 7DP;Wales (United Kingdom)
fn:chuck amadi
end:vcard



error regarding invoking css from struts-template

2001-06-08 Thread Chuck Amadi

Hi, am i correct that the struts- template is a webapp and can i
physically move it's content to my struts-bbnpa thus move it up to where
tomcat is looking.Thus if this correct must i then constantly only refer
to content in my web app named struts-bbnpa.

Cheers 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.



begin:vcard 
n:amadi;chuck
tel;cell:07970 972534
tel;fax:01874 622574
tel;home:[EMAIL PROTECTED]
tel;work:Brecon Beacons National Park
x-mozilla-html:FALSE
url:http://www.breconbeacons.org
org:Brecon Beacons National Park;I.T
version:2.1
email;internet:[EMAIL PROTECTED]
title:I.T Systems Programmer
adr;quoted-printable:;;7 Glamorgan Street=0D=0ABrecon=0D=0APowys;Brecon;Powys;LD3 7DP;Wales (United Kingdom)
fn:chuck amadi
end:vcard



Re: error regarding invoking css from struts-template

2001-06-08 Thread Ted Husted

There is  a sample Web app that demonstrates how to use the
struts-template tags, but you don't need to deploy that with your
applicaton.

Struts-template is one of the custom tag libraries, like bean, html, and
logic. All you just need is the stuts-template.tld, same as any of the
others.

The struts-templage tags just run out and assemble your JSP from one or
more pieces. 

If the pieces reference a CSS, then the resulting JSP will too. But it
is the browser that applies the CSS, not the tags. The tags just
generate HTML, the rest is up to the browser (or other client). 

Have you tried deploying your CSS without the templates?

I believe this is just a CSS path issue, and doesn't have anything to do
with the template tags.

Chuck Amadi wrote:
> 
> Hi, am i correct that the struts- template is a webapp and can i
> physically move it's content to my struts-bbnpa thus move it up to where
> tomcat is looking.Thus if this correct must i then constantly only refer
> to content in my web app named struts-bbnpa.
> 
> Cheers chuck



RE: Can you do this with internationalisation.

2001-06-08 Thread Jon.Ridgway

Hi Kosh,

The responses to your question by David Winterfeldt & Peter Alfors are the
correct way to go about this, as the local is already stored in the session
by struts. So to flesh out David's example for you... in your action classes
perform method try something like this:

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

String flag = ((LoginForm) form).getFlag ();
Local locale = new java.util.Locale (flag);

request.getSession().setAttribute(
org.apache.struts.action.Action.LOCALE_KEY,locale);

return (mapping.findForward("success"));
}

In your jsp you would use an html:img tag that added the 'flag' locale
string as a request parameter ie :



Then in subsequent jsps you just use a bean:message tag, no need to include
the locale option as we have set the struts locale key in the session and
this is used by the Message tag lib.

Jon.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 07 June 2001 16:41
To: [EMAIL PROTECTED]
Subject: RE: Can you do this with internationalisation.

I think I understand how this works, but some code examples would be 
handy since the documentation for the bean:message tag's locale 
attribute seems to indicate that a "
session scope bean under which our currently selected Locale object is 
stored" can be used as an alternative to the Action.LOCALE_KEY constant.

Kosh

> -Original Message-
> From: Jon.Ridgway 
> Sent: 07 June 2001 15:47
> To: struts-user
> Cc: Jon.Ridgway
> Subject: RE: Can you do this with internationalisation.
> 
> 
> Hi Alex,
> 
> Yes you can do this. When the user clicks on the flag, you 
> set the local in
> their session. Then use the local option to explicitly set 
> the local when
> using the Struts bean:message tag.
>  
> Jon.
> 
> -Original Message-
> From: Alex Colic [mailto:[EMAIL PROTECTED]] 
> Sent: 07 June 2001 15:07
> To: Struts
> Subject: Can you do this with internationalisation.
> 
> Hi,
> 
> my boss wants me to set up one of my apps written using 
> struts for a demo.
> He wants to have a web page with a couple of flags. The use 
> clicks on of the
> flags and enters the program using the language they selected.
> 
> Not having gone down this road before any idea what that 
> would entail. I
> know I would have to create multiple localisation files for 
> the languages.
> But how do I specify for each user what file to use and can you have
> multiple users all accessing your program concurrently viewing it in
> different languages.
> 
> Some insight into the above is appreciated.
> 
> Alex
> 


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail transmission.  If 
verification is required please request a hard-copy version.  This 
message is provided for informational purposes and should not be 
construed as a solicitation or offer to buy or sell any securities or 
related financial instruments.



Re: input in XML config

2001-06-08 Thread Ted Husted

As it stands, the "input" property in the Action Mapping is (4) a
default page. It is not meant so much to represent where the input
came from, but where to go to get more, so the ActionServlet knows 
where to bounce the user if ActionForm validate fails. 

For more complex needs, you can reserve validation for the Action
itself, where you can choose among multiple forwards. 

I agree that we need more flow control, especially to do things like let
users login in from all over the place and then get them back to
whereever they were, or interpose a standard confirmation dialog and
then forward on to another action, or go off and look up a related value
and then continue adding a new record. 

But none of these are ActionForm validate issues. 

I believe the core problem here may be trying to do business logic or
other complex validations in the ActionForm rather in than the Action.
ActionForm validation is great for simple, domain-type validations. But
any validation that causes a problem here should be performed in the
Action instead where there is more "elbow room".

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

Jonathan wrote:
> 
> I for one dont even understand the value in the "input value" parameter.
> There could be MANY pages that got you to the page you are on.  The "input"
> value just makes one possible origin available for you to have as a return
> target should things go fowl.  I had been saying on this discussion that
> there should be more or less 4 different destinations:
> 1) where you came from (referrer, or if there is no referrer a default
> page...see below)
> 2) where you were originally going when you were interrupted
> 3) a specific page - (can be success or failure page or could be the first
> page in a form)
> 4) a default page



Re: Hidding .jsp files

2001-06-08 Thread Ted Husted

You might try setting validate=false in the action mapping.

Mikkel Bruun wrote:
> 
>  Hi Craig,
> 
> A blast from the past...I believe this post is a month old...
> 
> Anyways...I see your point, but consider this...
> 
> If I only refered to the functionaly (pages, actions whatever), I would have
> the following problem...
> 
> myForm.do forwards to myAction which is validated to myForm...
> 
> So if I linked to myForm.do, my GET would be validated and myForm would
> return errormessages...
> 
> So I need an URL that doesn't trigger any logic, but just shows the form to
> the user...(or have a hidden init field in the form)...
> 
> Mikkel
> 
> -Original Message-
> From: Craig R. McClanahan
> To: '[EMAIL PROTECTED] '
> Sent: 02-06-2001 05:14
> Subject: Re: Hidding .jsp files
> 
> On Tue, 15 May 2001, Mikkel Bruun wrote:
> 
> > Hi Guys,
> >
> > Is it possible to make some sort of virtual path, enabling one to hide
> the
> > actual .jsp pages???
> >
> > Example,
> >
> > i want to avoid a link like /logon/logonform.jsp
> > replacing it with perhaps /logon (which in turn will point to
> > /logon/logonform.jsp)
> >
> > I tried looking at the globalforwards, but i find the documentation
> quite
> > lacking (there's an error in the code, btw)...but is this how its
> done???
> >
> > Another solution would be to make "empty" action classes that just
> returns
> > the succes mapping, but that would be going over the top imho...
> >
> >
> > Can anybody give an answer???
> >
> > thanks
> > Mikkel Bruun
> >
> >
> >
> 
> One thing to keep in mind is that, in a typical Struts application, the
> names of the JSP pages are obscured anyway -- because the form submits
> go
> to the controller servlet.  For example, walk your way through the
> Struts
> example application, and note how many of the locations actually shown
> have "*.do" extensions on them ...
> 
> As a more radical way to hide things (but more for the purpose of
> discouraging users from setting bookmarks in the middle of an
> application), I've also resorted on occasion to more radical approaches:
> 
> * Open the application in a window that doesn't have a location bar
> 
> * Create a frameset with only one frame in it (so the location bar
>   never changes at all).
> 
> Craig McClanahan



Re: Scratch RowSets

2001-06-08 Thread Ted Husted

Defining the SQL commands in struts-config.xml is definately a
leap-forward (I missed link to the sample WAR at first, and 
didn't see how you were implementing everything.)

Though, if stay on this road, larger project swill have to start
assembling their struts-config.xml from smaller files, as some 
people do with their Applicaton Resource now. ;-) 

The bean factory proposal seems excellent, and I'm going to try 
and take a closer at it this weekend. 

< http://www.sura.ru/~gonza/bean-factory/ >

It's an exciting idea, and works well with the J2EE patterns I'm 
using now. 

Being able to define the various beans we need in XML could bring 
a real productivity boost to a lot of Struts developers, myself 
included. I'm also getting ready to do something about a code 
generator, which could work well with a factory like this.

Incidentally, getting this to work is a real testament of how
easy Java app configuration can be. Edited two lines 
in struts-config.xml and I'm up and running with some other 
DBMS.

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

Oleg V Alexeev wrote:
> TH> Speaking of configuration issues, I've also played with the idea of
> TH> loading SQL commands from a resource, so they could be changed and
> TH> reloaded without restarting the application. It would also be easier to
> TH> optimize command sets for different DBMS packages. Just wondering if
> TH> anyone else has implemented a SQL command resource.
> 
> I already implement this as part of my bean generation framework. It
> contains JDBC bean factories (for single row, for all rows from result
> set, for window from the result set) and bean-templates (may be wrong
> term, of course) in which SQL queries can be defined. At bean creation
> process factory uses attributes, properties and parameters from
> request (all needed for this bean=template) and conserves result in
> session or request scope to display with jsp page.



Re: Can anyone help with solving the "BACK" button problem, in th e browser?

2001-06-08 Thread William Jaynes

Just a comment... Looks like your method of checking the RefreshOption
property will only work if the scope of the ActionForm is "session".
That's ok if one doesn't mind the use of resources.

- Original Message -
From: "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 5:34 AM
Subject: RE: Can anyone help with solving the "BACK" button problem, in
th e browser?


> well, this will blow all your socks off.
> I got something to work, and remaining in line with my "REDUCE THE
> JAVASCRIPT" policy
> here is what i did...
>
> I just plugged some code into my actionhandler to evaluate a state
property
> on my actionform. If it was a certain state i either perform usual
> processing or just by pass the processing and show the JSP which gets
> rebuilt anyways...
>
> great!!
>
> public ActionHandlerResponse executeAction(ActionMapping mapping,
> ActionForm form, HttpServletRequest request){
>
> System.out.println("In " + this.getClass());
> actionFormObject = (Vat201ReturnActionForm)form;
> aRequest = request;
> ActionErrors errors = null;
> if (actionFormObject.getRefreshOption()){   // IF THIS IS TRUE
DONT
> ALLOW ANY PROCESSING JUST REBUILD JSP
> // THIS boolean GETS SET AFTER FIRST TIME PROCESSING
> return new
> ActionHandlerResponse(errors,mapping.findForward("success"));
> }
> errors = doFieldValidation();
> if (errors != null) {
> actionFormObject.setAction("Edit");
> return new ActionHandlerResponse(errors, new
> ActionForward(mapping.getInput()));
> }
> else {
> errors = doReturnUpdate();
> if (errors == null){
>
> return new
> ActionHandlerResponse(errors,mapping.findForward("success"));
> }
> else {
> actionFormObject.setAction("Edit");
> return new ActionHandlerResponse(errors, new
> ActionForward(mapping.getInput()));
> }
> }
> //return new ActionHandlerResponse(errors,
> mapping.findForward("mainMenu"));
> }
>
>
>
>




Can you do this with internationalisation-elaboration

2001-06-08 Thread Alex Colic

Hi,

thanks all for the responses. From what I get I have to do the following:

1: create a web page with a couple of flags.
2: when the user selects a flag have that submitted to an action
3: check which flag the user has selected and create a local object and
place it in the session under org.apache.struts.action.Action.LOCALE_KEY

What about the applicationresources file. Right know I have one file. Do I
treat this file like other property files and just append the country and
localization data to the end?

E.g. applicationresources_EN_US.properties

Thanks all for the help.

Alex

 Alex Colic.vcf


Help with selecting an image to display.

2001-06-08 Thread Alex Colic

Hi, I am looking for advice regarding the use of two images.

Lets say you have a class status that has two boolean state properties
isModify() and isNew(). If isModify() returns true then I want to display
modify.gif and call the JavaScript function modify() and, if isNew() is true
then I want to display new.gif and also call modify().

Anyone have an example of this or could offer some advice?

Thanks.

Regards

Alex

 Alex Colic.vcf


Re[2]: Scratch RowSets

2001-06-08 Thread Oleg V Alexeev

Hello Ted,

Friday, June 08, 2001, 3:30:31 PM, you wrote:

TH> Defining the SQL commands in struts-config.xml is definately a
TH> leap-forward (I missed link to the sample WAR at first, and 
TH> didn't see how you were implementing everything.)

It is very simple model. For every action can be defined list of
bean/factory mappings and at request processing phase Servlet scan
this mappings, create bean by specified factory for every mapping and
store this bean in request or session scope. Every bean definition
(in struts-config) focus on some factory family (for example JDBC
factories, Castor factories, etc.).
JDBC factories use simple mechanism to retrieve data - perform SQL
query, create bean of specified type and call special method for every
row -

 bean.populateFrom( ResultSet rs )

to fill bean with values from row.

TH> Though, if stay on this road, larger project swill have to start
TH> assembling their struts-config.xml from smaller files, as some 
TH> people do with their Applicaton Resource now. ;-)

My first idea was to split struts-config to 'standart' part and
bean-factory part with my definirions. But it is needed to insert
references to bean templates into action tags and it was main reason
to build all in one.

TH> The bean factory proposal seems excellent, and I'm going to try 
TH> and take a closer at it this weekend. 

TH> < http://www.sura.ru/~gonza/bean-factory/ >

I'l build next revision at Saturday and notify community about it
shortly.

TH> It's an exciting idea, and works well with the J2EE patterns I'm 
TH> using now. 

TH> Being able to define the various beans we need in XML could bring 
TH> a real productivity boost to a lot of Struts developers, myself 
TH> included. I'm also getting ready to do something about a code 
TH> generator, which could work well with a factory like this.

TH> Incidentally, getting this to work is a real testament of how
TH> easy Java app configuration can be. Edited two lines 
TH> in struts-config.xml and I'm up and running with some other 
TH> DBMS.

Yes. I change datasource definition and some SQL queries in
bean-templates - and all application is moved from MySQL to DB2.

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

TH> Oleg V Alexeev wrote:
>> TH> Speaking of configuration issues, I've also played with the idea of
>> TH> loading SQL commands from a resource, so they could be changed and
>> TH> reloaded without restarting the application. It would also be easier to
>> TH> optimize command sets for different DBMS packages. Just wondering if
>> TH> anyone else has implemented a SQL command resource.
>> 
>> I already implement this as part of my bean generation framework. It
>> contains JDBC bean factories (for single row, for all rows from result
>> set, for window from the result set) and bean-templates (may be wrong
>> term, of course) in which SQL queries can be defined. At bean creation
>> process factory uses attributes, properties and parameters from
>> request (all needed for this bean=template) and conserves result in
>> session or request scope to display with jsp page.




-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: Can anyone help with solving the "BACK" button problem, in th e browser?

2001-06-08 Thread Jeff Trent

Another approach I would recommend to solve this problem (haven't tried it
though), would be to check the request referer.  If it is an empty string
then the user either clicked refresh or they typed in the URL into the
address field on their browser.


- Original Message -
From: "William Jaynes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 7:40 AM
Subject: Re: Can anyone help with solving the "BACK" button problem, in th e
browser?


> Just a comment... Looks like your method of checking the RefreshOption
> property will only work if the scope of the ActionForm is "session".
> That's ok if one doesn't mind the use of resources.
>
> - Original Message -
> From: "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, June 08, 2001 5:34 AM
> Subject: RE: Can anyone help with solving the "BACK" button problem, in
> th e browser?
>
>
> > well, this will blow all your socks off.
> > I got something to work, and remaining in line with my "REDUCE THE
> > JAVASCRIPT" policy
> > here is what i did...
> >
> > I just plugged some code into my actionhandler to evaluate a state
> property
> > on my actionform. If it was a certain state i either perform usual
> > processing or just by pass the processing and show the JSP which gets
> > rebuilt anyways...
> >
> > great!!
> >
> > public ActionHandlerResponse executeAction(ActionMapping mapping,
> > ActionForm form, HttpServletRequest request){
> >
> > System.out.println("In " + this.getClass());
> > actionFormObject = (Vat201ReturnActionForm)form;
> > aRequest = request;
> > ActionErrors errors = null;
> > if (actionFormObject.getRefreshOption()){   // IF THIS IS TRUE
> DONT
> > ALLOW ANY PROCESSING JUST REBUILD JSP
> > // THIS boolean GETS SET AFTER FIRST TIME PROCESSING
> > return new
> > ActionHandlerResponse(errors,mapping.findForward("success"));
> > }
> > errors = doFieldValidation();
> > if (errors != null) {
> > actionFormObject.setAction("Edit");
> > return new ActionHandlerResponse(errors, new
> > ActionForward(mapping.getInput()));
> > }
> > else {
> > errors = doReturnUpdate();
> > if (errors == null){
> >
> > return new
> > ActionHandlerResponse(errors,mapping.findForward("success"));
> > }
> > else {
> > actionFormObject.setAction("Edit");
> > return new ActionHandlerResponse(errors, new
> > ActionForward(mapping.getInput()));
> > }
> > }
> > file://return new ActionHandlerResponse(errors,
> > mapping.findForward("mainMenu"));
> > }
> >
> >
> >
> >
>
>




Re: Logic-Iterate not finding scope of Bean

2001-06-08 Thread Jeff Trent
Title: Logic-Iterate not finding scope of Bean



I would suggest keeping a hidden property on your 
form that keeps the state that you are in (ie., 1stTimeQuery, or 
useQueryResults)...
 

  - Original Message - 
  From: 
  Luna, Kat 
  
  To: [EMAIL PROTECTED] 
  Sent: Thursday, June 07, 2001 2:57 
  PM
  Subject: Logic-Iterate not finding scope 
  of Bean
  
  Hi all, me again with my afternoon question.. 
  I have a UserAction class that extracts a list of Users from 
  the database and stores them in an ArrayList.  Success from this Action 
  forwards to user.jsp which I want to display the list in table format.  I 
  have:
  <%@ page language="java" %> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" 
  %> <%@ taglib uri="/WEB-INF/struts-bean.tld" 
  prefix="bean" %> 
   
     
       
       
       
       
  
     
  ..etc 
  but this causes the UserAction to run again (essentially 
  calling the database and building the ArrayList again). Is there a way to have 
  this bean init() when the jsp page loads and then iterate through the 
  ArrayList instead of calling the Action first and then displaying the 
  page?  And if so, do I need to add anything to struts-config.xml to tell 
  the page where to find/identify the UserAction bean?
  Thanks, 
  Kat Luna Web Developer, 
  BCE Emergis [EMAIL PROTECTED] 
  


RE: Can you do this with internationalisation.

2001-06-08 Thread Kowshik . Podder

Thanks Jon - as I thought :)

Kosh

> -Original Message-
> From: Jon.Ridgway 
> Sent: 08 June 2001 11:45
> To: struts-user
> Cc: Jon.Ridgway
> Subject: RE: Can you do this with internationalisation.
> 
> 
> Hi Kosh,
> 
> The responses to your question by David Winterfeldt & Peter 
> Alfors are the
> correct way to go about this, as the local is already stored 
> in the session
> by struts. So to flesh out David's example for you... in your 
> action classes
> perform method try something like this:
> 
> public ActionForward perform(ActionMapping mapping,
>ActionForm form,
>HttpServletRequest request,
>HttpServletResponse response)
>   throws ServletException 
>   {
>   
>   String flag = ((LoginForm) form).getFlag ();
>   Local locale = new java.util.Locale (flag);
> 
>   request.getSession().setAttribute(
>   
> org.apache.struts.action.Action.LOCALE_KEY,locale);
> 
>   return (mapping.findForward("success"));
>   }
> 
> In your jsp you would use an html:img tag that added the 'flag' locale
> string as a request parameter ie :
> 
> 
> 
> Then in subsequent jsps you just use a bean:message tag, no 
> need to include
> the locale option as we have set the struts locale key in the 
> session and
> this is used by the Message tag lib.
> 
> Jon.
> 
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
> Sent: 07 June 2001 16:41
> To: [EMAIL PROTECTED]
> Subject: RE: Can you do this with internationalisation.
> 
> I think I understand how this works, but some code examples would be 
> handy since the documentation for the bean:message tag's locale 
> attribute seems to indicate that a "
> session scope bean under which our currently selected Locale 
> object is 
> stored" can be used as an alternative to the 
> Action.LOCALE_KEY constant.
> 
> Kosh
> 
> > -Original Message-
> > From: Jon.Ridgway 
> > Sent: 07 June 2001 15:47
> > To: struts-user
> > Cc: Jon.Ridgway
> > Subject: RE: Can you do this with internationalisation.
> > 
> > 
> > Hi Alex,
> > 
> > Yes you can do this. When the user clicks on the flag, you 
> > set the local in
> > their session. Then use the local option to explicitly set 
> > the local when
> > using the Struts bean:message tag.
> >  
> > Jon.
> > 
> > -Original Message-
> > From: Alex Colic [mailto:[EMAIL PROTECTED]] 
> > Sent: 07 June 2001 15:07
> > To: Struts
> > Subject: Can you do this with internationalisation.
> > 
> > Hi,
> > 
> > my boss wants me to set up one of my apps written using 
> > struts for a demo.
> > He wants to have a web page with a couple of flags. The use 
> > clicks on of the
> > flags and enters the program using the language they selected.
> > 
> > Not having gone down this road before any idea what that 
> > would entail. I
> > know I would have to create multiple localisation files for 
> > the languages.
> > But how do I specify for each user what file to use and can you have
> > multiple users all accessing your program concurrently viewing it in
> > different languages.
> > 
> > Some insight into the above is appreciated.
> > 
> > Alex
> > 
> 
> 
> Visit our website at http://www.ubswarburg.com
> 
> This message contains confidential information and is intended only 
> for the individual named.  If you are not the named addressee you 
> should not disseminate, distribute or copy this e-mail.  Please 
> notify the sender immediately by e-mail if you have received this 
> e-mail by mistake and delete this e-mail from your system.
> 
> E-mail transmission cannot be guaranteed to be secure or error-free 
> as information could be intercepted, corrupted, lost, destroyed, 
> arrive late or incomplete, or contain viruses.  The sender therefore 
> does not accept liability for any errors or omissions in the contents 
> of this message which arise as a result of e-mail transmission.  If 
> verification is required please request a hard-copy version.  This 
> message is provided for informational purposes and should not be 
> construed as a solicitation or offer to buy or sell any securities or 
> related financial instruments.
> 


Visit our website at http://www.ubswarburg.com

This message contains confidential information and is intended only 
for the individual named.  If you are not the named addressee you 
should not disseminate, distribute or copy this e-mail.  Please 
notify the sender immediately by e-mail if you have received this 
e-mail by mistake and delete this e-mail from your system.

E-mail transmission cannot be guaranteed to be secure or error-free 
as information could be intercepted, corrupted, lost, destroyed, 
arrive late or incomplete, or contain viruses.  The sender therefore 
does not accept liability for any errors or omissions in the contents 
of this message which arise as a result of e-mail trans

RE: Can anyone help with solving the "BACK" button problem, in th e browser?

2001-06-08 Thread Dudley [EMAIL PROTECTED]

yes, but this is a form that is being filled in like a wizard type of thing,
i need the form to be session
any ideas, for an alternative?


-Original Message-
From: William Jaynes [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 1:40 PM
To: [EMAIL PROTECTED]
Subject: Re: Can anyone help with solving the "BACK" button problem, in
th e browser?


Just a comment... Looks like your method of checking the RefreshOption
property will only work if the scope of the ActionForm is "session".
That's ok if one doesn't mind the use of resources.

- Original Message -
From: "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 5:34 AM
Subject: RE: Can anyone help with solving the "BACK" button problem, in
th e browser?


> well, this will blow all your socks off.
> I got something to work, and remaining in line with my "REDUCE THE
> JAVASCRIPT" policy
> here is what i did...
>
> I just plugged some code into my actionhandler to evaluate a state
property
> on my actionform. If it was a certain state i either perform usual
> processing or just by pass the processing and show the JSP which gets
> rebuilt anyways...
>
> great!!
>
> public ActionHandlerResponse executeAction(ActionMapping mapping,
> ActionForm form, HttpServletRequest request){
>
> System.out.println("In " + this.getClass());
> actionFormObject = (Vat201ReturnActionForm)form;
> aRequest = request;
> ActionErrors errors = null;
> if (actionFormObject.getRefreshOption()){   // IF THIS IS TRUE
DONT
> ALLOW ANY PROCESSING JUST REBUILD JSP
> // THIS boolean GETS SET AFTER FIRST TIME PROCESSING
> return new
> ActionHandlerResponse(errors,mapping.findForward("success"));
> }
> errors = doFieldValidation();
> if (errors != null) {
> actionFormObject.setAction("Edit");
> return new ActionHandlerResponse(errors, new
> ActionForward(mapping.getInput()));
> }
> else {
> errors = doReturnUpdate();
> if (errors == null){
>
> return new
> ActionHandlerResponse(errors,mapping.findForward("success"));
> }
> else {
> actionFormObject.setAction("Edit");
> return new ActionHandlerResponse(errors, new
> ActionForward(mapping.getInput()));
> }
> }
> //return new ActionHandlerResponse(errors,
> mapping.findForward("mainMenu"));
> }
>
>
>
>



Re: input in XML config

2001-06-08 Thread Jonathan Asbell

I agree, but was really just pointing out that the input value is not
useful.  In some ways its outright misleading.

- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 7:23 AM
Subject: Re: input in XML config


> As it stands, the "input" property in the Action Mapping is (4) a
> default page. It is not meant so much to represent where the input
> came from, but where to go to get more, so the ActionServlet knows
> where to bounce the user if ActionForm validate fails.
>
> For more complex needs, you can reserve validation for the Action
> itself, where you can choose among multiple forwards.
>
> I agree that we need more flow control, especially to do things like let
> users login in from all over the place and then get them back to
> whereever they were, or interpose a standard confirmation dialog and
> then forward on to another action, or go off and look up a related value
> and then continue adding a new record.
>
> But none of these are ActionForm validate issues.
>
> I believe the core problem here may be trying to do business logic or
> other complex validations in the ActionForm rather in than the Action.
> ActionForm validation is great for simple, domain-type validations. But
> any validation that causes a problem here should be performed in the
> Action instead where there is more "elbow room".
>
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
>
> Jonathan wrote:
> >
> > I for one dont even understand the value in the "input value" parameter.
> > There could be MANY pages that got you to the page you are on.  The
"input"
> > value just makes one possible origin available for you to have as a
return
> > target should things go fowl.  I had been saying on this discussion that
> > there should be more or less 4 different destinations:
> > 1) where you came from (referrer, or if there is no referrer a default
> > page...see below)
> > 2) where you were originally going when you were interrupted
> > 3) a specific page - (can be success or failure page or could be the
first
> > page in a form)
> > 4) a default page
>




default select on radio

2001-06-08 Thread Kiet Nguyen

how do I set default values for radio and checkboxes.

thanks



RE: ActionForm/Action with edit mode

2001-06-08 Thread Hogan, John

Ok, sounds good, but I don't quite understand the case of the update.  How
is the "visit and Action first" accomplished?  I thought the action followed
the processing of a form submit/ActionForm processing.  TIA.

JohnH

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 5:44 PM
To: [EMAIL PROTECTED]
Subject: Re: ActionForm/Action with edit mode


If I understand the question, all you have to do is change the form's
action to insert or update as the case may be. A good way to do this is
to have a "task" parameter that you would pass to a single action
designed to handle both cases. You can do this dymamically using (where
key=0 means we're inserting a new record). 








For an update, visit an Action first, select the record, populate the
form, and forward to input.  

John Hogan wrote:
> 
> All,
> 
> I have a situation where it is desirable to use a form/page for both
> adding new info and editing existing data.  The new info scenario is
> straight forward struts ActionForm/Action classes.  What I'm
> wrestling with a bit is the edit scenario.  I'm wondering if I can
> stay within the struts framework and still do something like entering
> a page in edit mode and have it displaying existing user data?
> 
> It seems this should be possible because that's exactly what the page
> does for error handling.  Has anyone else tackled this one yet?  TIA.
> 
> JohnH
> 
> _
> 
> Get your free E-mail at http://www.ireland.com

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



File Upload Corrupting Zip File

2001-06-08 Thread Darryl Pentz

Hi all,

Something happens to corrupt a file I'm uploading from a multipart form. If
I run a ZIP file through my unzip utility targeting the actual ZIP file, it
unzips just fine. If I point my unzip utility at the temporary file in the
deployments temp directory of Orion Server (the app server I'm using), the
utility fails with a ZipException indicating it expected x bytes but got x+
bytes on one of the zip entries.

I did the same with WinZip and it worked on the original ZIP and also failed
on the uploaded temp file. It seems to me that the problem most likely lies
with Struts, particularly the DiskMultipartRequestHandler.java but there's
nothing in there that appears suspicious. Does anyone have any insight on
this or has anyone perhaps had this same problem?

Interestingly though, I unzipped the file, removed the entry that was
causing the problem, rezipped it and everything worked fine. That doesn't
however exonerate Struts however, since both my zip utility AND WinZip
worked on the original ZIP. The problem only occurs after Struts has
uploaded the file.

Here is the output that WinZip gave me when it failed to unzip the temp
file:

Extracting to "C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\"
Use Path: no   Overlay Files: yes
warning
[C:/orion/application-deployments/wellcert/wellcert-web/temp/strts34531.tmp]
:  extra 1 bytes at beginning or within Zip file (attempting to process
anyway)
Error in file #1:  bad Zip file offset (Error local header signature not
found):  409756
(attempting to re-compensate)
Extracting Image36.gif
Error: unexpected end of file encountered
Error:  invalid compressed data to inflate

thanks in advance,
Darryl Pentz




RE: Logic-Iterate not finding scope of Bean

2001-06-08 Thread Charlesworth, Chico

you can also have two separate action classes that use the same form, where
you use the first action class when you first go into that page, then use
the second when you are submitting or whatever in the form

-Original Message-
From: Luna, Kat [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 7:58 PM
To: [EMAIL PROTECTED]
Subject: Logic-Iterate not finding scope of Bean




Hi all, me again with my afternoon question.. 


I have a UserAction class that extracts a list of Users from the database
and stores them in an ArrayList.  Success from this Action forwards to
user.jsp which I want to display the list in table format.  I have:

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

 

   

 
 
 
 

   

..etc 

but this causes the UserAction to run again (essentially calling the
database and building the ArrayList again). Is there a way to have this bean
init() when the jsp page loads and then iterate through the ArrayList
instead of calling the Action first and then displaying the page?  And if
so, do I need to add anything to struts-config.xml to tell the page where to
find/identify the UserAction bean?

Thanks, 


Kat Luna 
Web Developer, 
BCE Emergis 
[EMAIL PROTECTED] 


-- 
The content of this e-mail is confidential, may contain privileged material
and is intended solely for the recipient(s) named above. If you receive this
in error, please notify Software AG immediately and delete this e-mail.

Software AG (UK) Limited
Registered in England & Wales 1310740
Registered Office: Hudson House, Hudson Way,
Pride Park, Derby DE24 8HS



RE: Javascript Validation

2001-06-08 Thread David Winterfeldt
Don't forget that any client validations you do using JavaScript should be duplicated on the server side because there is no guarantee the JavaScipt will run.  The client have have it turned off or the script could fail depending on the browser.  I have started work on a validation framework that works in Struts and let's you sync up your server side validation with your client side validation if you want to look at it.  
http://home.earthlink.net/~dwinterfeldt
David
  "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]> wrote: 
i just find it sometimes easier to move all validation off the jsp, andhence all java off the jsp. I think its just basically a personalpreference. This way I'm making full use of the struts error handling modeland keep all my java in one place. There always seems to be more than oneway to do things, just depends on what u need to do and whats yourpreferenceThanx for all the help guys-Original Message-From: Eelco van Kuik [mailto:[EMAIL PROTECTED]]Sent: Friday, June 08, 2001 11:32 AMTo: '[EMAIL PROTECTED]'Subject: RE: Javascript ValidationI don't understand why Dudley thought it was necessary to send java code,but I think what you need you can find at:http://javascript.internet.com/forms/I don't have internet from this place, but know there are many javascriptexamples there.Regards,Eelco-Original Message-From: Satish Khanzode [mailto:[EMAIL PROTECTED]]Sent: Friday, June 08, 2001 7:42 AMTo: [EMAIL PROTECTED]Subject: Javascript ValidationHiHas anyone used client-side validations (using Javascript) in jsp pagescreated Struts ? Pls help.Thanks,Satish KhanzodeDo You Yahoo!?
Yahoo! Mail Personal Address - 
Get email at your own domain with Yahoo! Mail.

Re: Struts Beta 03 Build Problem

2001-06-08 Thread McLure, David

Hello Oleg,

I tried this on both linux as well as NT, but unfortunately I still get the
same error.
I even tried adding the jdbc2_0-stdext.jar to my \jdk1.3.1\jre\lib\ext dir
as well, but this didn't help.
I am pretty sure my Ant install basically works because I have built other
things with it such as PostgreSQL.

Any other ideas?

Thanks!
David McLure

DM> Any idea why I am consistently getting an
"org.apache.tools.ant.taskdefs.optional.TraXLiason" ClassNotFoundException
when trying an "ant dist" build of jakarta-struts-1.0-b3-src using Ant 1.3
on
DM> both NT and Linux?  I have what seem to be the only required jars in my
path: xalan.jar and jaxp.jar from jaxp-1_1.zip, and jdbc2_0-stdext.jar, with
jdk1.3.1?

OA>Place crimson.jar, jaxp.jar, xalan.jar files from jaxp-1_1.zip to the
OA>jdk extension dir - x:\jdk1.3.1\jre\lib\ext for example.




html errors tag not displaying content

2001-06-08 Thread Chris Wilson
Title: html errors tag not displaying content






hello,


i just upgraded to struts beta 3.  i have an application that was working just fine using the struts errors tag.  after the upgrade, i no longer see any error messages.  on my jsp, i have a line:




that outputs no content...  however, the following line right below shows the proper error:


<%= ((ActionError)((ActionErrors)request.getAttribute(Action.ERROR_KEY)).get().next()).getValues()[0] %>


so, i know the ActionErrors object is getting to the page and that it has my errors in it, but  is not showing them.

any idea as to what might be going on?


thanks for any help.


cheers,

chris


| chris wilson || web dev ||| [EMAIL PROTECTED] || | www.wondergeek.com | | 





Exceptions in Struts code

2001-06-08 Thread Timothy Hicks

I just installed Struts 1.0b2 with Websphere 3.5.3 and had one major
problem.  If I do not put a try catch in the FormTag.doEndTag() I receive
an uncaught exception.

I modified the method FormTag.doEndTag() to the following to catch the
exceptions I was receiving from the removeAttribute() calls.  What am I
doing wrong that I have to modify a class which I would think has been
pounded on for some time?

public int doEndTag() throws JspException {
try
{
// Remove the page scope attributes we created
pageContext.removeAttribute(Constants.BEAN_KEY,
PageContext.REQUEST_SCOPE);
pageContext.removeAttribute(Constants.FORM_KEY,
PageContext.REQUEST_SCOPE);
}
catch (Exception e)
{
 System.out.println("Exception caught : " + e.toString());
}

// Render a tag representing the end of our current form
StringBuffer results = new StringBuffer("");

// Render JavaScript to set the input focus if required
if (focus != null) {
String tempFocus = focus;
StringBuffer refocus = new StringBuffer("[");
if (tempFocus.indexOf("[") > 0) {
StringTokenizer st = new StringTokenizer(tempFocus, "[");
if (st.countTokens() == 2) {
tempFocus = st.nextToken();
refocus.append(st.nextToken());
}
}
results.append("\r\n");
results.append("\r\n");
results.append("  \r\n");
results.append("\r\n");
}

// Print this value to our output writer
JspWriter writer = pageContext.getOut();
try {
writer.print(results.toString());
} catch (IOException e) {
throw new JspException(messages.getMessage("common.io", e.toString
()));
}

// Continue processing this page
return (EVAL_PAGE);

}




RE: Struts Beta 03 Build Problem

2001-06-08 Thread Deadman, Hal

Did you get the ant binary distribution or did you build ant yourself?
Building ant yourself may get you a version of ant that supports fewer tasks
depending on what is in your classpath when you build it. Certain classes
such as org.apache.tools.ant.taskdefs.optional.TraXLiason don't get built
unless certain things are found in your classpath when ant is built.

If you have the pre-built ant distribution, make sure the optional ant jar
files are in your classpath. PostgresSQL probably doesn't use the ant style
task which uses org.apache.tools.ant.taskdefs.optional.TraXLiason.



> -Original Message-
> From: McLure, David [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 11:03 AM
> To: '[EMAIL PROTECTED]'
> Subject: Re: Struts Beta 03 Build Problem
>
>
> Hello Oleg,
>
> I tried this on both linux as well as NT, but unfortunately I
> still get
> the
> same error.
> I even tried adding the jdbc2_0-stdext.jar to my \jdk1.3.1\jre\lib\ext
> dir
> as well, but this didn't help.
> I am pretty sure my Ant install basically works because I have built
> other
> things with it such as PostgreSQL.
>
> Any other ideas?
>
> Thanks!
> David McLure
>
> DM> Any idea why I am consistently getting an
> "org.apache.tools.ant.taskdefs.optional.TraXLiason"
> ClassNotFoundException
> when trying an "ant dist" build of jakarta-struts-1.0-b3-src using Ant
> 1.3
> on
> DM> both NT and Linux?  I have what seem to be the only
> required jars in
> my
> path: xalan.jar and jaxp.jar from jaxp-1_1.zip, and
> jdbc2_0-stdext.jar,
> with
> jdk1.3.1?
>
> OA>Place crimson.jar, jaxp.jar, xalan.jar files from
> jaxp-1_1.zip to the
> OA>jdk extension dir - x:\jdk1.3.1\jre\lib\ext for example.



Re: Struts Beta 03 Build Problem

2001-06-08 Thread Ted Husted

Did you build Ant from the source and include the optional package?

My recollection is that TraXLiason is not included in the binary
distribution.

"McLure, David" wrote:
> 
> Hello Oleg,
> 
> I tried this on both linux as well as NT, but unfortunately I still get the
> same error.
> I even tried adding the jdbc2_0-stdext.jar to my \jdk1.3.1\jre\lib\ext dir
> as well, but this didn't help.
> I am pretty sure my Ant install basically works because I have built other
> things with it such as PostgreSQL.
> 
> Any other ideas?
> 
> Thanks!
> David McLure
> 
> DM> Any idea why I am consistently getting an
> "org.apache.tools.ant.taskdefs.optional.TraXLiason" ClassNotFoundException
> when trying an "ant dist" build of jakarta-struts-1.0-b3-src using Ant 1.3
> on
> DM> both NT and Linux?  I have what seem to be the only required jars in my
> path: xalan.jar and jaxp.jar from jaxp-1_1.zip, and jdbc2_0-stdext.jar, with
> jdk1.3.1?
> 
> OA>Place crimson.jar, jaxp.jar, xalan.jar files from jaxp-1_1.zip to the
> OA>jdk extension dir - x:\jdk1.3.1\jre\lib\ext for example.



Re: Can anyone help with solving the "BACK" button problem, in the browser?

2001-06-08 Thread Ted Husted

It's not "wrong" to have a form in the session context, so long as it is
disposed in the normal course; it's just a convenience that you do not
want to overuse. 

"Dudley Butt@i-Commerce" wrote:
> 
> yes, but this is a form that is being filled in like a wizard type of thing,
> i need the form to be session
> any ideas, for an alternative?
> 
> -Original Message-
> From: William Jaynes [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 1:40 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Can anyone help with solving the "BACK" button problem, in
> th e browser?
> 
> Just a comment... Looks like your method of checking the RefreshOption
> property will only work if the scope of the ActionForm is "session".
> That's ok if one doesn't mind the use of resources.



RE: ActionForm/Action with edit mode

2001-06-08 Thread Hogan, John

Joe, Ted,

Your proposed solutions worked well.  Thanks.

JohnH

-Original Message-
From: Joe Kepley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 5:50 PM
To: [EMAIL PROTECTED]
Subject: RE: ActionForm/Action with edit mode


I solved this one by creating an action that looked at the incoming bean,
and if it was null or contained no data (the user was viewing and hadnt
edited yet), then the action would populate the bean from a database and
pass back with no errors. If a hidden variable (I called it 'process') had
been set, then the action would validate the input, then store the new info
into the database. 
Hope that helps,
--Joe
> -Original Message-
> From: John Hogan [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 06, 2001 4:29 PM
> To: [EMAIL PROTECTED]
> Subject: ActionForm/Action with edit mode
> 
> 
> All,
> 
> I have a situation where it is desirable to use a form/page for both 
> adding new info and editing existing data.  The new info scenario is 
> straight forward struts ActionForm/Action classes.  What I'm 
> wrestling with a bit is the edit scenario.  I'm wondering if I can 
> stay within the struts framework and still do something like entering 
> a page in edit mode and have it displaying existing user data?
> 
> It seems this should be possible because that's exactly what the page 
> does for error handling.  Has anyone else tackled this one yet?  TIA.
> 
> JohnH
> 
> _
> 
> Get your free E-mail at http://www.ireland.com
> 



html:radio tag question

2001-06-08 Thread Steve Salkin
Title: html:radio tag question





Hi-


I am converting an html page to struts jsp. The original page has a set of radio buttons that are supposed to be mutually exclusive. Each has a name, and the author used javscript functions that refer to these names as onclick handlers.

My struts  tags are all in the same form, yet they do not exhibit a mutual-exclusion behavior. When checking one, the others that are checked remain checked. I could manually fix this in javascript, except that I don't see how to get the  to emit a name and element attribute in the resulting 

RE: Javascript Validation

2001-06-08 Thread Dudley [EMAIL PROTECTED]



thanx 
, will check it out
 

  -Original Message-From: David Winterfeldt 
  [mailto:[EMAIL PROTECTED]]Sent: Friday, June 08, 2001 4:56 
  PMTo: [EMAIL PROTECTED]Subject: RE: 
  Javascript Validation
  Don't forget that any client validations you do using JavaScript should be 
  duplicated on the server side because there is no guarantee the JavaScipt will 
  run.  The client have have it turned off or the script could fail 
  depending on the browser.  I have started work on a validation framework 
  that works in Struts and let's you sync up your server side validation with 
  your client side validation if you want to look at it.  
  http://home.earthlink.net/~dwinterfeldt 
  David 
    "Dudley Butt@i-Commerce" 
  <[EMAIL PROTECTED]> wrote: 
  i 
just find it sometimes easier to move all validation off the jsp, 
andhence all java off the jsp. I think its just basically a 
personalpreference. This way I'm making full use of the struts error 
handling modeland keep all my java in one place. There always seems to 
be more than oneway to do things, just depends on what u need to do and 
whats yourpreferenceThanx for all the help guys-Original 
Message-From: Eelco van Kuik [mailto:[EMAIL PROTECTED]]Sent: Friday, 
June 08, 2001 11:32 AMTo: '[EMAIL PROTECTED]'Subject: 
RE: Javascript ValidationI don't understand why Dudley thought 
it was necessary to send java code,but I think what you need you can 
find at:http://javascript.internet.com/forms/I don't have 
internet from this place, but know there are many javascriptexamples 
there.Regards,Eelco-Original 
Message-From: Satish Khanzode 
[mailto:[EMAIL PROTECTED]]Sent: Friday, June 08, 2001 7:42 
AMTo: [EMAIL PROTECTED]Subject: Javascript 
ValidationHiHas anyone used client-side validations (using 
Javascript) in jsp pagescreated Struts ? Pls help.Thanks,Satish 
Khanzode
  
  
  Do You Yahoo!?Yahoo! Mail Personal 
  Address - Get email at your own domain with Yahoo! 
Mail.


displaying html errors in order

2001-06-08 Thread Charlesworth, Chico

i can display errors fine, but they are displayed not in the same order as i
created them ...
 
I see this is because the ActionErrors class uses a HashMap and therefore
doesn't return them in a given order (i think it sorts them according to the
hashcode value).
 
I can use the property tag in html:errors tag to display each error
individually, but then it displays my error header and footer for each error
displayed ...
 
As anyone thought of a nice hack so this doesn't happen?
cheers, chico
 

-- 
The content of this e-mail is confidential, may contain privileged material
and is intended solely for the recipient(s) named above. If you receive this
in error, please notify Software AG immediately and delete this e-mail.

Software AG (UK) Limited
Registered in England & Wales 1310740
Registered Office: Hudson House, Hudson Way,
Pride Park, Derby DE24 8HS



Nested property error ?!?

2001-06-08 Thread Jerzy Kalat



Hi,
 
I am new to Struts technology, so forgive me if I not see 
something obvious here.
 
Based on e-Commerece example from Wrox book, I have created 
form to maintain organization, which suppose to behave like SQL Form. So I have 
browsing keys, Update, Insert, Delete and other keys. Right now I have no access 
to database, so I used Struts database utility and store collection of records. 

 
Everything is working fine, I can see and navigate between 
records, I can update or delete them.
 
The problem starts when I try to simulate retrieving of not 
all records but records based on some criteria entered in the form. In Action 
servlet I wrote:
 
 OrganizationForm orgForm = 
(OrganizationForm)form; Organization orgFromForm = 
orgForm.getOrganization();..
 HashMap orgTable = 
 (HashMap) 
servletContext.getAttribute(Constants.ORGANIZATION_TABLE_KEY);
 
 if(orgTable == null) 
{ 
errors.add(ActionErrors.GLOBAL_ERROR,    
new ActionError("error.orgTable.missing")); } else 
{    int size = 
orgTable.size();   
orgForm.setTotal(size); 
if(size > 0) {    int i = 1;    
Iterator iterator = orgTable.values().iterator();    
Organization[] orgArray = new Organization[size+1];    
Organization anOrg = null;    while(iterator.hasNext()) 
{    
 anOrg = 
(Organization)iterator.next(); 
if( "Query".equals(mode) && 
"Retrieve".equals(action)) { 
if( 
orgForm.matches(anOrg))  
  orgArray[i++] = 
anOrg; 
} else {    
    orgArray[i++] = 
anOrg;}}
 
So, for every record from otgArray, I want to compare city of 
address of organization with
city field from the form.
 
In OrganizationForm.java I create method:
 
 
public boolean matches( Organization org 
){
System.out.println("FORM=" + this.organization 
);System.out.println("COLL=" + org );
  if ( this.organization != null && 
this.organization.getAddress() != null && 
   
this.organization.getAddress().getCity() != null ) 
{  String cityFromForm 
= this.organization.getAddress().getCity();    
   if ( org != null && org.getAddress() != null 
&& org.getAddress().getCity() != null ) 
{ String cityFromCollection 
= 
org.getAddress().getCity(); 
System.out.println("COMPARE " + cityFromCollection + " WITH " + cityFromForm 
); if( 
cityFromCollection.equals( cityFromForm )) 
   return 
true; else 
   return 
false; 
}   return false;  
  }  return true;  // no 
selection provided} 
 
If I call this method I have error:
javax.servlet.ServletException: Null property value for 
'organization'
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) 

...
Root cause: java.lang.IllegalArgumentException: Null property value for 'organization'
	at org.apache.struts.util.PropertyUtils.getNestedProperty(PropertyUtils.java:347)If I comment out if statements from this method, I can see BOTH records: FORM=... and COLL=...  with proper atribute values. So WHY I CANNOT COMPARE THEM? Can anybody help me with what I do wrong? Thanks in advance, Jerzy Kalat 


testing if I can add my problem here

2001-06-08 Thread Jerzy Kalat

.




Re: ActionForm/Action with edit mode

2001-06-08 Thread Ted Husted

It's actually better to link only to Actions, and let them forward to a
JSP as needed. 

The Action just returns a forward like 

return (mapping.findForward("form"));

where you have something like 



in your struts-config. 

It's usually convenient to use the same Action for related tasks. For
example, to provide a new input form, the Action may do nothing, and
just return with a blank ActionForm. You can have the same Action do
selects or updates or deletes or whatevers by passing it different
parameters, either as hidden properties or as submit button values, and
then keying on this to do one thing or the other (or forward to another
Action if Perform starts to get too long). 

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


"Hogan, John" wrote:
> 
> Ok, sounds good, but I don't quite understand the case of the update.  How
> is the "visit and Action first" accomplished?  I thought the action followed
> the processing of a form submit/ActionForm processing.  TIA.
> 
> JohnH
> 
> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 06, 2001 5:44 PM
> To: [EMAIL PROTECTED]
> Subject: Re: ActionForm/Action with edit mode
> 
> If I understand the question, all you have to do is change the form's
> action to insert or update as the case may be. A good way to do this is
> to have a "task" parameter that you would pass to a single action
> designed to handle both cases. You can do this dymamically using (where
> key=0 means we're inserting a new record).
> 
> 
> 
> 
> 
> 
> 
> 
> For an update, visit an Action first, select the record, populate the
> form, and forward to input.
> 
> John Hogan wrote:
> >
> > All,
> >
> > I have a situation where it is desirable to use a form/page for both
> > adding new info and editing existing data.  The new info scenario is
> > straight forward struts ActionForm/Action classes.  What I'm
> > wrestling with a bit is the edit scenario.  I'm wondering if I can
> > stay within the struts framework and still do something like entering
> > a page in edit mode and have it displaying existing user data?
> >
> > It seems this should be possible because that's exactly what the page
> > does for error handling.  Has anyone else tackled this one yet?  TIA.
> >
> > JohnH
> >
> > _
> >
> > Get your free E-mail at http://www.ireland.com
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/



Re: Scratch RowSets

2001-06-08 Thread Ted Husted

Oleg V Alexeev wrote:
> TH> Though, if stay on this road, larger project swill have to start
> TH> assembling their struts-config.xml from smaller files, as some
> TH> people do with their Applicaton Resource now. ;-)
> 
> My first idea was to split struts-config to 'standart' part and
> bean-factory part with my definirions. But it is needed to insert
> references to bean templates into action tags and it was main reason
> to build all in one.

So long as we can still use a "package" format within struts-config,
that shouldn't be a problem, since people could split them up for team
development and concaternate them back again as part of the build.

(By package format, I mean that we can repeat the  node
and all it's children as many times as needed, and still create a single
ActionMapping database. I do that now and can also include David's
 nodes in the same file, so that all package's
programtic settings are all together.)


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



RE: Can anyone help with solving the "BACK" button problem, in the browser?

2001-06-08 Thread Dudley [EMAIL PROTECTED]

great, then, that makes me feel like i'm on the right path..thanx

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 5:33 PM
To: [EMAIL PROTECTED]
Subject: Re: Can anyone help with solving the "BACK" button problem, in
the browser?


It's not "wrong" to have a form in the session context, so long as it is
disposed in the normal course; it's just a convenience that you do not
want to overuse. 

"Dudley Butt@i-Commerce" wrote:
> 
> yes, but this is a form that is being filled in like a wizard type of
thing,
> i need the form to be session
> any ideas, for an alternative?
> 
> -Original Message-
> From: William Jaynes [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 1:40 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Can anyone help with solving the "BACK" button problem, in
> th e browser?
> 
> Just a comment... Looks like your method of checking the RefreshOption
> property will only work if the scope of the ActionForm is "session".
> That's ok if one doesn't mind the use of resources.



Re: html errors tag not displaying content

2001-06-08 Thread Dan Miser
Title: html errors tag not displaying content



Did you remember to add the html tag library to 
your JSP page?
--
Dan Miser
http://www.distribucon.com

  - Original Message - 
  From: 
  Chris 
  Wilson 
  To: [EMAIL PROTECTED] 
  
  Sent: Friday, June 08, 2001 10:08 
AM
  Subject: html errors tag not displaying 
  content
  
   
  that outputs no content...  however, the 
  following line right below shows the proper error: 
   


Re: Exceptions in Struts code

2001-06-08 Thread Dan Miser

This is due to a bug in WAS. Search the mail archives for this group, as
there have been some patches that will solve this specific problem.
Unfortunately, they open up other potential problems and the real fix rests
in IBM's lap.
--
Dan Miser
http://www.distribucon.com

- Original Message -
From: "Timothy Hicks" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: "Kevin Lane" <[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 10:07 AM
Subject: Exceptions in Struts code


> I just installed Struts 1.0b2 with Websphere 3.5.3 and had one major
> problem.  If I do not put a try catch in the FormTag.doEndTag() I receive
> an uncaught exception.





Re: Nested property error - resolved

2001-06-08 Thread Jerzy Kalat



Hi,
 
It was something obvious :-)
 
    JK

  - Original Message - 
  From: 
  Jerzy Kalat 
  To: [EMAIL PROTECTED] 
  
  Sent: Friday, June 08, 2001 11:09 
AM
  Subject: Nested property error ?!?
  
  Hi,
   
  I am new to Struts technology, so forgive me if I not see 
  something obvious here.
   
  Based on e-Commerece example from Wrox book, I have created 
  form to maintain organization, which suppose to behave like SQL Form. So I 
  have browsing keys, Update, Insert, Delete and other keys. Right now I have no 
  access to database, so I used Struts database utility and store collection of 
  records. 
   
  Everything is working fine, I can see and navigate between 
  records, I can update or delete them.
   
  The problem starts when I try to simulate retrieving of not 
  all records but records based on some criteria entered in the form. In Action 
  servlet I wrote:
   
   OrganizationForm orgForm = 
  (OrganizationForm)form; Organization orgFromForm = 
  orgForm.getOrganization();..
   HashMap orgTable = 
   (HashMap) 
  servletContext.getAttribute(Constants.ORGANIZATION_TABLE_KEY);
   
   if(orgTable == null) 
  { 
  errors.add(ActionErrors.GLOBAL_ERROR,    
  new ActionError("error.orgTable.missing")); } else 
  {    int size = 
  orgTable.size();   
  orgForm.setTotal(size);if(size > 0) 
  {    int i = 1;    Iterator iterator = 
  orgTable.values().iterator();    Organization[] orgArray = 
  new Organization[size+1];    Organization anOrg = 
  null;    while(iterator.hasNext()) 
  {    
   anOrg = 
  (Organization)iterator.next(); 
  if( "Query".equals(mode) && 
  "Retrieve".equals(action)) { 
  if( 
  orgForm.matches(anOrg))  
    orgArray[i++] = 
  anOrg; 
  } else {    
      orgArray[i++] = 
  anOrg;}}
   
  So, for every record from otgArray, I want to compare city 
  of address of organization with
  city field from the form.
   
  In OrganizationForm.java I create method:
   
   
  public boolean matches( Organization org 
  ){
  System.out.println("FORM=" + this.organization 
  );System.out.println("COLL=" + org );
    if ( this.organization != null && 
  this.organization.getAddress() != null && 
     
  this.organization.getAddress().getCity() != null ) 
  {  String 
  cityFromForm = this.organization.getAddress().getCity();    
     if ( org != null && org.getAddress() != null 
  && org.getAddress().getCity() != null ) 
  { String 
  cityFromCollection = 
  org.getAddress().getCity(); 
  System.out.println("COMPARE " + cityFromCollection + " WITH " + cityFromForm 
  ); if( 
  cityFromCollection.equals( cityFromForm )) 
     return 
  true; else 
     return 
  false; 
  }   return 
  false;  
    }  return true;  // no 
  selection provided} 
   
  If I call this method I have error:
  javax.servlet.ServletException: Null property value for 
  'organization'
  at 
  org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459) 
  
  ...
  Root cause: java.lang.IllegalArgumentException: Null property value for 'organization'
	at org.apache.struts.util.PropertyUtils.getNestedProperty(PropertyUtils.java:347)If I comment out if statements from this method, I can see BOTH records: FORM=... and COLL=...  with proper atribute values. So WHY I CANNOT COMPARE THEM? Can anybody help me with what I do wrong? Thanks in advance, Jerzy Kalat 


Reset the form

2001-06-08 Thread Kiet Nguyen

I have my reset button defined:




Why is that the reset method doesn't get call and the Action class get
executed.

Anyone with an example?





Re: Question on the ActionForm design for dynamic data?

2001-06-08 Thread Ellen Lockhart
Title: Question on the ActionForm design for dynamic data?



I have scoured this list unsuccessfully for an 
answer, and this email seemed the best starting point so I am responding to it 
with the question I have:
 
From what I can tell, this only explains how 
to iterate over a collection to create a form with a dynamic number of 
rows.  What I cannot find an answer to is how does the ActionForm need to 
be set up to handle population with the input field values from those 
rows when this form is submitted?  Does it simply need a "public void 
setCustomerContacts(Vector customerContacts)"?  Will Struts then 
populate the Vector with CustomerContact objects?  Or does it need set() 
methods to accept Vectors of each individual column's values?
 
Thanks,
Ellen

  - Original Message - 
  From: 
  Jeff 
  Trent 
  To: [EMAIL PROTECTED] 
  Sent: Sunday, May 20, 2001 5:11 AM
  Subject: Re: Question on the ActionForm 
  design for dynamic data?
  
  (1) Have a Vector / Collection of contributors 
  (ie. getContributors()) belonging to your form.  Inside that function, 
  check to see if you need more rows by using code similar to the 
  following:
   
      public Vector 
  getCustomerContacts()    
  {    CustomerContact 
  lastCustomerContact = 
  (CustomerContact)this.customerContacts.lastElement();    
  if (!lastCustomerContact.isEmpty())        
                  
                  
      // is this slot being 
  used?    
  this.customerContacts.addElement(new CustomerContact());    
  // always have one available slot at the end of the 
  matrix    
  return this.customerContacts;    }
  (2) Do not use the reset() method.
   
  (3) On your JSP, use code like this:
      <% int i = 0; 
  %>       
                 
     <% i++; 
  %>    
  (4) Have a button on the form "Add more rows" in 
  which case the form posts to itself and will cause a new row to be added at 
  the bottom of the grid.
   
   
  Hope this help,
  Jeff
   
  
- Original Message - 
From: 
Joyce Tang 
To: [EMAIL PROTECTED] 

Sent: Saturday, May 19, 2001 11:28 
PM
Subject: Question on the ActionForm 
design for dynamic data?

Here is the situation. 
I am developing a system to maintain a 
contribution plan.  I need to input the plan information first and add 
unlimited number of contributors, specifying each share of the plan.  
So there will be a page with contribution plan information and a list of all 
the contributors.  The information you can edit on this page is the 
percentage of share of each contributor. Validation rules are: share need to 
add up to 100 and share figure is an integer between 0 and 100.   
Since the number of contributors is unknown in advance, how should I design 
the ActionForm?
Thanks a lot, 
Joyce 



reference input page from inside action?

2001-06-08 Thread Seth Ladd

Hello,

Is it possible to reference and forward to the input page of an action from
within the action?  It seems as if I have to make an explicit forward
mapping for input for each action.  Sometimes, I need to do extra state
checking inside action, and if that fails, to forward back to input.  The
explicit forward mapping is fine, but it would seem more simple if "input"
was a default mapping.

Any tips or pointers would be much appreciated!

Thanks,
Seth




FW: Reset the form

2001-06-08 Thread Kiet Nguyen

I'm able to define my reset button as follow, but how do I add the image to
this button.
The reset tag doesn't have src property.

thanks



-Original Message-
From: Kiet Nguyen 
Sent: Friday, June 08, 2001 10:08 AM
To: Struts-User (E-mail)
Subject: Reset the form


I have my reset button defined:




Why is that the reset method doesn't get call and the Action class get
executed.

Anyone with an example?




Re: reference input page from inside action?

2001-06-08 Thread Ted Husted

return (new ActionForward(mapping.getInput()));

Seth Ladd wrote:
> 
> Hello,
> 
> Is it possible to reference and forward to the input page of an action from
> within the action?  It seems as if I have to make an explicit forward
> mapping for input for each action.  Sometimes, I need to do extra state
> checking inside action, and if that fails, to forward back to input.  The
> explicit forward mapping is fine, but it would seem more simple if "input"
> was a default mapping.
> 
> Any tips or pointers would be much appreciated!
> 
> Thanks,
> Seth

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



RE: reference input page from inside action?

2001-06-08 Thread Seth Ladd


> return (new ActionForward(mapping.getInput()));

excellent, thank you very much!

Seth



RE: reference input page from inside action?

2001-06-08 Thread Steve Salkin
Title: RE: reference input page from inside action?





Ted,


How is that different from
mapping.findForward(mapping.getInput());


We are using mapping.findForward() in all cases (that a struts-config mapping exists).


> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 2:32 PM
> To: [EMAIL PROTECTED]
> Subject: Re: reference input page from inside action?
> 
> 
> return (new ActionForward(mapping.getInput()));
> 
> Seth Ladd wrote:
> > 
> > Hello,
> > 
> > Is it possible to reference and forward to the input page 
> of an action from
> > within the action?  It seems as if I have to make an 
> explicit forward
> > mapping for input for each action.  Sometimes, I need to do 
> extra state
> > checking inside action, and if that fails, to forward back 
> to input.  The
> > explicit forward mapping is fine, but it would seem more 
> simple if "input"
> > was a default mapping.
> > 
> > Any tips or pointers would be much appreciated!
> > 
> > Thanks,
> > Seth
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
> 





Re: reference input page from inside action?

2001-06-08 Thread Ted Husted

Does that work?

getInput() returns a path and findForward() expects a logical name.

input isn't an ActionForward, it's a property of the ActionMapping
itself (that can be used to construct an ActionForward).

Steve Salkin wrote:
> How is that different from
> mapping.findForward(mapping.getInput());
> 
> We are using mapping.findForward() in all cases (that a struts-config
> mapping exists).

 
> > return (new ActionForward(mapping.getInput()));

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



RE: displaying html errors in order

2001-06-08 Thread Mikkel Bruun

 Hi,

Believe or not, I just ran into this issue today...

Wouldn't it be nice is ActionErrors used an Ordered Collection

Mikkel

-Original Message-
From: Charlesworth, Chico
To: '[EMAIL PROTECTED]'
Sent: 08-06-2001 17:50
Subject: displaying html errors in order

i can display errors fine, but they are displayed not in the same order
as i
created them ...
 
I see this is because the ActionErrors class uses a HashMap and
therefore
doesn't return them in a given order (i think it sorts them according to
the
hashcode value).
 
I can use the property tag in html:errors tag to display each error
individually, but then it displays my error header and footer for each
error
displayed ...
 
As anyone thought of a nice hack so this doesn't happen?
cheers, chico
 

-- 
The content of this e-mail is confidential, may contain privileged
material
and is intended solely for the recipient(s) named above. If you receive
this
in error, please notify Software AG immediately and delete this e-mail.

Software AG (UK) Limited
Registered in England & Wales 1310740
Registered Office: Hudson House, Hudson Way,
Pride Park, Derby DE24 8HS



struts-config.xml question

2001-06-08 Thread Bill Clinton

Hello,
 I just am starting out with struts, and I have a question.  I 
started with this syntax in my test jsp:





and this in my struts-config.xml:



but I was getting this error:

javax.servlet.jsp.JspException: Must specify type attribute if name is 
specified

#

After searching this list's archives, I saw a reply to a similar 
question from Craig McClanahan that states:

 > If you specify name here, you must also specify type.
 >
 > If you change this to:
 >
 >  The tag will be smart enough
 > to figure out what form bean name you want, without
 > having to specify it both here and in struts-config.xml.
 >

so, to test, I specified the name in my jsp html:form tag so it looked 
like this:



and this worked.

#

But, I don't want to have to list the classnames in the JSPs, so I tried 
to follow craigs suggestion.  I changed the lines in the JSP to:

  

and tried this in my struts-config.xml:




   
 

but now I get this error:
javax.servlet.jsp.JspException: Cannot find ActionMappings or 
ActionFormBeans collection

I also searched on this error, but the messages I found did not seem to 
match my situation.

###

Since it works when I specify both the name and type in the html:form 
tag, I am starting to wonder if my struts-config.xml (in my WEB-INF dir) 
is being read.  Is it enough to put this file in the WEB-INF directory?

Also, when I had the name in my html:form tag and the type in the 
form-bean tag, it seemed obvious how these two things were linked (even 
thought this was not correct).

When I follow Craig's suggestion, I am unsure how "The tag will be smart 
enough to figure out what form bean name you want."  Does it use the JSP 
name to link to the "path" attribute of the action tag, and link the 
name attribute of the action tag to the name attribute of the form-bean tag?

Sorry about the length of this message, but I wanted to try to be as 
specific as possible about the problem.

Also, if anyone knows of any good documentation links, I am open to 
suggestions.  Other than the docs on the apache site, I have only found 
www.husted.com , which has lots of useful tips.  Any others out there?

Thanks, Bill




Re: Help with selecting an image to display.

2001-06-08 Thread Oleg V Alexeev

Hello Alex,

Friday, June 08, 2001, 4:17:37 PM, you wrote:

AC> Hi, I am looking for advice regarding the use of two images.

AC> Lets say you have a class status that has two boolean state properties
AC> isModify() and isNew(). If isModify() returns true then I want to display
AC> modify.gif and call the JavaScript function modify() and, if isNew() is true
AC> then I want to display new.gif and also call modify().

AC> Anyone have an example of this or could offer some advice?

Name your properties as getIsModify() and getIsNew() and after that
you can use such constructions as -


 display modify.gif


-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: displaying html errors in order

2001-06-08 Thread Oleg V Alexeev

Hello Chico,

Friday, June 08, 2001, 7:50:27 PM, you wrote:

CC> i can display errors fine, but they are displayed not in the same order as i
CC> created them ...
 
CC> I see this is because the ActionErrors class uses a HashMap and therefore
CC> doesn't return them in a given order (i think it sorts them according to the
CC> hashcode value).
 
CC> I can use the property tag in html:errors tag to display each error
CC> individually, but then it displays my error header and footer for each error
CC> displayed ...
 
You can write your own version of ActionErrors and use ArrayList in
it, for example, not HashMap. 

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: Reset the form

2001-06-08 Thread Oleg V Alexeev

Hello Kiet,

Friday, June 08, 2001, 9:08:07 PM, you wrote:

KN> I have my reset button defined:

KN> 
KN> >

KN> Why is that the reset method doesn't get call and the Action class get
KN> executed.

You can not call reset method by this way. It is called automatically
by ActionServlet after form submitting in browser and before filling
of ActionForm by values from request.
-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: html errors tag not displaying content

2001-06-08 Thread Oleg V Alexeev

Hello Chris,

To use this tag you must, of course add html taglib definition to the
page and add two strings to properties files with resources for
MessageResources container. Another words - you must add such strings
as

errors.header=
errors.footer=

to the properties package. It is described in web.xml in ActionServlet
definition section as "application" -


  application
  some.org.package.ApplicationResources



Friday, June 08, 2001, 7:08:05 PM, you wrote:

CW> hello,

CW> i just upgraded to struts beta 3.  i have an application that was
CW> working just fine using the struts errors tag.  after the upgrade, i no
CW> longer see any error messages.  on my jsp, i have a line:

CW> 

CW> that outputs no content...  however, the following line right below
CW> shows the proper error:

CW> <%=
CW> ((ActionError)((ActionErrors)request.getAttribute(Action.ERROR_KEY)).get
CW> ().next()).getValues()[0] %>

CW> so, i know the ActionErrors object is getting to the page and that it
CW> has my errors in it, but  is not showing them.

CW> any idea as to what might be going on?

CW> thanks for any help.

CW> cheers,
CW> chris

CW> | chris wilson || web dev ||| [EMAIL PROTECTED] || |
CW> www.wondergeek.com | | 




-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re[2]: Question on the ActionForm design for dynamic data?

2001-06-08 Thread Oleg V Alexeev

Hello Ellen,

You are speak about indexed properties. It can be defined by two ways

 1. One method for get and set operations
  public String[] getSomeProperty() {}

 2. Two methods
  public String getProperty( int index ) {}
  public void setProperty( int index, String value ) {}

  

Friday, June 08, 2001, 9:39:18 PM, you wrote:

EL> Question on the ActionForm design for dynamic data?I have scoured this list 
unsuccessfully for an answer, and this email seemed the best starting point so I am 
responding to it with the question
EL> I have:

>>From what I can tell, this only explains how to iterate over a collection to create 
>a form with a dynamic number of rows.  What I cannot find an answer to is how does 
>the ActionForm need to be set
>>up to handle population with the input field values from those rows when this form 
>is submitted?  Does it simply need a "public void setCustomerContacts(Vector 
>customerContacts)"?  Will Struts then
>>populate the Vector with CustomerContact objects?  Or does it need set() methods to 
>accept Vectors of each individual column's values?

EL> Thanks,
EL> Ellen
EL>   - Original Message - 
EL>   From: Jeff Trent 
EL>   To: [EMAIL PROTECTED] 
EL>   Sent: Sunday, May 20, 2001 5:11 AM
EL>   Subject: Re: Question on the ActionForm design for dynamic data?


EL>   (1) Have a Vector / Collection of contributors (ie. getContributors()) belonging 
to your form.  Inside that function, check to see if you need more rows by using code 
similar to the following:

EL>   public Vector getCustomerContacts()
EL>   {
EL>   CustomerContact lastCustomerContact = 
(CustomerContact)this.customerContacts.lastElement();
EL>   if (!lastCustomerContact.isEmpty())  
  // is this slot being used?
EL>   this.customerContacts.addElement(new CustomerContact());// 
always have one available slot at the end of the matrix
  
EL>   return this.customerContacts;
EL>   }

EL>   (2) Do not use the reset() method.

EL>   (3) On your JSP, use code like this:
EL>   <% int i = 0; %>
EL>   
EL>  
EL>   
EL>   
EL>   
EL>  
EL>  <% i++; %>
EL>   

EL>   (4) Have a button on the form "Add more rows" in which case the form posts to 
itself and will cause a new row to be added at the bottom of the grid.
   
   
EL>   Hope this help,
EL>   Jeff
   
EL> - Original Message - 
EL> From: Joyce Tang 
EL> To: [EMAIL PROTECTED] 
EL> Sent: Saturday, May 19, 2001 11:28 PM
EL> Subject: Question on the ActionForm design for dynamic data?


EL> Here is the situation. 

EL> I am developing a system to maintain a contribution plan.  I need to input the 
plan information first and add unlimited number of contributors, specifying each share 
of the plan.  So there
EL> will be a page with contribution plan information and a list of all the 
contributors.  The information you can edit on this page is the percentage of share of 
each contributor. Validation rules
EL> are: share need to add up to 100 and share figure is an integer between 0 and 100. 
  Since the number of contributors is unknown in advance, how should I design the 
ActionForm?

EL> Thanks a lot, 

EL> Joyce 




-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: reference input page from inside action?

2001-06-08 Thread Oleg V Alexeev

Hello Seth,

For example -


 return new ActionForward( mapping.getInput() );


if input attribute is defined for this action.

Friday, June 08, 2001, 9:50:25 PM, you wrote:

SL> Hello,

SL> Is it possible to reference and forward to the input page of an action from
SL> within the action?  It seems as if I have to make an explicit forward
SL> mapping for input for each action.  Sometimes, I need to do extra state
SL> checking inside action, and if that fails, to forward back to input.  The
SL> explicit forward mapping is fine, but it would seem more simple if "input"
SL> was a default mapping.

SL> Any tips or pointers would be much appreciated!

SL> Thanks,
SL> Seth



-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re[2]: Scratch RowSets

2001-06-08 Thread Oleg V Alexeev

Hello Ted,

Friday, June 08, 2001, 8:01:31 PM, you wrote:

TH> Oleg V Alexeev wrote:
>> TH> Though, if stay on this road, larger project swill have to start
>> TH> assembling their struts-config.xml from smaller files, as some
>> TH> people do with their Applicaton Resource now. ;-)
>> 
>> My first idea was to split struts-config to 'standart' part and
>> bean-factory part with my definirions. But it is needed to insert
>> references to bean templates into action tags and it was main reason
>> to build all in one.

TH> So long as we can still use a "package" format within struts-config,
TH> that shouldn't be a problem, since people could split them up for team
TH> development and concaternate them back again as part of the build.

TH> (By package format, I mean that we can repeat the  node
TH> and all it's children as many times as needed, and still create a single
TH> ActionMapping database. I do that now and can also include David's
TH>  nodes in the same file, so that all package's
TH> programtic settings are all together.)

So I can place several  sections to the config file and
all stuff will be parsed. Is it right? Are there any differences
between file with one big section and file with several sections in
case of whole content of such files is identical?

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re: struts-config.xml question

2001-06-08 Thread Ted Husted

In general, you shouldn't need to specify the form name or type in the
JSP at all. The form tag will lookup that up from the struts-config.xml,
according to where you are submitting the form (action path = action
path).







  

should be all you need.

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


Bill Clinton wrote:
> 
> Hello,
>  I just am starting out with struts, and I have a question.  I
> started with this syntax in my test jsp:
> 
> 
> 
> 
> 
> and this in my struts-config.xml:
> 
>  type="com.companyname.actionform.QuestionForm"/>
> 
> but I was getting this error:
> 
> javax.servlet.jsp.JspException: Must specify type attribute if name is
> specified
> 
> #
> 
> After searching this list's archives, I saw a reply to a similar
> question from Craig McClanahan that states:
> 
>  > If you specify name here, you must also specify type.
>  >
>  > If you change this to:
>  >
>  >  The tag will be smart enough
>  > to figure out what form bean name you want, without
>  > having to specify it both here and in struts-config.xml.
>  >
> 
> so, to test, I specified the name in my jsp html:form tag so it looked
> like this:
> 
>  type="com.companyname.actionform.QuestionForm" action="insertQuestion">
> 
> and this worked.
> 
> #
> 
> But, I don't want to have to list the classnames in the JSPs, so I tried
> to follow craigs suggestion.  I changed the lines in the JSP to:
> 
>   
> 
> and tried this in my struts-config.xml:
> 
>  type="com.companyname.actionform.QuestionForm"/>
> 
>  type="com.companyname.actionmap.InsertQuestionAction"
> name="questionForm"
>scope="request"
> validate="false">
>
>  
> 
> but now I get this error:
> javax.servlet.jsp.JspException: Cannot find ActionMappings or
> ActionFormBeans collection
> 
> I also searched on this error, but the messages I found did not seem to
> match my situation.
> 
> ###
> 
> Since it works when I specify both the name and type in the html:form
> tag, I am starting to wonder if my struts-config.xml (in my WEB-INF dir)
> is being read.  Is it enough to put this file in the WEB-INF directory?
> 
> Also, when I had the name in my html:form tag and the type in the
> form-bean tag, it seemed obvious how these two things were linked (even
> thought this was not correct).
> 
> When I follow Craig's suggestion, I am unsure how "The tag will be smart
> enough to figure out what form bean name you want."  Does it use the JSP
> name to link to the "path" attribute of the action tag, and link the
> name attribute of the action tag to the name attribute of the form-bean tag?
> 
> Sorry about the length of this message, but I wanted to try to be as
> specific as possible about the problem.
> 
> Also, if anyone knows of any good documentation links, I am open to
> suggestions.  Other than the docs on the apache site, I have only found
> www.husted.com , which has lots of useful tips.  Any others out there?
> 
> Thanks, Bill



Re: struts-config.xml question

2001-06-08 Thread Oleg V Alexeev

Hello Bill,

Try to use

 
 
 

not
 
 
 
 

and restart servlet container (Tomcat, Resin, etc.) after
strut-config.xml changing (or call http://host:port/path/admin/reload)

Friday, June 08, 2001, 11:43:06 PM, you wrote:

BC> Hello,
BC>  I just am starting out with struts, and I have a question.  I 
BC> started with this syntax in my test jsp:

BC> 
BC> 
BC> 

BC> and this in my struts-config.xml:

BC>  type="com.companyname.actionform.QuestionForm"/>

BC> but I was getting this error:

BC> javax.servlet.jsp.JspException: Must specify type attribute if name is 
BC> specified

BC> #

BC> After searching this list's archives, I saw a reply to a similar 
BC> question from Craig McClanahan that states:

BC>  > If you specify name here, you must also specify type.
BC>  >
BC>  > If you change this to:
BC>  >
BC>  >  The tag will be smart enough
BC>  > to figure out what form bean name you want, without
BC>  > having to specify it both here and in struts-config.xml.
BC>  >

BC> so, to test, I specified the name in my jsp html:form tag so it looked 
BC> like this:

BC>  type="com.companyname.actionform.QuestionForm" action="insertQuestion">

BC> and this worked.

BC> #

BC> But, I don't want to have to list the classnames in the JSPs, so I tried 
BC> to follow craigs suggestion.  I changed the lines in the JSP to:

BC>   

BC> and tried this in my struts-config.xml:

BC>  type="com.companyname.actionform.QuestionForm"/>

BC>  type="com.companyname.actionmap.InsertQuestionAction"
BC> name="questionForm"
BC>scope="request"
BC> validate="false">
BC>
BC>  

BC> but now I get this error:
BC> javax.servlet.jsp.JspException: Cannot find ActionMappings or 
BC> ActionFormBeans collection

BC> I also searched on this error, but the messages I found did not seem to 
BC> match my situation.

BC> ###

BC> Since it works when I specify both the name and type in the html:form 
BC> tag, I am starting to wonder if my struts-config.xml (in my WEB-INF dir) 
BC> is being read.  Is it enough to put this file in the WEB-INF directory?

BC> Also, when I had the name in my html:form tag and the type in the 
BC> form-bean tag, it seemed obvious how these two things were linked (even 
BC> thought this was not correct).

BC> When I follow Craig's suggestion, I am unsure how "The tag will be smart 
BC> enough to figure out what form bean name you want."  Does it use the JSP 
BC> name to link to the "path" attribute of the action tag, and link the 
BC> name attribute of the action tag to the name attribute of the form-bean tag?

BC> Sorry about the length of this message, but I wanted to try to be as 
BC> specific as possible about the problem.

BC> Also, if anyone knows of any good documentation links, I am open to 
BC> suggestions.  Other than the docs on the apache site, I have only found 
BC> www.husted.com , which has lots of useful tips.  Any others out there?

BC> Thanks, Bill



-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





RE: struts-config.xml question

2001-06-08 Thread Allamsetty, Venkata

you need not have the name attribute in the html:form tag. It can get it
from the struts_config file. Do you have setters and getters for all your
attributes in the actionform?

hope that helps.

VA

-Original Message-
From: Bill Clinton [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 3:43 PM
To: [EMAIL PROTECTED]
Subject: struts-config.xml question


Hello,
 I just am starting out with struts, and I have a question.  I 
started with this syntax in my test jsp:





and this in my struts-config.xml:



but I was getting this error:

javax.servlet.jsp.JspException: Must specify type attribute if name is 
specified

#

After searching this list's archives, I saw a reply to a similar 
question from Craig McClanahan that states:

 > If you specify name here, you must also specify type.
 >
 > If you change this to:
 >
 >  The tag will be smart enough
 > to figure out what form bean name you want, without
 > having to specify it both here and in struts-config.xml.
 >

so, to test, I specified the name in my jsp html:form tag so it looked 
like this:



and this worked.

#

But, I don't want to have to list the classnames in the JSPs, so I tried 
to follow craigs suggestion.  I changed the lines in the JSP to:

  

and tried this in my struts-config.xml:




   
 

but now I get this error:
javax.servlet.jsp.JspException: Cannot find ActionMappings or 
ActionFormBeans collection

I also searched on this error, but the messages I found did not seem to 
match my situation.

###

Since it works when I specify both the name and type in the html:form 
tag, I am starting to wonder if my struts-config.xml (in my WEB-INF dir) 
is being read.  Is it enough to put this file in the WEB-INF directory?

Also, when I had the name in my html:form tag and the type in the 
form-bean tag, it seemed obvious how these two things were linked (even 
thought this was not correct).

When I follow Craig's suggestion, I am unsure how "The tag will be smart 
enough to figure out what form bean name you want."  Does it use the JSP 
name to link to the "path" attribute of the action tag, and link the 
name attribute of the action tag to the name attribute of the form-bean tag?

Sorry about the length of this message, but I wanted to try to be as 
specific as possible about the problem.

Also, if anyone knows of any good documentation links, I am open to 
suggestions.  Other than the docs on the apache site, I have only found 
www.husted.com , which has lots of useful tips.  Any others out there?

Thanks, Bill



Re: Scratch RowSets

2001-06-08 Thread Ted Husted

Oleg V Alexeev wrote:
> So I can place several  sections to the config file and
> all stuff will be parsed. Is it right? 

Yes.

Are there any differences
> between file with one big section and file with several sections in
> case of whole content of such files is identical?

A configuration file using the package format will be longer, but they
are functionally equivalent. 

I'm also doing things like 

/account/Form.java 
/account/Insert.java

rather than

/accountForm.java
/accountInsert.java

so that the application is divided into coherent sub-packages. 

So it then becomes natural for me to arrange the configuration files
that way. 

And as mentioned I can also interlace David's Validator nodes in there
too. 

-T.



Problem With Struts and Tomcat

2001-06-08 Thread Thomas L Richards

Ok, I've got a bit of a headache and here's the cause:

I'm using Visual Age for Java 3.5.2, with Tomcat 3.1. That works fine.
I installed Struts 1.0-b3 with Xerces 1.4.0.
Then I installed the struts-example.war file. That installed fine too
(Tomcat took care of it).
However, where my headache seems to be occurring is when I try to access a
struts driven application.
I have tried several of the "sample" apps, but every time I get this error:

Root cause:

java.lang.IllegalArgumentException: cant remove Attributes from request
scope
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.IllegalArgumentException(java.lang.String)
void
org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String,
int)
int org.apache.struts.taglib.html.FormTag.doEndTag()
void _0002fregistration_0002ejspregistration_jsp_0.
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, boolean)
void
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
void
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.RequestDispatcherImpl.forward(javax.servlet.ServletRequest,

javax.servlet.ServletResponse)
void
org.apache.struts.action.ActionServlet.processActionForward(org.apache.struts.action.ActionForward,

org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection,

java.lang.Object [])
void org.apache.tomcat.service.TcpConnectionThread.run()
void java.lang.Thread.run()

This was generated with the "Register with the MailReader Demonstration
Application " that came with the struts-example.war file (out of the box).

However, I received this exact same type of error with a different example
(that didn't come from the Jakarta project). This leads me to believe
that there's some sort of incompatibility or config problem going on. If
anyone has any idea about this, or has seen this before, please enlighten
me.

Thanks!

-Tom




RE: Problem With Struts and Tomcat

2001-06-08 Thread Kyle Robinson

I would highly recommend upgrading your Tomcat to 3.2.2.  This may solve
your problem.

-Original Message-
From: Thomas L Richards [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 13:49
To: [EMAIL PROTECTED]
Subject: Problem With Struts and Tomcat


Ok, I've got a bit of a headache and here's the cause:

I'm using Visual Age for Java 3.5.2, with Tomcat 3.1. That works fine.
I installed Struts 1.0-b3 with Xerces 1.4.0.
Then I installed the struts-example.war file. That installed fine too
(Tomcat took care of it).
However, where my headache seems to be occurring is when I try to access a
struts driven application.
I have tried several of the "sample" apps, but every time I get this error:

Root cause:

java.lang.IllegalArgumentException: cant remove Attributes from request
scope
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.IllegalArgumentException(java.lang.String)
void
org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String,
int)
int org.apache.struts.taglib.html.FormTag.doEndTag()
void _0002fregistration_0002ejspregistration_jsp_0.
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServlet
Request,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet
.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, boolean)
void
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpS
ervletRequest,

javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
void
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletR
equest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.R
equest,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.RequestDispatcherImpl.forward(javax.servlet.ServletRe
quest,

javax.servlet.ServletResponse)
void
org.apache.struts.action.ActionServlet.processActionForward(org.apache.strut
s.action.ActionForward,

org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServle
tRequest,

javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletR
equest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest
,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.R
equest,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request
,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.a
pache.tomcat.service.TcpConnection,

java.lang.Object [])
void org.apache.tomcat.service.TcpConnectionThread.run()
void java.lang.Thread.run()

This was generated with the "Register with the MailReader Demonstration
Application " that came with the struts-example.war file (out of the box).

However, I received this exact same type of error with a different example
(that didn't come from the Jakarta project). This leads me to believe
that there's some sort of incompatibility or config problem going on. If
anyone has any idea about this, or has seen this before, please enlighten
me.

Thanks!

-Tom



Re: Scratch RowSets

2001-06-08 Thread Ted Husted

Just as an aside, Oleg:

When I use RowSets as value object beans, the type is determined by the
JDBC metadata. I've been putting some wrappers around that so the
properties have ordinary getters and setters. 

I see that BeanFactory includes code to create tables, but what about
reading tables to create beans?

Oleg V Alexeev wrote:
> 
> Hello Ted,
> 
> Thank for good stub. Now I am trying to implement such approach in my
> extension to struts - BeanFactoryServlet.



Concepts in working with multipart request

2001-06-08 Thread Jonathan



Hello all.
I wanted to know if I am able to use the 
MultipartRequestWrapper object by itself.  
That is, can I store MultipartRequestWrapper 
objects in a bean.
My purpose is to temporarily store a binary 
and its file name in a bean until the final form page when the user submits the 
whole "kit and kaboodle".
 
Part of the problem is that I dont understand what 
is going on. It looks like the request keeps the following:
"name" property representing the form field 
name
"value" property representing the String path 
of the file you uploaded
some binary Stream data representing the 
file
 
I realy have no idea, and I am looking around for 
answers but am coming up empty.
Can someone sum up what is happening here, what the 
request contains, what values the request works with, and what are the 
requirements.
 
Thanks sincerely,
Jonathan


RE: reference input page from inside action?

2001-06-08 Thread Steve Salkin
Title: RE: reference input page from inside action?





Ted Husted wrote:


> Does that work?


No.


> getInput() returns a path and findForward() expects a logical name.


Yes.
 
> input isn't an ActionForward, it's a property of the ActionMapping
> itself (that can be used to construct an ActionForward).


Once again I find my fingers are faster then my brain. :) We are not in fact doing what I said we are doing, and thus the application actually works. :)

S-
 
> Steve Salkin wrote:
> > How is that different from
> > mapping.findForward(mapping.getInput());
> > 
> > We are using mapping.findForward() in all cases (that a 
> struts-config
> > mapping exists).
> 
>  
> > > return (new ActionForward(mapping.getInput()));
> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel 716 737-3463.
> -- http://www.husted.com/about/struts/
> 





RE: Struts Beta 03 Build Problem

2001-06-08 Thread McLure, David

I did build Ant on one of my two Linux installations (which was fun because
I had to pgp decrypt the source tars first), but the other one together with
my NT 4.0 install both have binary downloads of Ant1.3 running.  I just
tried building Ant on my NT installation and I still get the same problem.

I also started copying some jars into the ant lib optional directory, but
there are quite a few listed in the Library Dependencies section.  Does
anyone know where this TraXLiason class lives?

Thanks,

David McLure

>From: "Deadman, Hal" <[EMAIL PROTECTED]>
>Subject: RE: Struts Beta 03 Build Problem
>Message-ID: <001b01c0f030$0052b290$e7d9cac6@bdshdeadman>
>
>Did you get the ant binary distribution or did you build ant yourself?
>Building ant yourself may get you a version of ant that supports fewer
tasks
>depending on what is in your classpath when you build it. Certain classes
>such as org.apache.tools.ant.taskdefs.optional.TraXLiason don't get built
>unless certain things are found in your classpath when ant is built.
>
>If you have the pre-built ant distribution, make sure the optional ant jar
>files are in your classpath. PostgresSQL probably doesn't use the ant style
>task which uses org.apache.tools.ant.taskdefs.optional.TraXLiason.





Re: Problem With Struts and Tomcat

2001-06-08 Thread ricksmth

I ran into that running Tomcat 3.1. You need to be running Tomcat
3.2.x. It's a difference in the servlet specification. 

Rick 
[EMAIL PROTECTED] wrote:
> Ok, I've got a bit of a headache and here's the cause:

I'm using Visual Age for Java 3.5.2, with Tomcat 3.1. That works fine.
I installed Struts 1.0-b3 with Xerces 1.4.0.
Then I installed the struts-example.war file. That installed fine too
(Tomcat took care of it).
However, where my headache seems to be occurring is when I try to access a
struts driven application.
I have tried several of the "sample" apps, but every time I get this
error:

Root cause:

java.lang.IllegalArgumentException: cant remove Attributes from request
scope
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.IllegalArgumentException(java.lang.String)
void
org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String,
int)
int org.apache.struts.taglib.html.FormTag.doEndTag()
void _0002fregistration_0002ejspregistration_jsp_0.
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, boolean)
void
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
void
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.RequestDispatcherImpl.forward(javax.servlet.ServletRequest,

javax.servlet.ServletResponse)
void
org.apache.struts.action.ActionServlet.processActionForward(org.apache.struts.action.ActionForward,

org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest,

javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request,

org.apache.tomcat.core.Response)
void
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection,

java.lang.Object [])
void org.apache.tomcat.service.TcpConnectionThread.run()
void java.lang.Thread.run()

This was generated with the "Register with the MailReader Demonstration
Application " that came with the struts-example.war file (out of the box).

However, I received this exact same type of error with a different example
(that didn't come from the Jakarta project). This leads me to believe
that there's some sort of incompatibility or config problem going on. If
anyone has any idea about this, or has seen this before, please enlighten
me.

Thanks!

-Tom





Re: Problem With Struts and Tomcat

2001-06-08 Thread Thomas L Richards

I was afraid it was something like that.

I'm downloading Tomcat 3.2.1 now (can't get 3.2.2 for VAJ yet).
Unfortunately, as it turns out, I need to upgrade VAJ to 3.5.3 since Tomcat
3.2.X won't work with VAJ 3.5.2. Go figure.

Anyway, thanks for the info everyone!

-Tom


   
  
ricksmth@minds 
  
pring.comTo: [EMAIL PROTECTED]
  
 cc:   
  
06/08/2001   Subject: Re: Problem With Struts and 
Tomcat 
04:18 PM   
  
Please respond 
  
to struts-user 
  
   
  
   
  



I ran into that running Tomcat 3.1. You need to be running Tomcat
3.2.x. It's a difference in the servlet specification.

Rick
[EMAIL PROTECTED] wrote:
> Ok, I've got a bit of a headache and here's the cause:

I'm using Visual Age for Java 3.5.2, with Tomcat 3.1. That works fine.
I installed Struts 1.0-b3 with Xerces 1.4.0.
Then I installed the struts-example.war file. That installed fine too
(Tomcat took care of it).
However, where my headache seems to be occurring is when I try to access a
struts driven application.
I have tried several of the "sample" apps, but every time I get this
error:

Root cause:

java.lang.IllegalArgumentException: cant remove Attributes from request
scope
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
java.lang.RuntimeException(java.lang.String)
java.lang.IllegalArgumentException(java.lang.String)
void
org.apache.jasper.runtime.PageContextImpl.removeAttribute(java.lang.String,
int)
int org.apache.struts.taglib.html.FormTag.doEndTag()
void _0002fregistration_0002ejspregistration_jsp_0.
_jspService(javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.jasper.runtime.HttpJspBase.service(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse, boolean)
void
org.apache.jasper.runtime.JspServlet.serviceJspFile(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean)
void
org.apache.jasper.runtime.JspServlet.service(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,


org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.RequestDispatcherImpl.forward(javax.servlet.ServletRequest,


javax.servlet.ServletResponse)
void
org.apache.struts.action.ActionServlet.processActionForward(org.apache.struts.action.ActionForward,


org.apache.struts.action.ActionMapping,
org.apache.struts.action.ActionForm,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.process(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse)
void
org.apache.struts.action.ActionServlet.doGet(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest,


javax.servlet.http.HttpServletResponse)
void
javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
void
org.apache.tomcat.core.ServletWrapper.handleRequest(org.apache.tomcat.core.Request,


org.apache.tomcat.core.Response)
void
org.apache.tomcat.core.ContextManager.service(org.apache.tomcat.core.Request,


org.apache.tomcat.core.Response)
void
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(org.apache.tomcat.service.TcpConnection,


java.lang.Object [])
void

app server authentication - frames

2001-06-08 Thread Gogineni, Pratima

Hi,
I have a question I hoping some one might have some ideas on how to
accomplish this ...
I am using the appsever based authentication - so I have a html page that
login.html. 
now my welcome page is a frame that has two jsp pages in it. unfortunately
when I logon I see the login page in both the frames.

The only way I can think of around this is to have a hidden jsp page as a
welcome page so that this page just redirects to the frames based page if
you are logged on else to the logon page... Does anyone know of any other
way around this?

thanks
pratima

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 1:55 PM
To: [EMAIL PROTECTED]
Subject: Re: Scratch RowSets


Just as an aside, Oleg:

When I use RowSets as value object beans, the type is determined by the
JDBC metadata. I've been putting some wrappers around that so the
properties have ordinary getters and setters. 

I see that BeanFactory includes code to create tables, but what about
reading tables to create beans?

Oleg V Alexeev wrote:
> 
> Hello Ted,
> 
> Thank for good stub. Now I am trying to implement such approach in my
> extension to struts - BeanFactoryServlet.



RE: Javascript Validation

2001-06-08 Thread SWiecek


When I try to run this, I get this error:

/registration.jsp(-1): Error in tag library at: 'html': The Tag class
'org.apache.struts.taglib.html.ButtonTag' has no setter method
corresponding to TLD declared attribute 'styleid', (JSP 1.1 spec, 5.4.1)
probably occurred due to an error in /registration.jsp line -1:

Any clues?

Thanks



   
 
David  
 
Winterfeldt   To: [EMAIL PROTECTED]   
 
Subject: RE: Javascript Validation   
 
   
 
06/08/2001 
 
09:55 AM   
 
Please respond 
 
to struts-user 
 
   
 
   
 




Don't forget that any client validations you do using JavaScript should be
duplicated on the server side because there is no guarantee the JavaScipt
will run.  The client have have it turned off or the script could fail
depending on the browser.  I have started work on a validation framework
that works in Struts and let's you sync up your server side validation with
your client side validation if you want to look at it.


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


David


  "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]> wrote:
 i just find it sometimes easier to move all validation off the jsp, and
 hence all java off the jsp. I think its just basically a personal
 preference. This way I'm making full use of the struts error handling
 model
 and keep all my java in one place. There always seems to be more than one
 way to do things, just depends on what u need to do and whats your
 preference
 Thanx for all the help guys

 -Original Message-
 From: Eelco van Kuik [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 08, 2001 11:32 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: Javascript Validation


 I don't understand why Dudley thought it was necessary to send java code,
 but I think what you need you can find at:

 http://javascript.internet.com/forms/

 I don't have internet from this place, but know there are many javascript
 examples there.

 Regards,

 Eelco



 -Original Message-
 From: Satish Khanzode [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 08, 2001 7:42 AM
 To: [EMAIL PROTECTED]
 Subject: Javascript Validation


 Hi
 Has anyone used client-side validations (using Javascript) in jsp pages
 created Struts ? Pls help.
 Thanks,
 Satish Khanzode



Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo!
Mail.










RE: app server authentication - frames

2001-06-08 Thread Abraham Kang


Hi Pratima,

Can you switch to basic authentication?

Another alternative is to change the top frame's location with
JavaScript in the logon page.

--Abraham

> -Original Message-
> From: Gogineni, Pratima [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 3:45 PM
> To: '[EMAIL PROTECTED]'
> Subject: app server authentication - frames
>
>
> Hi,
> I have a question I hoping some one might have some ideas on how to
> accomplish this ...
> I am using the appsever based authentication - so I have a html page that
> login.html.
> now my welcome page is a frame that has two jsp pages in it. unfortunately
> when I logon I see the login page in both the frames.
>
> The only way I can think of around this is to have a hidden jsp page as a
> welcome page so that this page just redirects to the frames based page if
> you are logged on else to the logon page... Does anyone know of any other
> way around this?
>
> thanks
> pratima
>
> -Original Message-
> From: Ted Husted [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 1:55 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Scratch RowSets
>
>
> Just as an aside, Oleg:
>
> When I use RowSets as value object beans, the type is determined by the
> JDBC metadata. I've been putting some wrappers around that so the
> properties have ordinary getters and setters.
>
> I see that BeanFactory includes code to create tables, but what about
> reading tables to create beans?
>
> Oleg V Alexeev wrote:
> >
> > Hello Ted,
> >
> > Thank for good stub. Now I am trying to implement such approach in my
> > extension to struts - BeanFactoryServlet.
>




RE: Javascript Validation

2001-06-08 Thread Abraham Kang

Try a recent nightly build.

--Abraham

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 08, 2001 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Javascript Validation
>
>
>
> When I try to run this, I get this error:
>
> /registration.jsp(-1): Error in tag library at: 'html': The Tag class
> 'org.apache.struts.taglib.html.ButtonTag' has no setter method
> corresponding to TLD declared attribute 'styleid', (JSP 1.1 spec, 5.4.1)
> probably occurred due to an error in /registration.jsp line -1:
>
> Any clues?
>
> Thanks
>
>
>
>
>
> David
>
> Winterfeldt   To:
> [EMAIL PROTECTED]
> 
> yahoo.com>Subject: RE:
> Javascript Validation
>
>
> 06/08/2001
>
> 09:55 AM
>
> Please respond
>
> to struts-user
>
>
>
>
>
>
>
>
>
> Don't forget that any client validations you do using JavaScript should be
> duplicated on the server side because there is no guarantee the JavaScipt
> will run.  The client have have it turned off or the script could fail
> depending on the browser.  I have started work on a validation framework
> that works in Struts and let's you sync up your server side
> validation with
> your client side validation if you want to look at it.
>
>
> http://home.earthlink.net/~dwinterfeldt
>
>
> David
>
>
>   "Dudley Butt@i-Commerce" <[EMAIL PROTECTED]> wrote:
>  i just find it sometimes easier to move all validation off the jsp, and
>  hence all java off the jsp. I think its just basically a personal
>  preference. This way I'm making full use of the struts error handling
>  model
>  and keep all my java in one place. There always seems to be more than one
>  way to do things, just depends on what u need to do and whats your
>  preference
>  Thanx for all the help guys
>
>  -Original Message-
>  From: Eelco van Kuik [mailto:[EMAIL PROTECTED]]
>  Sent: Friday, June 08, 2001 11:32 AM
>  To: '[EMAIL PROTECTED]'
>  Subject: RE: Javascript Validation
>
>
>  I don't understand why Dudley thought it was necessary to send java code,
>  but I think what you need you can find at:
>
 http://javascript.internet.com/forms/

 I don't have internet from this place, but know there are many javascript
 examples there.

 Regards,

 Eelco



 -Original Message-
 From: Satish Khanzode [mailto:[EMAIL PROTECTED]]
 Sent: Friday, June 08, 2001 7:42 AM
 To: [EMAIL PROTECTED]
 Subject: Javascript Validation


 Hi
 Has anyone used client-side validations (using Javascript) in jsp pages
 created Struts ? Pls help.
 Thanks,
 Satish Khanzode



Do You Yahoo!?
Yahoo! Mail Personal Address - Get email at your own domain with Yahoo!
Mail.











Re: ActionForm/Action with edit mode

2001-06-08 Thread Ted Husted

"Hogan, John" wrote:
> Joe, Ted,
> Your proposed solutions worked well.  Thanks.

Here's a simple trick for returning a blank ActionForm for new
data-entry. 

Define a generic "Input" action, that does nothing but 

return (new ActionForward(mapping.getInput()));

Then whenever you need to get a blank ActionForm, of any type, just
create a mapping to the generic Action, specifying a different input
property: 




Or, 




This way you don't have to check for an add request for each form type. 

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



Re: struts-config.xml question

2001-06-08 Thread Ted Husted

Now that you mention it, the FAQ-o-Matic is up again. 

<
http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayTopics/action/SetAll/project_id/2/faq_id/36
>

Bill Clinton wrote:
> Also, if anyone knows of any good documentation links, I am open to
> suggestions.  Other than the docs on the apache site, I have only found
> www.husted.com , which has lots of useful tips.  Any others out there?

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



cann't work

2001-06-08 Thread zhongqing



HI 
    I have a problem in using 
struts.The details are as follow:
 
    The Web Server is WebLogic5.1.
    and the configure info in the 
web.xml is:
       
    
action  
    
action  org.apache.struts.action.ActionServlet  
       
        
debug    
        
   2  
      
       
        
config    
        
   /WEB-INF/struts-config.xml    
      
      
      
 application    
        
   com.ncs.iwa.ApplicationResources   
       
        
detail   
        
2    
      
      
     
  validate    
       
true    
    
    
  2 
 
    and in the web-info folder there 
are:
        
    lib\struts.jar
        
    struts-config.xml
 
    The problem is :
        when I input 
the  http://localhost:port/myapp/login.do
 
        The server 
told me the login.do cann't be found .
 
    why?


RE: Javascript Validation

2001-06-08 Thread David Winterfeldt

Try putting the 1.0 beta 3 of Struts into the webapp
replacing the jar and the tlds.  I test on Tomcat 3.2
and 4.0, but some other application servers do more
rigorous checking of the tld to the class and if they
don't match it generates an error.

David

--- Abraham Kang <[EMAIL PROTECTED]> wrote:
> Try a recent nightly build.
> 
> --Abraham
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 08, 2001 3:52 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Javascript Validation
> >
> >
> >
> > When I try to run this, I get this error:
> >
> > /registration.jsp(-1): Error in tag library at:
> 'html': The Tag class
> > 'org.apache.struts.taglib.html.ButtonTag' has no
> setter method
> > corresponding to TLD declared attribute 'styleid',
> (JSP 1.1 spec, 5.4.1)
> > probably occurred due to an error in
> /registration.jsp line -1:
> >
> > Any clues?
> >
> > Thanks
> >
> >
> >
> >
> >
> > David
> >
> > Winterfeldt   To:
> > [EMAIL PROTECTED]
> >  >
> > yahoo.com>Subject:
> RE:
> > Javascript Validation
> >
> >
> > 06/08/2001
> >
> > 09:55 AM
> >
> > Please respond
> >
> > to struts-user
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > Don't forget that any client validations you do
> using JavaScript should be
> > duplicated on the server side because there is no
> guarantee the JavaScipt
> > will run.  The client have have it turned off or
> the script could fail
> > depending on the browser.  I have started work on
> a validation framework
> > that works in Struts and let's you sync up your
> server side
> > validation with
> > your client side validation if you want to look at
> it.
> >
> >
> > http://home.earthlink.net/~dwinterfeldt
> >
> >
> > David
> >
> >
> >   "Dudley Butt@i-Commerce"
> <[EMAIL PROTECTED]> wrote:
> >  i just find it sometimes easier to move all
> validation off the jsp, and
> >  hence all java off the jsp. I think its just
> basically a personal
> >  preference. This way I'm making full use of the
> struts error handling
> >  model
> >  and keep all my java in one place. There always
> seems to be more than one
> >  way to do things, just depends on what u need to
> do and whats your
> >  preference
> >  Thanx for all the help guys
> >
> >  -Original Message-
> >  From: Eelco van Kuik [mailto:[EMAIL PROTECTED]]
> >  Sent: Friday, June 08, 2001 11:32 AM
> >  To: '[EMAIL PROTECTED]'
> >  Subject: RE: Javascript Validation
> >
> >
> >  I don't understand why Dudley thought it was
> necessary to send java code,
> >  but I think what you need you can find at:
> >
>  http://javascript.internet.com/forms/
> 
>  I don't have internet from this place, but know
> there are many javascript
>  examples there.
> 
>  Regards,
> 
>  Eelco
> 
> 
> 
>  -Original Message-
>  From: Satish Khanzode
> [mailto:[EMAIL PROTECTED]]
>  Sent: Friday, June 08, 2001 7:42 AM
>  To: [EMAIL PROTECTED]
>  Subject: Javascript Validation
> 
> 
>  Hi
>  Has anyone used client-side validations (using
> Javascript) in jsp pages
>  created Struts ? Pls help.
>  Thanks,
>  Satish Khanzode
> 
> 
> 
> Do You Yahoo!?
> Yahoo! Mail Personal Address - Get email at your own
> domain with Yahoo!
> Mail.
> 
> 
> 
> 
> 
> 
> 
> 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



"Java Server Faces"

2001-06-08 Thread Ian Kallen <[EMAIL PROTECTED]>


At JavaOne today, it seemed to be suggested that j2ee would have a MVC
framework join the recommendations.  Later in the talk ("scalibility in the web
tier with jsp blah blah" ridiculously long title), it struts was alluded to as
being part of j2ee in the future.  So is struts the ever mysterious "Java Server
Faces"?

cheers,
-Ian

--
Ian Kallen <[EMAIL PROTECTED]> | AIM: iankallen




Re[2]: Scratch RowSets

2001-06-08 Thread Oleg V Alexeev

Hello Ted,

Saturday, June 09, 2001, 12:55:04 AM, you wrote:

TH> Just as an aside, Oleg:

TH> When I use RowSets as value object beans, the type is determined by the
TH> JDBC metadata. I've been putting some wrappers around that so the
TH> properties have ordinary getters and setters. 

TH> I see that BeanFactory includes code to create tables, but what about
TH> reading tables to create beans?

Some confusion... There are SQL scripts to create sample database -
are you talk about it? If yes then my answer is below.

Each factory must implement create method to generate bean.
There are abstract class org.apache.struts.factory.jdbc.JDBCFactory -
base class for all jdbc related factories. Its create method uses
first parameter from bean template as SQL query to create
PreparedStatement and call method processResult( ResultSet...). This
method is abstract and every derived class must implement it and
JDBCArrayFactory, for example, walk throw result set and for each row
create bean of target type and call populateFrom( ResultSet ) for
every bean - this method do all work to fill new bean with values from
current row.

-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





Re[2]: Scratch RowSets

2001-06-08 Thread Oleg V Alexeev

Hello Ted,

Good idea. Thank you.

Saturday, June 09, 2001, 12:38:37 AM, you wrote:

TH> Oleg V Alexeev wrote:
>> So I can place several  sections to the config file and
>> all stuff will be parsed. Is it right? 

TH> Yes.

TH> Are there any differences
>> between file with one big section and file with several sections in
>> case of whole content of such files is identical?

TH> A configuration file using the package format will be longer, but they
TH> are functionally equivalent. 


-- 
Best regards,
 Olegmailto:[EMAIL PROTECTED]





How to use struts in the weblogic5.1

2001-06-08 Thread zhongqing



can somebody share some experiences in using struts 
in the weblogic5.1?