RE: logic:Iterate question

2001-09-24 Thread Alexander Jesse

Hi,
 
try:
 
 logic:iterate id=facility scope=session name=surveyForm 
property=generalFacilityList
  table
tr
td
  bean:write name=facility property=code/
/td
td
  bean:write name=facility property=description/
/td
td
  html:checkbox name=facility property=state/
/td
td
  bean:write name=facility property=state/
/td
/tr
  /table
/logic:iterate
 
that is pure html...
 
hope this helps
Alexander Jesse 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 1:02 AM
To: [EMAIL PROTECTED]
Subject: logic:Iterate question


Hi all,
 
I am using the iterate tag to iterate over a collection of items stored in the 
FormBean. And all work fine (so far :) ). My question is: A I have a large number of 
items in the collection is it possible arrange them in columns?? Here is a code 
snippet:
 
 logic:iterate id=facility scope=session name=surveyForm 
property=generalFacilityList
  table
tr
  bean:write name=facility property=code/
  bean:write name=facility property=description/
  html:checkbox name=facility property=state/
  bean:write name=facility property=state/
/tr
  /table
/logic:iterate
 
This prints everything in one long column. Is there a html thing I can use??

regards 

Shea Kelly 

Consultant Software Engineer
Object Oriented Pty Ltd
PO Box 528, North Sydney NSW 2059
Phone: +61 2 9957-1092
Direct: +61 2 9459-3335
Fax: +61 2 9956-5089 
Mobile: 0416 110 499
Email: [EMAIL PROTECTED]
Web:  http://www.oopl.com.au http://www.oopl.com.au/  

 



RE: More than one action for a request

2001-09-24 Thread Alexander Jesse

Hi,

maybe the struts templates might help you...
look at the template sample

hope this helps
Alexander Jesse



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 5:50 AM
To: [EMAIL PROTECTED]
Subject: Re: More than one action for a request


What I am looking for is a way to display a jsp for EVERY action. This would 
be done by using something like this in a regular servlet:

RequestDispatcher rd = getServletContext().getRequestDispatcher();
// Go to action one
rd.include(request, response);
// Go to action two
rd.include(request, response);
// Go to action three
rd.include(request, response);
and so on...

The purpose is to be able to build up a page by smaller parts that are self 
contained and not aware of the other parts.

From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: More than one action for a request
Date: Sun, 23 Sep 2001 13:25:38 -0700

I'm not sure I understand what you want to do. In the example you gave, it
looks like all three actions could come up with different JSP pages to
display. Who decides what really gets sent back to the client?

You can certainly chain actions, by specifying an action instead of a JSP
page in your forwards, like this:

 forward name=success path=nextAction.do /

--
Martin Cooper


- Original Message -
From: Hakan Forss [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 12:55 PM
Subject: More than one action for a request


  Hi,
  I am new to Stuts and would like to do the following:
  1. request comes in and is passed to an action
  2. action performs its logic and decides what jsp to display
  4. second action performs its logic and decides what jsp to display
  5. third action performs its logic and decides what jsp to display
  and so on..
 
  I don't want the jsp pages to pass back the control to the servlet. The
  process chain should be defined by the actions or in the struts-config
file.
 
  Can this be done?
 
 
  _
  Get your FREE download of MSN Explorer at 
http://explorer.msn.com/intl.asp
 




_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp



RE: Struts installation on iPlanet 4.1 SP7

2001-09-24 Thread Bacco, F. ing. DTO/SLOD/SSI/RSD

We also had a lot of problems, so we decided to use iPlanet 6.0 (sp1) and
now, after days of frustration with iPlanet 4.1, it works excellent. So.. my
advise, dont use iPlanet 4.1.

Good luck
Frank

-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Verzonden: maandag 24 september 2001 1:31
Aan: [EMAIL PROTECTED]
Onderwerp: Struts installation on iPlanet 4.1 SP7




Is there anyone out there who has sucessfully installed struts on iPlanet
4.1 ?
Please help me 

Thanks
  John



User-messages from Action-Class to JSP

2001-09-24 Thread storck

Hi,

maybe I asked something realy stupid, but how I display user-messages like
login successfull on my JSP-Page wich comes from my Action-Class. I know
that I have to use something like that:
ActionMessages messages=new ActionMessages();
 messages.add(ActionMessages.GLOBAL_MESSAGE,new
ActionMessage(login.succesful.key));
 saveMessages(request,messages);

But how do I display that message now on my JSP-Page.

ANOTHER question: With html:errors/ I write out all errors at that page
but how can I write a special error at a special place on a JSP-Page. I have
something in mind like a formular with different input-fields and if the
user submits that formular with a wrong or with more wrong fields a
error-message should apear under that wrong field!

Thanks 




Problem creating formbean

2001-09-24 Thread Keysers, Wonne
Title: Problem creating formbean





Hi,


In order to understand the Struts framework (which I'm currently studying), I was following the Bluestone Struts tutorial.(http://developer.bluestone.com/scripts/SaISAPI.dll/StrutsTrailMap.class/struts-trailmap/default.htm)

When running the Struts-Mapping Demo, the following exception is thrown:


javax.servlet.jsp.JspException: Exception creating bean of class strutsExample.custom.CustomForm: java.lang.IllegalAccessException: strutsExample/custom/CustomForm

 at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:568)


What am I overlooking?


Thanks a lot!
Wonne



web.xml:
 init-param
 param-namemapping/param-name
 param-valuestrutsExample.custom.CustomMapping/param-value
 /init-param


struts-config.xml:
 form-beans
 form-bean name=customForm type=strutsExample.custom.CustomForm/
 /form-beans


actionmapping
 action path=/custom type=strutsExample.custom.GroupAction name=customForm
 set-property property=group value=Struts User/
 forward name=view path=/display.jsp /
 /action





SV: Struts installation on iPlanet 4.1 SP7

2001-09-24 Thread Mikkel Bruun

spend almost a week trying to run struts on ip 4.1...

We are now able to use the servlet and util classes, but cant use the
taglibs...



:: 
  Mikkel Bruun
  Senior IT Developer
  [EMAIL PROTECTED]
  Direct: +45 32 88 22 73

  Valtech A/S
  Kanonbaadsvej 10
  DK-1437 Copenhagen
  Tel  +45 32 88 20 00
  Fax +45 32 88 20 20



 -Oprindelig meddelelse-
 Fra: Bacco, F. ing. DTO/SLOD/SSI/RSD [mailto:[EMAIL PROTECTED]]
 Sendt: 24 September 2001 09:42
 Til: '[EMAIL PROTECTED]'
 Emne: RE: Struts installation on iPlanet 4.1 SP7
 
 
 We also had a lot of problems, so we decided to use iPlanet 
 6.0 (sp1) and
 now, after days of frustration with iPlanet 4.1, it works 
 excellent. So.. my
 advise, dont use iPlanet 4.1.
 
 Good luck
   Frank
 
 -Oorspronkelijk bericht-
 Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Verzonden: maandag 24 september 2001 1:31
 Aan: [EMAIL PROTECTED]
 Onderwerp: Struts installation on iPlanet 4.1 SP7
 
 
 
 
 Is there anyone out there who has sucessfully installed 
 struts on iPlanet
 4.1 ?
 Please help me 
 
 Thanks
   John
 



RE: Struts and XML

2001-09-24 Thread Kevin Jones

OK I'll try it, but is this a bug in Struts?

I don't really want to, nor should I have to, change the 'standard' Tomcat
install.

BTW, I have no global classpath, and there's *no way* I'm putting Xerces in
lib/ext folder!

Kevin Jones
Developmentor
www.develop.com

 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED]]
 Sent: 23 September 2001 14:27
 To: [EMAIL PROTECTED]
 Subject: Re: Struts and XML


 Try it with xerces in the Tomcat commons/lib folder, and nohting extra
 in the WEB-INF/lib.

 Be sure other parsers, or copies of Xerces, is being made avaiable
 through the CLASSPATH or the lib/ext folder under JAVA_HOME.

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


 Kevin Jones wrote:
 
  I've just downloaded struts (the binary version) and am trying
 to get the
  struts-example to run. After reading the install guide my
 understanding is
  that struts should work with any XML parser. If I run the example with
  jaxp.jar and crimson.jar in WEB-INF/lib it loads OK. But, if I
 replace those
  jars with xerces.jar (verison 1.4.1) I get the following exception.
 
  This is TC4 release BTW
 
  It seems like there is a dependency on crimson (judging by the
 class name).
  Does the binary version only work with crimson or is there a
 config option
  somewhere?
 
  java.lang.ClassCastException:
 org.apache.crimson.jaxp.SAXParserFactoryImpl
  at
 
 javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:155)
  at
 org.apache.struts.digester.Digester.getParser(Digester.java:275)
  at org.apache.struts.digester.Digester.parse(Digester.java:755)
  at
 
 org.apache.struts.action.ActionServlet.initMapping(ActionServlet.j
 ava:1331)
  at
  org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
  at javax.servlet.GenericServlet.init(GenericServlet.java:258)
  at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
  at
 org.apache.catalina.core.StandardContext.loadOnStartup(Unknown
  Source)
  at
 org.apache.catalina.core.StandardContext.start(Unknown Source)
  at
 org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
  at
 org.apache.catalina.core.StandardHost.addChild(Unknown Source)
  at org.apache.catalina.core.StandardHost.install(Unknown Source)
  at
 org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
  at org.apache.catalina.startup.HostConfig.start(Unknown Source)
  at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown
  Source)
  at
 
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unkno
 wn Source)
  at org.apache.catalina.core.ContainerBase.start(Unknown Source)
  at org.apache.catalina.core.ContainerBase.start(Unknown Source)
  at org.apache.catalina.core.StandardEngine.start(Unknown Source)
  at
 org.apache.catalina.core.StandardService.start(Unknown Source)
  at org.apache.catalina.core.StandardServer.start(Unknown Source)
  at org.apache.catalina.startup.Catalina.start(Unknown Source)
  at org.apache.catalina.startup.Catalina.execute(Unknown Source)
  at org.apache.catalina.startup.Catalina.process(Unknown Source)
  at java.lang.reflect.Method.invoke(Native Method)
  at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
 
  Kevin Jones
  Developmentor
  www.develop.com




Re: template qn

2001-09-24 Thread Cedric Dumoulin


  Hi,

  You can't nest jsp tag inside another jsp tag. But, their is a solution
to your problem :

template:put name='HtmlTitle' direct='true' 
  bean:message key=window.title/'
/template:put


Tricia Ong Cheah Yen wrote:

 hi all,
 i'm new to struts and i have a qn on the use of template tag
 with the bean:message tag. i had used the bean:message tag to
 provide content in my template file. however, instead of displaying the
 text Welcome as stored in my MessageResources.properties file it
 display bean:message key=window.title/ as it is.

 now shldn't there be a tranlsation of something or did i missed
 out anything?

 here's a snippet of my template page:
 %@ page language=java %
 %@ taglib uri=/taglibs/struts-template prefix=template %
 %@ taglib uri=/taglibs/struts-bean prefix=bean %
   HEAD
 TITLEtemplate:get name='HtmlTitle'//TITLE
 META HTTP-EQUIV=Pragma CONTENT=no-cache
 META HTTP-EQUIV=Expires CONTENT=0
 LINK REL=stylesheet TYPE=text/css
 HREF=./include/defaultstyle.css
   /HEAD

 and the code for the page that uses this template

 template:insert template='./templates/template.jsp'
 template:put name='HtmlTitle' content='bean:message
 key=window.title/' direct='true' /
 /template:insert

 TIA
 +trish




Re: can html:checkbox indexed??

2001-09-24 Thread chiji nwankwo

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

From: Shea Kelly <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED] 
To: [EMAIL PROTECTED] 
Subject: can html:checkbox indexed?? 
Date: Mon, 24 Sep 2001 15:15:33 +1000 
MIME-Version: 1.0 
Received: from [64.125.133.20] by hotmail.com (3.2) with ESMTP id MHotMailBD7817CD005D40043249407D85140FB00; Sun, 23 Sep 2001 23:03:57 -0700 
Received: (qmail 43641 invoked by uid 500); 24 Sep 2001 06:03:29 - 
Received: (qmail 43630 invoked from network); 24 Sep 2001 06:03:28 - 
Received: from scooter.sydney.asiaonline.net (203.19.215.187) by daedalus.apache.org with SMTP; 24 Sep 2001 06:03:28 - 
Received: (qmail 2481 invoked from network); 24 Sep 2001 05:20:55 - 
Received: from charon.oopl.com.au (HELO exchange.oopl.com.au) ([EMAIL PROTECTED]) by scooter.sydney.asiaonline.net with SMTP; 24 Sep 2001 05:20:55 - 
Received: by exchange.oopl.com.au with Internet Mail Service (5.5.2653.19)id ; Mon, 24 Sep 2001 15:15:34 +1000 
From struts-user-return-17610-cn081 Sun, 23 Sep 2001 23:04:09 -0700 
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm 
Precedence: bulk 
list-help: 
list-unsubscribe: 
list-post: 
Delivered-To: mailing list [EMAIL PROTECTED] 
Message-ID: [EMAIL PROTECTED] 
X-Mailer: Internet Mail Service (5.5.2653.19) 
X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 
 
Hi, 
 
I'm using the html:checkbox tag in an iterate tag. I am trying to set the 
indexed property but I get the following exception and the value doesnt seem 
to exist: 
 
org.apache.jasper.compiler.CompileException: 
D:\project\dod\codeBase\dodJBProject\src\pages\survey.jsp(132,10) Attribute 
indexed invalid according to the specified TLD 
at 
org.apache.jasper.compiler.TagBeginGenerator.validate(TagBeginGenerator.java 
:170) 
at 
org.apache.jasper.compiler.TagBeginGenerator.init(TagBeginGenerator.java:119 
) 
at 
org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.init(JspPa 
rseEventListener.java:759) 
at 
org.apache.jasper.compiler.JspParseEventListener.addGenerator(JspParseEventL 
istener.java:138) 
at 
org.apache.jasper.compiler.JspParseEventListener.handleTagBegin(JspParseEven 
tListener.java:909) 
at 
org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListe 
ner.java:194) 
 
Here is my code snippet: 
 
property="generalFacilityList" 
 
 
 
 
 
 
 
 indexed="true"/ 
 
 
 
 
 <% if(i % numOfColumns == 0){ %>
 
 
 <% } %>
 
 <% i++; %>
 
 
 
regards 
 
Shea Kelly 
 
Consultant Software Engineer 
Object Oriented Pty Ltd 
PO Box 528, North Sydney NSW 2059 
Phone: +61 2 9957-1092 
Direct: +61 2 9459-3335 
Fax: +61 2 9956-5089 
Mobile: 0416 110 499 
Email: [EMAIL PROTECTED] 
Web:  http://www.oopl.com.au  
 
 
Get your FREE download of MSN Explorer at http://explorer.msn.com


java.sql.SQLException: Communication link failure: java.net.SocketException

2001-09-24 Thread Hamelmann Stefan

Hi

After a while I get this exception when I attempt to read from the mySQL
database.
The error disappears after restarting the tomcat server.

- java.sql.SQLException: Communication link failure:
java.net.SocketException
at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java:459)
at org.gjt.mm.mysql.MysqlIO.sqlQueryDirect(MysqlIO.java:550)
at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java:635)
at org.gjt.mm.mysql.Connection.execSQL(Connection.java:882)
at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
at org.gjt.mm.mysql.Statement.executeQuery(Statement.java:169)
at org.gjt.mm.mysql.jdbc2.Statement.executeQuery(Statement.java:78)
... a.s.o.

Is it a problem with the struts connection pool ?
In the java.sun.com discussion forum I found also a hint to have only
synchronized methods accessing the db.

Configuration:
Windows NT 4.0

Struts 1.0 
Tomcat 3.2.3
mm.mysql-2.0.4-bin.jar
jdk 1.3.0

server:
3.23.40-nt
client:
3.23.36
( taken from mysqladmin console)

Any help is appreciated.

Stefan Hamelmann



RE: template qn

2001-09-24 Thread Tricia Ong Cheah Yen

thanks for ur help. i was able to display the messages :)

+trish

-Original Message-
From: Cedric Dumoulin [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 4:57 PM
To: [EMAIL PROTECTED]
Subject: Re: template qn



  Hi,

  You can't nest jsp tag inside another jsp tag. But, their is a
solution
to your problem :

template:put name='HtmlTitle' direct='true' 
  bean:message key=window.title/'
/template:put


Tricia Ong Cheah Yen wrote:

 hi all,
 i'm new to struts and i have a qn on the use of template tag
 with the bean:message tag. i had used the bean:message tag to
 provide content in my template file. however, instead of displaying
the
 text Welcome as stored in my MessageResources.properties file it
 display bean:message key=window.title/ as it is.

 now shldn't there be a tranlsation of something or did i
missed
 out anything?

 here's a snippet of my template page:
 %@ page language=java %
 %@ taglib uri=/taglibs/struts-template prefix=template %
 %@ taglib uri=/taglibs/struts-bean prefix=bean %
   HEAD
 TITLEtemplate:get name='HtmlTitle'//TITLE
 META HTTP-EQUIV=Pragma CONTENT=no-cache
 META HTTP-EQUIV=Expires CONTENT=0
 LINK REL=stylesheet TYPE=text/css
 HREF=./include/defaultstyle.css
   /HEAD

 and the code for the page that uses this template

 template:insert template='./templates/template.jsp'
 template:put name='HtmlTitle' content='bean:message
 key=window.title/' direct='true' /
 /template:insert

 TIA
 +trish




checkbox: isChecked

2001-09-24 Thread Friedli Beat [UFA AG Her]
Title: checkbox: isChecked 





I'd like to take the information if the checkbox shoud be checked not from the formbean, but from a different bean. 


See the example:


%// the bean where the check-information comes from %
jsp:useBean id=warenkorb class=ufa.database.shop.Warenkorb scope=session /



%// I can get the information like this %
bean:write name=warenkorb property=bestellung.editPosition.artikel.shoudFeedBeChecked /



html:form action=warenkorbBearbeiten.do 
 % // how can i check the box acording to the information in bestellung.editPosition.artikel.shoudFeedBeChecked %
 html:checkbox property=feed / 


/html:form 



I've looked through the archive, but found nothing. Any ideas


Beat Friedli


 






MessageTag: How to specify a variable number of replacement parameters ?

2001-09-24 Thread Priyanka Siriwardena

Hi

org.apache.struts.taglib.bean.MessageTag takes replacement parameters
(optional argument) as shown in the following example:

bean:message bundle=MyMsgBundle key=MyMsgKey arg0=aaa arg1=bbb/

This is fine as long as I know exactly how many replaceable parameters to
put.

say I get an unknown number of replaceable parameters as an array depending
on the key (key is dynamic as shown below):

bean:message bundle=MyMsgBundle key=%=msgKey% /

So say the key MyMsgKeyOne may have replaceable parameters a1,a2
and say the key MyMsgKeyTwo may have replaceable parameters
x1,y1,xy,zz.
and so on...

The same message tag must handle all these situations.

How do I specify a variable number of replaceable parameters in the message
tag?

thanks




Re: Struts and XML

2001-09-24 Thread Ted Husted

It's not a Struts issue, just conflicts between parser versions.

The configuration mentioned is a documentated alternative for Tomcat.
Many applications need Xerces available this way.

Kevin Jones wrote:
 
 OK I'll try it, but is this a bug in Struts?
 
 I don't really want to, nor should I have to, change the 'standard' Tomcat
 install.
 
 BTW, I have no global classpath, and there's *no way* I'm putting Xerces in
 lib/ext folder!
 
 Kevin Jones
 Developmentor
 www.develop.com
 
  -Original Message-
  From: Ted Husted [mailto:[EMAIL PROTECTED]]
  Sent: 23 September 2001 14:27
  To: [EMAIL PROTECTED]
  Subject: Re: Struts and XML
 
 
  Try it with xerces in the Tomcat commons/lib folder, and nohting extra
  in the WEB-INF/lib.
 
  Be sure other parsers, or copies of Xerces, is being made avaiable
  through the CLASSPATH or the lib/ext folder under JAVA_HOME.
 
  -- Ted Husted, Husted dot Com, Fairport NY USA.
  -- Custom Software ~ Technical Services.
  -- Tel +1 716 737-3463
  -- http://www.husted.com/about/struts/
 
 
  Kevin Jones wrote:
  
   I've just downloaded struts (the binary version) and am trying
  to get the
   struts-example to run. After reading the install guide my
  understanding is
   that struts should work with any XML parser. If I run the example with
   jaxp.jar and crimson.jar in WEB-INF/lib it loads OK. But, if I
  replace those
   jars with xerces.jar (verison 1.4.1) I get the following exception.
  
   This is TC4 release BTW
  
   It seems like there is a dependency on crimson (judging by the
  class name).
   Does the binary version only work with crimson or is there a
  config option
   somewhere?
  
   java.lang.ClassCastException:
  org.apache.crimson.jaxp.SAXParserFactoryImpl
   at
  
  javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:155)
   at
  org.apache.struts.digester.Digester.getParser(Digester.java:275)
   at org.apache.struts.digester.Digester.parse(Digester.java:755)
   at
  
  org.apache.struts.action.ActionServlet.initMapping(ActionServlet.j
  ava:1331)
   at
   org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
   at javax.servlet.GenericServlet.init(GenericServlet.java:258)
   at org.apache.catalina.core.StandardWrapper.load(Unknown Source)
   at
  org.apache.catalina.core.StandardContext.loadOnStartup(Unknown
   Source)
   at
  org.apache.catalina.core.StandardContext.start(Unknown Source)
   at
  org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
   at
  org.apache.catalina.core.StandardHost.addChild(Unknown Source)
   at org.apache.catalina.core.StandardHost.install(Unknown Source)
   at
  org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
   at org.apache.catalina.startup.HostConfig.start(Unknown Source)
   at org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown
   Source)
   at
  
  org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unkno
  wn Source)
   at org.apache.catalina.core.ContainerBase.start(Unknown Source)
   at org.apache.catalina.core.ContainerBase.start(Unknown Source)
   at org.apache.catalina.core.StandardEngine.start(Unknown Source)
   at
  org.apache.catalina.core.StandardService.start(Unknown Source)
   at org.apache.catalina.core.StandardServer.start(Unknown Source)
   at org.apache.catalina.startup.Catalina.start(Unknown Source)
   at org.apache.catalina.startup.Catalina.execute(Unknown Source)
   at org.apache.catalina.startup.Catalina.process(Unknown Source)
   at java.lang.reflect.Method.invoke(Native Method)
   at org.apache.catalina.startup.Bootstrap.main(Unknown Source)
  
   Kevin Jones
   Developmentor
   www.develop.com



Installation problem

2001-09-24 Thread Richard Kärrström



Hi

When we try to install our application on tomcat 
3.2.3 using struts we recieve a exception

java.lang.ClassNotFoundException: 
org.apache.struts.action.ActionFormBean

we have struts.jar in WEB-INF/lib and all our 
servlet classes in WEB-INF/classes

We have removed the jaxp.jar and parser.jar from 
tomcat/lib directory and replaced it with xerces.jar

What can cause this problem 

Thanks in advance 

Richard K


Who tells the Checkbox if it should be checked or not?

2001-09-24 Thread Friedli Beat [UFA AG Her]
Title: Who tells the Checkbox if it should be checked or not?





I've been reading through the struts-example-application. It works perfect. The checkbox is allways set correct, even if the Form-Bean would say not checked by default. Sorry I know, that sometimes I ask stuped questions but:


Who tells the Checkbox if it should be checked or not?


Subscription.jsp



 tr
 th align=right
 bean:message key=prompt.autoConnect/
 /th
 td align=left
 html:checkbox property=autoConnect/
 /td
 /tr



I thougt it would be the Form-Bean that would have some logic implemented. But i cant find nothing.



SubscriptionForm



 /**
 * Should we auto-connect at startup time?
 */
 private boolean autoConnect = false;



 /**
 * Return the auto-connect flag.
 */
 public boolean getAutoConnect() {


 return (this.autoConnect);


 }


 /**
 * Set the auto-connect flag.
 *
 * @param autoConnect The new auto-connect flag
 */
 public void setAutoConnect(boolean autoConnect) {


 this.autoConnect = autoConnect;
 }


Thanks for every hint!


Beat Friedli






Resin 1.2.3 and latest build

2001-09-24 Thread Will Jaynes

I'm using the latest versions of struts and the commons jars from CVS.  I've
been developing with Resin 2.x, but now I need to use an earlier version of
Resin, version 1.2.3. When I try to run my webapp on the earlier version I get
an exception when the ActionServlet runs it's init method. The exception is

java.lang.NoSuchMethodError
at org.apache.commons.digester.Digester.getReader(Digester.java:503)
at org.apache.commons.digester.Digester.parse(Digester.java:1178)
at org.apache.struts.action.ActionServlet.initMapping(ActionServlet.java:1273)
...

Anyone have an idea what might be happening here? Thanks for any info.

Regards, Will




Re: logic:Iterate question

2001-09-24 Thread Will Jaynes

If you mean, can you wrap a long column into two or more columns, like a
newspaper article, then there is no html way to do this. You would need to do in
manually somehow.

Will

- Original Message -
From: Shea Kelly [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 7:01 PM
Subject: logic:Iterate question


Hi all,

I am using the iterate tag to iterate over a collection of items stored in
the FormBean. And all work fine (so far :) ). My question is: A I have a
large number of items in the collection is it possible arrange them in
columns?? Here is a code snippet:

 logic:iterate id=facility scope=session name=surveyForm
property=generalFacilityList
  table
tr
  bean:write name=facility property=code/
  bean:write name=facility property=description/
  html:checkbox name=facility property=state/
  bean:write name=facility property=state/
/tr
  /table
/logic:iterate

This prints everything in one long column. Is there a html thing I can use??

regards

Shea Kelly

Consultant Software Engineer
Object Oriented Pty Ltd
PO Box 528, North Sydney NSW 2059
Phone: +61 2 9957-1092
Direct: +61 2 9459-3335
Fax: +61 2 9956-5089
Mobile: 0416 110 499
Email: [EMAIL PROTECTED]
Web:  http://www.oopl.com.au http://www.oopl.com.au/ 







AW: Who tells the Checkbox if it should be checked or not?

2001-09-24 Thread Friedli Beat [UFA AG Her]
Title: AW: Who tells the Checkbox if it should be checked or not?





Thanks for your Answer. Can you precise what boolean value you mean? ( Do you men 'private boolean autoConnect = false;' in subscriptionForm?) 

But there's one thin I don't understand:


In the struts-example I choose
'Edit your user registration profile' and then I click on a profile I want to edit.


If in a previous session a had checked 'Auto Connect' then it still cheched (that is absolutly correct) 
But the boolean value autoConnect = false in subscriptionForm is set to false. So where does 'checked' the come from?


Thanks for your time


Beat Friedli



-Ursprüngliche Nachricht-
Von: SUPRIYA MISRA [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 24. September 2001 15:05
An: [EMAIL PROTECTED]
Betreff: Re: Who tells the Checkbox if it should be checked or not?



the boolean value tells which check box is to be checked.



From: Friedli Beat [UFA AG Her] [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Who tells the Checkbox if it should be checked or not?
Date: Mon, 24 Sep 2001 14:58:35 +0200




_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp






struts portal?

2001-09-24 Thread Nathan Coast

Hi, 

quick question, is there any struts or apache sub-project to provide
'portal-like' functionality?  basic functionality for users to select
components from a default list that they want to see in their home page.

Our current app is in struts and we'd like to avoid adding more new
technologies if possible.

Cheers
Nathan


**
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper at LevelSeas for the presence of computer viruses.

www.mimesweeper.com
**



when to use Struts custom tags

2001-09-24 Thread Adam Smith


I would be very interested in hearing people's views about when to use and
not to use the Struts custom tags for creating HTML. I am building an
application that I eventually want to release open source to an audience
that may only know HTML (and that is all I want them to have to know).

I can see where simple pages can be made simpler by the use of these tags,
but I can also see where it would quickly require a more in-depth knowledge
of how to use the tags, and about any idiosyncracies using the tags, and so,
put more of a burden on someone trying to customize the pages who only knows
HTML.

Also, I have another application in which I am thinking of having the output
be XHTML, initially going to HTML browsers. I am not sure that the final
output of the Struts custom tags would be backward compatible with HTML
browsers and parsable by XML browsers. (I have just started playing with the
custom tags.)

Thanks for any insight you can give.

___
   Adam Smith
   [EMAIL PROTECTED]




RE: Struts installation on Websphere 4.0

2001-09-24 Thread Assenza, Chris

Still haven't had time to formalize these directions, so they are likely to
change once I get time to remove extraeous steps or correct things. :)

rief Preliminary Deployment Instructions for WAS 4.0

·   Deploy Application
o   Install WebSphere 4.0
o   Once completed and system is restarted (if necessary): Start
the WebSphere service   (startServer.bat on NT, probably startServer.sh on
Unix)
o   After the server has started, log onto the web-based
Administration Console  (http://localhost:9090/admin).
o   Next, expand Nodes on the left.
o   Click on Enterprise Applications
o   Click on Install
o   Browse to the file Deployed_app.ear that you created with
the AA tool.
o   Select the file follow the steps the console takes you
through:
§   Click next on EJB deployment screen.
§   Click next on the Web Module deployment screen
(change your preference on  pre-compiling if you so
desire).
§   On the next screen, allow WebSphere to redeploy
YourApp-ejb.jar by leaving  the box checked and clicking
next. (ed: Not sure if this step is necessary)
§   Review the settings and click Finish when ready.
·   Once finished, begin JDBC configuration. (for Oracle)
o   Expand Resources in the left navigation area.
o   Click JDBC Drivers
o   Click New
§   The Server Class Path is the location of
classes12.zip (Oracle's JDBCdrivers) on the
server.
§   Name is: OracleJdbcDriver
§   Implementation Classname is:
oracle.jdbc.pool.OracleConnectionPoolDataSource
o   Click Ok to add the driver.
o   Expand the newly created OracleJdbcDriver in the
left navigation area.
o   Click on Data Sources
o   Click New
§   Name is: somePool
§   JNDI Name is: jdbc/somePool
§   Default Userid is: someId 
§   Defaults Password is: somePass 
§   All others left blank/default.
o   Click Ok to add the Data Source.
o   From the Data Source screen, click on somePool.
o   Click on Property Set (on the bottom).
o   Click Resource Properties
o   Click New
§   Name is: URL
§   Type is: java.lang.String
§   Value is: jdbc:oracle:thin:user/pass@host:port:sid 
Where:
·   user/pass are the username/password
respectively
·   host is the IP address of the Oracle
DB Server 
·   port is the port on which Oracle is
listening (ex. 1521).
·   sid is the Oracle SID or name for
the database
o   Click Ok until you've reached the Data Source Screen.
·   Complete Deployment
o   Click Save on the nav-bar at the top of the screen.
o   Select server-config.xml (or the top option) and click Ok.  
o   Stop and then restart the WebSphere AppServer.
·   Once started, go to http://someIpAddress/appname/file.jsp to test
the deployment.



Christopher Assenza 
Phone:  412.201.6026 
Fax: 412.201.6060 
Email:  [EMAIL PROTECTED] 
ACCESSDATA 
Moving Your Business from Point A to Point e.SM 
http://www.accessdc.com/ 
-Original Message-
From: Ed Holloway [mailto:[EMAIL PROTECTED]]
Sent: Saturday, September 22, 2001 5:45 PM
To: [EMAIL PROTECTED]
Subject: Struts installation on Websphere 4.0


Does anyone have any information on installing Struts and/or Sample Apps on
WS 4.0 Advanced Enterprise (AES) on a NT/2000 platform?  This is my first
experience with struts (and WS 4.0 for that matter!) and I am not having
much luck.  

I have tried to extract what I could from the Struts / WS 3.5x instructions,
but still no luck (and the deploy process seems to be considerably different
between these Websphere versions).

I can get the basic index.jsp pages to load in the samples, but after I try
any form action it seems like it does not know where to post, and just
returns a page not found error.

Any help is greatly appreciated!

Thanks,
-Ed



Re: html:text align=....

2001-09-24 Thread Luis Olivares

if you're gonna add the aligment property... could you please add the
'title' (tooltip) property (not only to the html:text tag, but all the
html tags)?.

Maybe it doesn't sound important, but a tooltip gives a plus to the
understanding of some sites (and also a more complete look).

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 1:26 PM
Subject: Re: html:text align=


 Interestingly, in the HTML 4.01 Transitional DTD, the type of the 'align'
 attribute on the INPUT tag is 'IAlign'. This is the alignment type
 specified for images, so it would seem that it wasn't intended to be used
 for text. However, if browsers know what to do with it for text, and
people
 want to be able to use it that way, I have no problem with that.

 David, could you please submit a bug report for this in bugzilla
 (http://nagoya.apache.org/bugzilla/), to make sure we don't lose track of
 it? Thanks.

 --
 Martin Cooper


 - Original Message -
 From: Ted Husted [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, September 23, 2001 6:32 AM
 Subject: Re: html:text align=


  It seems to have been in HTML specification since at least 3.2 - I'm not
  sure why we didn't include it. I'm also not seeing anything in the
  archives :~|
 
  [EMAIL PROTECTED] wrote:
  
   My guess is because the 'align' attribute is not part of XHTML, and is
 also
   not in the HTML 4 Strict DTD. But it might just be an oversight. :-}
  
   --
   Martin Cooper
  
   - Original Message -
   From: David Corbin [EMAIL PROTECTED]
   To: Struts User [EMAIL PROTECTED]
   Sent: Friday, September 21, 2001 1:33 PM
   Subject: html:text align=
  
Is there any reason that html:text doesn't support the align
 attribute?
   





Struts - XML - XSL

2001-09-24 Thread Frédéric Houbie - ABSIS-GROUP



Hi, 


I'm involved in 
a project that use struts. I have a question to get some advice from you. The 
application want to separate clearly layout from the logic. The team manager 
want us to use XML, XSL to build html pages. But I don't see clearly how to mix 
all that. I have beans that do SQL query and return an iterator with the data, I 
suppose my controller servlet must call the beans and give the jsp access to 
this iterator. My JSP page will dynamically build XML file, but i don't know how 
to call the transformation of the XML data with a XSL file to build my final 
html layout. 

Can you help me 
?



Frédéric 
Houbie
Internet Project 
Manager

ABSIS-GROUP SA
Centre 
Socran
Av Pré Aily, 
8
B-4031 
Angleur

Tel : +32 4 367 89 
64
Fax: +32 4 367 
89 63

 DISCLAIMER 
"This e-mail and any attachments thereto may contain 
information which is confidential and/or protected by intellectual property 
rights and are intended for the sole use of the recipient(s) named above. Any 
use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by persons 
other than the designated recipient(s) is prohibited. If you have received this 
e-mail in error, please notify the sender either by telephone or by e-mail and 
delete the material from any computer.
Thank you for your 
cooperation."


Struts Installation with VAJ 3.53 ? Help

2001-09-24 Thread Jhaveri, Harshal

hi! All
   I am having problems installing struts in VAJ 3.53
I followed instructions on then site:
http://www7.software.ibm.com/vad.nsf/Data/Document2558?OpenDocumentSubMast

Still having some problems initializing ActionServlet
[01.09.23 12:47:23:186 EDT] 2fb6 WebGroup  X [Servlet Error]-[{0}]: {1}:
{2}
 action
 Failed to load servlet
 javax.servlet.ServletException: Parsing
error processing resource path /WEB-INF/struts-config.xml
java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
javax.servlet.ServletException(java.lang.String,
java.lang.Throwable)
void org.apache.struts.action.ActionServlet.initMapping()
void org.apache.struts.action.ActionServlet.init()
void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
void com.ibm.servlet.engine.webapp.StrictServletInstance.doInit()
void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(javax.servlet.Ser
vletConfig)
void
com.ibm.servlet.engine.webapp.PreInitializedServletState.init(com.ibm.servle
t.engine.webapp.StrictLifecycleServlet, javax.servlet.ServletConfig)
void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(javax.servlet.Serv
letConfig)
void com.ibm.servlet.engine.webapp.ServletInstance.init()
void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
void
com.ibm.servlet.engine.webapp.ServletManager.addServlet(java.lang.String,
javax.servlet.Servlet, java.util.Properties)
void
com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(java.lang.Str
ing)
void
com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets()
void com.ibm.servlet.engine.webapp.WebApp.loadServletManager()
void
com.ibm.servlet.engine.webapp.WebApp.init(com.ibm.servlet.engine.config.WebA
ppInfo, com.ibm.servlet.engine.webapp.WebAppContext)
void com.ibm.servlet.engine.srt.WebGroup.loadWebApp()
void
com.ibm.servlet.engine.srt.WebGroup.init(com.ibm.servlet.engine.ServletHost,
com.ibm.servlet.engine.config.WebGroupInfo)
void com.ibm.servlet.engine.ServletHost.loadWebGroups()
void
com.ibm.servlet.engine.ServletHost.init(com.ibm.servlet.engine.ServletEngine
, com.ibm.servlet.engine.config.ServletHostInfo)
void com.ibm.servlet.engine.ServletEngine.loadServletHosts()
void
com.ibm.servlet.engine.ServletEngine.init(com.ibm.servlet.engine.config.Serv
letEngineInfo)
com.ibm.servlet.engine.ServletEngine
com.ibm.servlet.engine.ServletEngine.getEngine()
void
com.ibm.ivj.control.node.ServletEngineRunner.startServletEngine(boolean)
boolean com.ibm.ivj.control.node.ServletEngineRunner.startServer()
void
com.ibm.ivj.control.node.ServletEngineRunner.main(java.lang.String [])
java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object,
java.lang.Object [])

I would appreciate all the help I can get on this .

Thanks,
Harshal.

-Original Message-
From: Assenza, Chris [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 9:59 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Struts installation on Websphere 4.0


Still haven't had time to formalize these directions, so they are likely to
change once I get time to remove extraeous steps or correct things. :)

rief Preliminary Deployment Instructions for WAS 4.0

·   Deploy Application
o   Install WebSphere 4.0
o   Once completed and system is restarted (if necessary): Start
the WebSphere service   (startServer.bat on NT, probably startServer.sh on
Unix)
o   After the server has started, log onto the web-based
Administration Console  (http://localhost:9090/admin).
o   Next, expand Nodes on the left.
o   Click on Enterprise Applications
o   Click on Install
o   Browse to the file Deployed_app.ear that you created with
the AA tool.
o   Select the file follow the steps the console takes you
through:
§   Click next on EJB deployment screen.
§   Click next on the Web Module deployment screen
(change your preference on  pre-compiling if you so
desire).
§   On the next screen, allow WebSphere to redeploy
YourApp-ejb.jar by leaving  the box checked and clicking
next. (ed: Not sure if this step is necessary)
§   Review the settings and click Finish when ready.
·   Once finished, begin JDBC configuration. (for Oracle)
o   Expand Resources in the left navigation area.
o   Click JDBC Drivers
o   Click New
§   The Server Class Path is the location of
classes12.zip (Oracle's JDBCdrivers) on the
server.
§   Name is: OracleJdbcDriver
   

html:option value=overriden_valuetrue_i18n_value/html:option ?

2001-09-24 Thread Ken'ichi Unnai


Hi All, 

I'm building a small select.jsp - ReceiveServlet - result.jsp
test webapp.

As I went further, I found I have one problem for select option
value for foreign chars.

in select.jsp:
-
  html:form action=/select
   html:select property=color
html:option value=?jpLangValueForWhite? key=option1/
html:option value=?jpLangValueForBlue? key=option2/
html:option value=?jpLangValueForGray? key=option3/
   /html:select
   html:submitbean:message key=submit//html:submit
  /html:form 
-

What I want to do is avoid hardcoding the value of each option...
One thing that seems odd to me is why html:option has separate 
value  option attributes. I would appreciate if 

html:option value=white
 bean:message key=option1/
/html:option 

Then the value is overriden and it become the one from 
MessageResource property (in this example, option1 value) ...

There maybe some workaround if I use options tag but
that requires for Actin bean to have hardcoded array values.

Could anyone please point me out how to do it, making use of
MessageResource property without hardcoding Action bean?


Many thanks,
Ken




__
Do You Yahoo!?
Get email alerts  NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com



RE: Struts and XML

2001-09-24 Thread Kevin Jones

 It's not a Struts issue, just conflicts between parser versions.

Why? If I have Xerces in the struts directory then Struts should pick that
up ahead of Crimson in the common/lib directory. Assuming Struts is using
JAXP then there should be no dependency on the parser class names at all. I
have other applications that use Xerces and I haven't needed to touch the
common/lib directory xerces.jar lives in WEB-INF/lib, alongside crimson.jar
and jaxp.jar in common/lib and the application works fine.

I've been down this path of classloader problems before on Tomcat (with
Craig) and, until I installed Struts everything was working.

 The configuration mentioned is a documentated alternative for Tomcat.
 Many applications need Xerces available this way.

Agreed - but I shouldn't have to. Let's say, for example, that my ISP uses
Tomcat 'out of the box' and I install an application that uses Xerces, I
wouldn't expect (or want) the ISP to replace crimon/jaxp with Xerces. I want
the application to work as-is, and the way Tomcat configures classpaths,
that should be the case. If it doesn't it's either a bug in Tomcat, or a bug
in my application (in this case struts-example),

Kevin Jones
Developmentor
www.develop.com

 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED]]
 Sent: 24 September 2001 13:22
 To: [EMAIL PROTECTED]
 Subject: Re: Struts and XML


 It's not a Struts issue, just conflicts between parser versions.

 The configuration mentioned is a documentated alternative for Tomcat.
 Many applications need Xerces available this way.

 Kevin Jones wrote:
 
  OK I'll try it, but is this a bug in Struts?
 
  I don't really want to, nor should I have to, change the
 'standard' Tomcat
  install.
 
  BTW, I have no global classpath, and there's *no way* I'm
 putting Xerces in
  lib/ext folder!
 
  Kevin Jones
  Developmentor
  www.develop.com
 
   -Original Message-
   From: Ted Husted [mailto:[EMAIL PROTECTED]]
   Sent: 23 September 2001 14:27
   To: [EMAIL PROTECTED]
   Subject: Re: Struts and XML
  
  
   Try it with xerces in the Tomcat commons/lib folder, and nohting extra
   in the WEB-INF/lib.
  
   Be sure other parsers, or copies of Xerces, is being made avaiable
   through the CLASSPATH or the lib/ext folder under JAVA_HOME.
  
   -- Ted Husted, Husted dot Com, Fairport NY USA.
   -- Custom Software ~ Technical Services.
   -- Tel +1 716 737-3463
   -- http://www.husted.com/about/struts/
  
  
   Kevin Jones wrote:
   
I've just downloaded struts (the binary version) and am trying
   to get the
struts-example to run. After reading the install guide my
   understanding is
that struts should work with any XML parser. If I run the
 example with
jaxp.jar and crimson.jar in WEB-INF/lib it loads OK. But, if I
   replace those
jars with xerces.jar (verison 1.4.1) I get the following exception.
   
This is TC4 release BTW
   
It seems like there is a dependency on crimson (judging by the
   class name).
Does the binary version only work with crimson or is there a
   config option
somewhere?
   
java.lang.ClassCastException:
   org.apache.crimson.jaxp.SAXParserFactoryImpl
at
   
  
 javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:155)
at
   org.apache.struts.digester.Digester.getParser(Digester.java:275)
at
 org.apache.struts.digester.Digester.parse(Digester.java:755)
at
   
   org.apache.struts.action.ActionServlet.initMapping(ActionServlet.j
   ava:1331)
at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
at
 javax.servlet.GenericServlet.init(GenericServlet.java:258)
at
 org.apache.catalina.core.StandardWrapper.load(Unknown Source)
at
   org.apache.catalina.core.StandardContext.loadOnStartup(Unknown
Source)
at
   org.apache.catalina.core.StandardContext.start(Unknown Source)
at
   org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
at
   org.apache.catalina.core.StandardHost.addChild(Unknown Source)
at
 org.apache.catalina.core.StandardHost.install(Unknown Source)
at
   org.apache.catalina.startup.HostConfig.deployApps(Unknown Source)
at
 org.apache.catalina.startup.HostConfig.start(Unknown Source)
at
 org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown
Source)
at
   
   org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unkno
   wn Source)
at
 org.apache.catalina.core.ContainerBase.start(Unknown Source)
at
 org.apache.catalina.core.ContainerBase.start(Unknown Source)
at
 org.apache.catalina.core.StandardEngine.start(Unknown Source)
at
   org.apache.catalina.core.StandardService.start(Unknown Source)
at
 org.apache.catalina.core.StandardServer.start(Unknown Source)
at
 

RE: Struts - XML - XSL

2001-09-24 Thread mattes balser

Hello Frédéric,

 but i don't know how to call the transformation of the XML data with a XSL
file to build my final html layout.

one option is to use the xsl-taglib
(http://jakarta.apache.org/taglibs/doc/xsl-doc/intro.html).

I haven't seen any problems with struts.

ciao
mattes







Form layout not specified until runtime...

2001-09-24 Thread Jonas Bonér
Title: Form layout not specified until runtime...






Hi everyone.


We am building an extremely database driven system where everything (the JSP layout for example) 
is suppose to be dynamically generated in runtime. 
For example. We do not know in advance how many input fields we are going to present to the user.
This means that it is not possible to define a XXXForm JavaBean that has exactly these input fields.


Is there a way to meet these demands but still be able to use Struts?


Regards.
/Jonas Bonèr





AW: AW: Who tells the Checkbox if it should be checked or not?

2001-09-24 Thread Friedli Beat [UFA AG Her]
Title: AW: AW: Who tells the Checkbox if it should be checked or not?





As I understand it, value=yes ist the value that will be transmitted if the checkbox is checked. But it does not check the checkbox. I guess that there is no other solution than populating the Form-Bean in an Action-Servlet.

Beat Friedli


---




html:checkbox property=vaAppt value=yes/
 value=on is default


From: Friedli Beat [UFA AG Her] [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
CC: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: AW: Who tells the Checkbox if it should be checked or not?
Date: Mon, 24 Sep 2001 15:34:47 +0200




_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp






RE: Struts and XML

2001-09-24 Thread Kevin Jones

 Agreed - but I shouldn't have to. Let's say, for example, that my ISP uses
 Tomcat 'out of the box' and I install an application that uses Xerces, I
 wouldn't expect (or want) the ISP to replace crimon/jaxp with
 Xerces. I want
 the application to work as-is, and the way Tomcat configures classpaths,
 that should be the case. If it doesn't it's either a bug in
 Tomcat, or a bug
 in my application (in this case struts-example),

And it looks like a Tomcat bug - I'm now seeing the same issue in my app
that wasn't there under TC4 beta 6!

Kevin Jones
Developmentor
www.develop.com

 -Original Message-
 From: Kevin Jones [mailto:[EMAIL PROTECTED]]
 Sent: 24 September 2001 15:41
 To: [EMAIL PROTECTED]
 Subject: RE: Struts and XML


  It's not a Struts issue, just conflicts between parser versions.

 Why? If I have Xerces in the struts directory then Struts should pick that
 up ahead of Crimson in the common/lib directory. Assuming Struts is using
 JAXP then there should be no dependency on the parser class names
 at all. I
 have other applications that use Xerces and I haven't needed to touch the
 common/lib directory xerces.jar lives in WEB-INF/lib, alongside
 crimson.jar
 and jaxp.jar in common/lib and the application works fine.

 I've been down this path of classloader problems before on Tomcat (with
 Craig) and, until I installed Struts everything was working.

  The configuration mentioned is a documentated alternative for Tomcat.
  Many applications need Xerces available this way.

 Agreed - but I shouldn't have to. Let's say, for example, that my ISP uses
 Tomcat 'out of the box' and I install an application that uses Xerces, I
 wouldn't expect (or want) the ISP to replace crimon/jaxp with
 Xerces. I want
 the application to work as-is, and the way Tomcat configures classpaths,
 that should be the case. If it doesn't it's either a bug in
 Tomcat, or a bug
 in my application (in this case struts-example),

 Kevin Jones
 Developmentor
 www.develop.com

  -Original Message-
  From: Ted Husted [mailto:[EMAIL PROTECTED]]
  Sent: 24 September 2001 13:22
  To: [EMAIL PROTECTED]
  Subject: Re: Struts and XML
 
 
  It's not a Struts issue, just conflicts between parser versions.
 
  The configuration mentioned is a documentated alternative for Tomcat.
  Many applications need Xerces available this way.
 
  Kevin Jones wrote:
  
   OK I'll try it, but is this a bug in Struts?
  
   I don't really want to, nor should I have to, change the
  'standard' Tomcat
   install.
  
   BTW, I have no global classpath, and there's *no way* I'm
  putting Xerces in
   lib/ext folder!
  
   Kevin Jones
   Developmentor
   www.develop.com
  
-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: 23 September 2001 14:27
To: [EMAIL PROTECTED]
Subject: Re: Struts and XML
   
   
Try it with xerces in the Tomcat commons/lib folder, and
 nohting extra
in the WEB-INF/lib.
   
Be sure other parsers, or copies of Xerces, is being made avaiable
through the CLASSPATH or the lib/ext folder under JAVA_HOME.
   
-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/about/struts/
   
   
Kevin Jones wrote:

 I've just downloaded struts (the binary version) and am trying
to get the
 struts-example to run. After reading the install guide my
understanding is
 that struts should work with any XML parser. If I run the
  example with
 jaxp.jar and crimson.jar in WEB-INF/lib it loads OK. But, if I
replace those
 jars with xerces.jar (verison 1.4.1) I get the following
 exception.

 This is TC4 release BTW

 It seems like there is a dependency on crimson (judging by the
class name).
 Does the binary version only work with crimson or is there a
config option
 somewhere?

 java.lang.ClassCastException:
org.apache.crimson.jaxp.SAXParserFactoryImpl
 at

   
 
 javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:155)
 at
org.apache.struts.digester.Digester.getParser(Digester.java:275)
 at
  org.apache.struts.digester.Digester.parse(Digester.java:755)
 at

org.apache.struts.action.ActionServlet.initMapping(ActionServlet.j
ava:1331)
 at

 org.apache.struts.action.ActionServlet.init(ActionServlet.java:465)
 at
  javax.servlet.GenericServlet.init(GenericServlet.java:258)
 at
  org.apache.catalina.core.StandardWrapper.load(Unknown Source)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(Unknown
 Source)
 at
org.apache.catalina.core.StandardContext.start(Unknown Source)
 at
org.apache.catalina.core.ContainerBase.addChild(Unknown Source)
 at
org.apache.catalina.core.StandardHost.addChild(Unknown Source)
  

Re: Form layout not specified until runtime...

2001-09-24 Thread Ted Husted

For an extremely database driven application, I'd take a look at
dbForms.org

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

 Jonas Bonér wrote:
 
 Hi everyone.
 
 We am building an extremely database driven system where everything
 (the JSP layout for example)
 is suppose to be dynamically generated in runtime.
 For example. We do not know in advance how many input fields we are
 going to present to the user.
 This means that it is not possible to define a XXXForm JavaBean that
 has exactly these input fields.
 
 Is there a way to meet these demands but still be able to use Struts?
 
 Regards.
 /Jonas Bonèr



Re: Struts - XML - XSL

2001-09-24 Thread Ted Husted

At Jakarta, we use Ant to build our HTML pages from XML and XSL. See the
Struts source distribution for an example. 

I haven't tried it, but I keep thinking it would be interesting to do
the same with JSPs.

This would gives you the flexibility of XML,XLS without changing how you
write your applications, or incurring the overhead of the runtime
transformations.

 Frédéric Houbie - ABSIS-GROUP wrote:
 
 Hi,
 
 I'm involved in a project that use struts. I have a question to get
 some advice from you. The application want to separate clearly layout
 from the logic. The team manager want us to use XML, XSL to build html
 pages. But I don't see clearly how to mix all that. I have beans that
 do SQL query and return an iterator with the data, I suppose my
 controller servlet must call the beans and give the jsp access to this
 iterator. My JSP page will dynamically build XML file, but i don't
 know how to call the transformation of the XML data with a XSL file to
 build my final html layout.
 
 Can you help me ?
 
 
 Frédéric Houbie
 Internet Project Manager
 
 ABSIS-GROUP SA
 Centre Socran
 Av Pré Aily, 8
 B-4031 Angleur
 Tel : +32 4 367 89 64
 Fax : +32 4 367 89 63
 
  DISCLAIMER 
 
 This e-mail and any attachments thereto may contain information which
 is confidential and/or protected by intellectual property rights and
 are intended for the sole use of the recipient(s) named above. Any use
 of the information contained herein (including, but not limited to,
 total or partial reproduction, communication or distribution in any
 form) by persons other than the designated recipient(s) is prohibited.
 If you have received this e-mail in error, please notify the sender
 either by telephone or by e-mail and delete the material from any
 computer.
 
 Thank you for your cooperation.

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



security question

2001-09-24 Thread Jonathan M Crater

i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs underneath 
WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a result,
i have to secure requests to both JSPs and actions.  securing the actions is just a 
matter of sub-classing ActionServlet and providing logic to check for
certain secured paths.  the problem is i don't want to repeat the logic in the 
JSPs--either through a tag library or otherwise.  does anyone have any
suggestions as to how best to prevent a situation where a user requests a JSP page 
directly when it should have gone through the sub-classed
ActionServlet?  i was thinking of just setting a request parameter for each request as 
it passes through the ActionServlet.  that way, in the JSP i can
just test for that value to determine whether the request went through the proper 
channel.  if not, i can redirect to an error page.

thoughts?  suggestions?





RE: Struts - XML - XSL

2001-09-24 Thread Ravindran Ramaiah

Following are the procedures that can used to apply the style sheet


Once we have already parsed the XML document, the getDocument method from
the parser instance (e.g. DOMParser) should return  an object of type
Document (which is actually a DOM representation of the XML). This will be
the starting point.

To apply the XSLT transformation, you perform the following steps:

1.  Create a DOMSource object and implicitly cast it to a SAX InputSource
object. The constructor takes in the Document object as a parameter.

InputSource source = new DOMSource(document);

2.  Instantiate a StyleGenerator object and pass the fully-qualified class
names of the XML and XSL parsers you want to use.

StyleGenerator stylegen = new StyleGenerator(Consts.SOURCEDOC_PARSER,
Consts.STYLESHEET_PARSER);

Where:
SOURCEDOC_PARSERcom.sengen.utils.DOMParserExtension
STYLESHEET_PARSER   org.apache.xerces.parsers.SAXParser

You can plug-in any DOM / SAX compliant parser you like. In this case we are
using two different parsers: a DOM parser for the XML and a SAX parser for
the XSL. The setup does not have to be this way. This is also the reason why
we have to implicitly casting in step one.

3. Lastly, call the StyleGenerator's applyStylesheet method. Originally, it
only deals with filenames but I overloaded it to accomodate InputSource and
streams. The resulting or transformed XML document is either written to a
file or returned as a byte stream.

public void applyStylesheet(String sourceFileName, String styleFileName,
String outputFileName) throws Exception
public ByteArrayOutputStream applyStylesheet(String sourceFileName, String
styleFileName) throws Exception
public void applyStylesheet(InputSource sourceInput, String styleFileName,
String outputFileName) throws Exception
public ByteArrayOutputStream applyStylesheet(InputSource sourceInput, String
styleFileName) throws Exception

Where:
sourceFileName  XML filename
styleFileName   XSL filename ** 
outputFileName  filename of the resulting (transformed) XML
sourceInput InputSource object created in step 1


** any type of stylesheet like XSL-2-HTML, XSL-2-FO,  XSL-2-whatever


-lines 3 and 4 correspond to steps 1 and 2 above.
-In line 7, he used the fourth version of the applyStylesheet method and
converted the byte array to a
string. This string is now the HTML transformation of the XML document.

1.  public String getPresentation() {
2.  
3.  InputSource source = new DOMSource(getDocument());
4.  StyleGenerator stylegen = new
StyleGenerator(KmpPdfgenConsts.SOURCEDOC_PARSER,KmpPdfgenConsts.STYLESHEET_P
ARSER);
5.  
6.  try {
7.  return
stylegen.applyStylesheet(source,getStylesheet()).toString();
8.  } catch(Exception e){
9.  //
10. }
11. 
12. return ;
13. }



Hope this helps.

Thanks,
Ravi






-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 11:33 AM
To: [EMAIL PROTECTED]
Subject: Re: Struts - XML - XSL


At Jakarta, we use Ant to build our HTML pages from XML and XSL. See the
Struts source distribution for an example. 

I haven't tried it, but I keep thinking it would be interesting to do
the same with JSPs.

This would gives you the flexibility of XML,XLS without changing how you
write your applications, or incurring the overhead of the runtime
transformations.

 Frédéric Houbie - ABSIS-GROUP wrote:
 
 Hi,
 
 I'm involved in a project that use struts. I have a question to get
 some advice from you. The application want to separate clearly layout
 from the logic. The team manager want us to use XML, XSL to build html
 pages. But I don't see clearly how to mix all that. I have beans that
 do SQL query and return an iterator with the data, I suppose my
 controller servlet must call the beans and give the jsp access to this
 iterator. My JSP page will dynamically build XML file, but i don't
 know how to call the transformation of the XML data with a XSL file to
 build my final html layout.
 
 Can you help me ?
 
 
 Frédéric Houbie
 Internet Project Manager
 
 ABSIS-GROUP SA
 Centre Socran
 Av Pré Aily, 8
 B-4031 Angleur
 Tel : +32 4 367 89 64
 Fax : +32 4 367 89 63
 
  DISCLAIMER 
 
 This e-mail and any attachments thereto may contain information which
 is confidential and/or protected by intellectual property rights and
 are intended for the sole use of the recipient(s) named above. Any use
 of the information contained herein (including, but not limited to,
 total or partial reproduction, communication or distribution in any
 form) by persons other than the designated recipient(s) is prohibited.
 If you have received this e-mail in 

Generic pooling vs Poolman

2001-09-24 Thread Craig_Reichenbach


Hi, I created a basic Struts prototype web application that creates, edits,
and searches for users.  I then used Microsoft Web Application Stres Tool
(WAST) to test the performance of the Generic pool vs. Poolman connection
pooling.  I am using an Oracle DB (8.1.6). WAST logs into the app, searches
for a user, editsthe user, and logs out using 1 thread for 1 minute.
Connections were gotten in the Action servlets and passed to DB methods
like so:

Example:
conn= DBUtil.getConnection();
user  = DBUtil.validateUser( conn, username, password );

All connections, ResultSets, Statements, etc. are closed in finally blocks.

When testing the app using Poolman, the app performs fine.  When using the
generic pooling from struts, the application makes it until there are under
10 seconds remaining and begins throwing the following SQL exception:

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
 at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
 at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:118)
 at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:426)
 at oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:288)
 at oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:307)
 at
oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStatement.java:191)
 at
oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStatement.java:174)
 at
oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:339)
 at
org.apache.struts.util.GenericConnection.prepareStatement(GenericConnection.java:509)
 at com.mystuff.db.DBUtil.getUser(DBUtil.java:198)
 at com.mystuff.action.EditUserAction.perform(EditUserAction.java:66)
 at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
 at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
 at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 snip

So I guess I'll be using Poolman!  I wonder what is going wrong when I use
Struts pooling?

Here are the relavant data-source settings which echo equivalent Poolman
settings:

 set-property property=autoCommit value=true/
  set-property property=description value=struts proto Data Source
Configuration/
  set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
  set-property property=maxCount value=20/
  set-property property=minCount value=2/


-Craig




link with dynamic page attribute

2001-09-24 Thread Antonio Lourinho

Hi,

i'm new to Struts and i'm already working on a project that takes advantage
of it.

The problem is: i'm trying to put a link, and the page attribute depends
upon the value of a bean defined by an iterate tag.

something like:

html:link
page=/ServiceReport.do?operation=deleteoperationActivityId=bean:getProper
ty name=activity property=id//

the error is:

org.apache.jasper.compiler.ParseException:
C:\Dev\Projectos\ControloHoras\web_app\ServiceReport.jsp(171,115) Attribute
activity has no value

Does anybody have a clue?

Antonio - Portugal


_
  INTERNET MAIL FOOTER 
A presente mensagem pode conter informação considerada confidencial.
Se o receptor desta mensagem não for o destinatário indicado, fica
expressamente proibido de copiar ou endereçar a mensagem a terceiros.
Em tal situação, o receptor deverá destruir a presente mensagem e por
gentileza informar o emissor de tal facto.
-
Privileged or confidential information may be contained in this
message. If you are not the addressee indicated in this message, you
may not copy or deliver this message to anyone. In such case, you
should destroy this message and kindly notify the sender by reply
email.
-




Re: link with dynamic page attribute

2001-09-24 Thread Matt Raible

You cannot next tags as you are trying to do.

My advice would be to make a forward in your struts-config.xml file that is:

forward name=editServiceReport path=/ServiceReport.do?operation=delete /

Then in your jsp page, you can code your link using a regular a href tag:

a href=html:rewrite forward=editServiceReport
/operationActivityId=bean:write name=activity property=id/link
text/a

This has worked for me.

Matt
--- Antonio Lourinho [EMAIL PROTECTED] wrote:
 Hi,
 
 i'm new to Struts and i'm already working on a project that takes advantage
 of it.
 
 The problem is: i'm trying to put a link, and the page attribute depends
 upon the value of a bean defined by an iterate tag.
 
 something like:
 
 html:link
 page=/ServiceReport.do?operation=deleteoperationActivityId=bean:getProper
 ty name=activity property=id//
 
 the error is:
 
 org.apache.jasper.compiler.ParseException:
 C:\Dev\Projectos\ControloHoras\web_app\ServiceReport.jsp(171,115) Attribute
 activity has no value
 
 Does anybody have a clue?
 
 Antonio - Portugal
 
 
 _
   INTERNET MAIL FOOTER 
 A presente mensagem pode conter informação considerada confidencial.
 Se o receptor desta mensagem não for o destinatário indicado, fica
 expressamente proibido de copiar ou endereçar a mensagem a terceiros.
 Em tal situação, o receptor deverá destruir a presente mensagem e por
 gentileza informar o emissor de tal facto.
 -
 Privileged or confidential information may be contained in this
 message. If you are not the addressee indicated in this message, you
 may not copy or deliver this message to anyone. In such case, you
 should destroy this message and kindly notify the sender by reply
 email.
 -
 


__
Do You Yahoo!?
Get email alerts  NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com



Re: Generic pooling vs Poolman

2001-09-24 Thread Ted Husted

Personally, I would strongly recommend that people use Poolman or the
equivalent in production applications. 

It's also possible that the generic connection pool will be deprecated
at some point, once a similar package becomes available through the
commons, and it becomes easier to hook new services up to Struts using
Oleg's ServiceManager. (The connection pool debacle is why we setup the
commons in the first place ;-0)

I often have misgivings about the GenericPool being part of the Struts
distribution, since it encourages people to tie the HTTP layer with the
resource layer. What I like about Poolman is that I can setup a
ConnectionPool class that returns the connection, without tying it to
the ServletContext in any way. 

import java.sql.Connection;
import java.sql.SQLException;
import javax.sql.DataSource;
import com.codestudio.sql.PoolMan;

public final class ConnectionPool {

/**
 * An exception message to throw if datasource is null.
 */
public static final String DATASOURCE_ERROR = Connection pool  +
not available. Check your poolman.xml config, and be sure  +
 you are using a valid dbname parameter (use dbname, not
jndiName);

/**
 * The application scope attribute under which our JNDI datasource
 * is stored.
 */
public static final String JNDI_DATASOURCE_KEY = articles;

/**
 * Returns a JDBC connection from a connection pool or other
 * resource, to be used and closed promptly.
 * p
 * @returns JDBC connection from resource layer.
 * @exception SQLException on SQL or other errors. May wrap other
 * exceptions depending on implementation. Will not return null.
 */
public static final Connection getConnection() throws SQLException {
DataSource ds = PoolMan.findDataSource(JNDI_DATASOURCE_KEY);
if (ds==null)
throw new SQLException(DATASOURCE_ERROR);
return(ds.getConnection());
}
}


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


[EMAIL PROTECTED] wrote:
 
 Hi, I created a basic Struts prototype web application that creates, edits,
 and searches for users.  I then used Microsoft Web Application Stres Tool
 (WAST) to test the performance of the Generic pool vs. Poolman connection
 pooling.  I am using an Oracle DB (8.1.6). WAST logs into the app, searches
 for a user, editsthe user, and logs out using 1 thread for 1 minute.
 Connections were gotten in the Action servlets and passed to DB methods
 like so:
 
 Example:
 conn= DBUtil.getConnection();
 user  = DBUtil.validateUser( conn, username, password );
 
 All connections, ResultSets, Statements, etc. are closed in finally blocks.
 
 When testing the app using Poolman, the app performs fine.  When using the
 generic pooling from struts, the application makes it until there are under
 10 seconds remaining and begins throwing the following SQL exception:
 
 java.sql.SQLException: ORA-01000: maximum open cursors exceeded
 
  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
  at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
  at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:118)
  at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:426)
  at oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:288)
  at oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:307)
  at
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStatement.java:191)
  at
 oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStatement.java:174)
  at
 oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:339)
  at
 org.apache.struts.util.GenericConnection.prepareStatement(GenericConnection.java:509)
  at com.mystuff.db.DBUtil.getUser(DBUtil.java:198)
  at com.mystuff.action.EditUserAction.perform(EditUserAction.java:66)
  at
 org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
  at
 org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
  at
 org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  snip
 
 So I guess I'll be using Poolman!  I wonder what is going wrong when I use
 Struts pooling?
 
 Here are the relavant data-source settings which echo equivalent Poolman
 settings:
 
  set-property property=autoCommit value=true/
   set-property property=description value=struts proto Data Source
 Configuration/
   set-property property=driverClass value
 =oracle.jdbc.driver.OracleDriver/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/
 
 -Craig



RE: link with dynamic page attribute

2001-09-24 Thread Martin, Margaret

Antonio -
Unfortunately you cannot nest tags... you'll have to resort to a scriptlet
in this case:
html:link
page=/ServiceReport.do?operation=deleteoperationActivityId=%=activity.get
Id()%/
This seems to be something that everyone intuitively wants to do - hopefully
the capability will be added in a later jsp spec...

a second option is to put all of the parameters in a map (just as an
illustration):
% HashMap requestParamMapBean = new HashMap();
requestParamMapBean.put(operation, delete);
requestParamMapBean.put(operationActivityId, activity.getId());
%

html:link page=/ServiceReport.do name = requestParamMapBean/

Hope this helps -
Margaret Martin

-Original Message-
From: Antonio Lourinho [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 11:00 AM
To: [EMAIL PROTECTED]
Subject: link with dynamic page attribute


Hi,

i'm new to Struts and i'm already working on a project that takes advantage
of it.

The problem is: i'm trying to put a link, and the page attribute depends
upon the value of a bean defined by an iterate tag.

something like:

html:link
page=/ServiceReport.do?operation=deleteoperationActivityId=bean:getProper
ty name=activity property=id//

the error is:

org.apache.jasper.compiler.ParseException:
C:\Dev\Projectos\ControloHoras\web_app\ServiceReport.jsp(171,115) Attribute
activity has no value

Does anybody have a clue?

Antonio - Portugal


_
  INTERNET MAIL FOOTER 
A presente mensagem pode conter informação considerada confidencial.
Se o receptor desta mensagem não for o destinatário indicado, fica
expressamente proibido de copiar ou endereçar a mensagem a terceiros.
Em tal situação, o receptor deverá destruir a presente mensagem e por
gentileza informar o emissor de tal facto.
-
Privileged or confidential information may be contained in this
message. If you are not the addressee indicated in this message, you
may not copy or deliver this message to anyone. In such case, you
should destroy this message and kindly notify the sender by reply
email.
-



how to capture html

2001-09-24 Thread Brian K. Buckley

Is there a good way to capture the output from a snippet of jsp into a
String variable that can be reused multiple times in a page?

- Brian

As a simple example, if one needed to have the line:

trth align='left' Name/thtd align='right' html:text
property='name'//td/tr

appear in several places, how can one set a String namerow so that the line
can be redisplayed by saying %=namerow% instead of repeating the whole
snippet?  Note that the snippet includes a custom tag.






Re: java.lang.NoClassDefFoundError: org/apache/struts/action/ActionFo rm

2001-09-24 Thread Peter Pilgrim



YES! I fixed the problem because I changed the startup.sh tomcat script
previously before Struts to include various jars. I should n't have done that.
but copied the proprietary jars in WEB-INF/classes instead. In fact
the Tomcat 3.3 blanks the CLASSPATH and sets only libraries that
appear under $TOMCAT_HOME/common/lib etc. In the older Tomcat 3.2
release this did not  happen, and probably the cause of many class not found
exceptions.

Moral: upgrade to Tomcat 3.3 and move out all project specifics jars from
$TOMCAT_HOME/common/lib.  into WEB-INF/lib. If you want tom use updated
Xerces PArser then you should copy the xerces.jar into $TOMCAT_HOME/common/lib

Moral:Check your classpaths.
--
Peter Pilgrim  |  |++44 (0)207-545-9923
 \  \  ___   /  / ... .
-     ( * )  ---   --
_Cafe_Savannah,_San Antonio,Ibiza__



 Message History 



From: [EMAIL PROTECTED] on 24/09/2001 11:17 EST

To:   Peter Pilgrim/DMGIT/DMG UK/DeuBa@DMG UK
cc:
Subject:  java.lang.NoClassDefFoundError: org/apache/struts/action/ActionFo rm


Hi Peter --

Did you ever correct this error...

java.lang.NoClassDefFoundError: org/apache/struts/action/ActionForm

I'm having the same problem and cannot find a firm answer to what is
happening. I have struts.jar in myapp/WEB-INF/lib. Any help is greatly
appreciated.





--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorized copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.





Re: security question

2001-09-24 Thread Ted Husted

If all the JSP's are behind Actions, the problem is mitigated since the
names of the JSPs are not revealed on the address bar, only the Action
shows. 

One idea would be to generate a request token for each request that
comes through the Action. That could be a dual use features, since you
could use the same token to watch for duplicate submits. You might also
put expects check at the top of the JSPs that use any other attribute
in the request, and redirect them to the Action when the attribute is
missing. That documents what the JSP requires, and provides QA on top of
security.

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


Jonathan M Crater wrote:
 
 i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs underneath 
WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a result,
 i have to secure requests to both JSPs and actions.  securing the actions is just a 
matter of sub-classing ActionServlet and providing logic to check for
 certain secured paths.  the problem is i don't want to repeat the logic in the 
JSPs--either through a tag library or otherwise.  does anyone have any
 suggestions as to how best to prevent a situation where a user requests a JSP page 
directly when it should have gone through the sub-classed
 ActionServlet?  i was thinking of just setting a request parameter for each request 
as it passes through the ActionServlet.  that way, in the JSP i can
 just test for that value to determine whether the request went through the proper 
channel.  if not, i can redirect to an error page.
 
 thoughts?  suggestions?



Re: Generic pooling vs Poolman

2001-09-24 Thread Tom Tibbetts

Or you could just avoid using Microsoft products ;-)

At 12:01 PM 9/24/01 -0400, you wrote:

Hi, I created a basic Struts prototype web application that creates, edits,
and searches for users.  I then used Microsoft Web Application Stres Tool
(WAST) to test the performance of the Generic pool vs. Poolman connection
pooling.  I am using an Oracle DB (8.1.6). WAST logs into the app, searches
for a user, editsthe user, and logs out using 1 thread for 1 minute.
Connections were gotten in the Action servlets and passed to DB methods
like so:

Example:
conn= DBUtil.getConnection();
user  = DBUtil.validateUser( conn, username, password );

All connections, ResultSets, Statements, etc. are closed in finally blocks.

When testing the app using Poolman, the app performs fine.  When using the
generic pooling from struts, the application makes it until there are under
10 seconds remaining and begins throwing the following SQL exception:

java.sql.SQLException: ORA-01000: maximum open cursors exceeded

  at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
  at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208)
  at oracle.jdbc.ttc7.Oopen.receive(Oopen.java:118)
  at oracle.jdbc.ttc7.TTC7Protocol.open(TTC7Protocol.java:426)
  at oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:288)
  at oracle.jdbc.driver.OracleStatement.init(OracleStatement.java:307)
  at
oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStatement.java:191)
  at
oracle.jdbc.driver.OraclePreparedStatement.init(OraclePreparedStatement.java:174)
  at
oracle.jdbc.driver.OracleConnection.prepareStatement(OracleConnection.java:339)
  at
org.apache.struts.util.GenericConnection.prepareStatement(GenericConnection.java:509)
  at com.mystuff.db.DBUtil.getUser(DBUtil.java:198)
  at com.mystuff.action.EditUserAction.perform(EditUserAction.java:66)
  at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1786)
  at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1585)
  at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
  snip

So I guess I'll be using Poolman!  I wonder what is going wrong when I use
Struts pooling?

Here are the relavant data-source settings which echo equivalent Poolman
settings:

  set-property property=autoCommit value=true/
   set-property property=description value=struts proto Data Source
Configuration/
   set-property property=driverClass value
=oracle.jdbc.driver.OracleDriver/
   set-property property=maxCount value=20/
   set-property property=minCount value=2/


-Craig




Re: link with dynamic page attribute

2001-09-24 Thread Ted Husted

Nesting custom tags that way is not allowed by the specification. 

The html:link tag has special properties for assembling hyperlinks from
other beans. It can also accept a map when multiple parameters are
needed. 

http://jakarta.apache.org/struts/struts-html.html#link

Personally, I avoid using the page= property, and like to use only
forward= instead. That way everything is documented in the configuration
file.

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



Antonio Lourinho wrote:
 
 Hi,
 
 i'm new to Struts and i'm already working on a project that takes advantage
 of it.
 
 The problem is: i'm trying to put a link, and the page attribute depends
 upon the value of a bean defined by an iterate tag.
 
 something like:
 
 html:link
 page=/ServiceReport.do?operation=deleteoperationActivityId=bean:getProper
 ty name=activity property=id//
 
 the error is:
 
 org.apache.jasper.compiler.ParseException:
 C:\Dev\Projectos\ControloHoras\web_app\ServiceReport.jsp(171,115) Attribute
 activity has no value
 
 Does anybody have a clue?
 
 Antonio - Portugal



re: Struts - XML - XSL

2001-09-24 Thread Alex Colic


Hi,

I don't know if this is what you are looking for but I just purchased a book
from Orielly press that deals with Java and XSLT:

http://www.oreilly.com/catalog/javaxslt/

I don't know how I can implement this with Struts.

Hope this is helpful.

Alex




Re: how to capture html

2001-09-24 Thread Ted Husted

You might want to try this one on the JSP list. The archives are also
quite extensive. 

http://archives.java.sun.com/archives/jsp-interest.html

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


Brian K. Buckley wrote:
 
 Is there a good way to capture the output from a snippet of jsp into a
 String variable that can be reused multiple times in a page?
 
 - Brian
 
 As a simple example, if one needed to have the line:
 
 trth align='left' Name/thtd align='right' html:text
 property='name'//td/tr
 
 appear in several places, how can one set a String namerow so that the line
 can be redisplayed by saying %=namerow% instead of repeating the whole
 snippet?  Note that the snippet includes a custom tag.



Re: how to capture html

2001-09-24 Thread Gregor Rayman

Brian K. Buckley [EMAIL PROTECTED] wrote:


 Is there a good way to capture the output from a snippet of jsp into a
 String variable that can be reused multiple times in a page?
 
 - Brian
 
 As a simple example, if one needed to have the line:
 
 trth align='left' Name/thtd align='right' html:text
 property='name'//td/tr
 
 appear in several places, how can one set a String namerow so that the line
 can be redisplayed by saying %=namerow% instead of repeating the whole
 snippet?  Note that the snippet includes a custom tag.

Not really. The only way I know, is to enclose the snippet into a method
with a variable called out. HTML in JSP will be translated into

out.print();


--
gR








Re: security question

2001-09-24 Thread steven . valin

Can anybody tell me if this issue of RequestDispatching to JSPs under WebLogic 5.1 
also exists for WebLogic 6.0+?

On Mon, 24 September 2001, Ted Husted wrote:

 
 If all the JSP's are behind Actions, the problem is mitigated since the
 names of the JSPs are not revealed on the address bar, only the Action
 shows. 
 
 One idea would be to generate a request token for each request that
 comes through the Action. That could be a dual use features, since you
 could use the same token to watch for duplicate submits. You might also
 put expects check at the top of the JSPs that use any other attribute
 in the request, and redirect them to the Action when the attribute is
 missing. That documents what the JSP requires, and provides QA on top of
 security.
 
 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel +1 716 737-3463
 -- http://www.husted.com/about/struts/
 
 
 Jonathan M Crater wrote:
  
  i'm using weblogic 5.1, which does not allow RequestDispatching to JSPs underneath 
WEB-INF.  so i'm stuck keeping my JSPs outside WEB-INF.  as a result,
  i have to secure requests to both JSPs and actions.  securing the actions is just 
a matter of sub-classing ActionServlet and providing logic to check for
  certain secured paths.  the problem is i don't want to repeat the logic in the 
JSPs--either through a tag library or otherwise.  does anyone have any
  suggestions as to how best to prevent a situation where a user requests a JSP page 
directly when it should have gone through the sub-classed
  ActionServlet?  i was thinking of just setting a request parameter for each 
request as it passes through the ActionServlet.  that way, in the JSP i can
  just test for that value to determine whether the request went through the proper 
channel.  if not, i can redirect to an error page.
  
  thoughts?  suggestions?

--
Steven Valin
[EMAIL PROTECTED]



Re: Form layout not specified until runtime...

2001-09-24 Thread Tom Tibbetts

Would dbForms be incompatible with Struts

At 11:15 AM 9/24/01 -0400, you wrote:
For an extremely database driven application, I'd take a look at
dbForms.org

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

  Jonas Bonér wrote:
 
  Hi everyone.
 
  We am building an extremely database driven system where everything
  (the JSP layout for example)
  is suppose to be dynamically generated in runtime.
  For example. We do not know in advance how many input fields we are
  going to present to the user.
  This means that it is not possible to define a XXXForm JavaBean that
  has exactly these input fields.
 
  Is there a way to meet these demands but still be able to use Struts?
 
  Regards.
  /Jonas Bonèr




Re: how to capture html

2001-09-24 Thread Matt Raible

%
BodyContent bc = pageContext.pushBody();
%
trth align='left' Name/thtd align='right' html:text
property='name'//td/tr
%
String namerow = bc.getString();
pageContext.popBody();
%

Matt

--- Brian K. Buckley [EMAIL PROTECTED] wrote:
 Is there a good way to capture the output from a snippet of jsp into a
 String variable that can be reused multiple times in a page?
 
 - Brian
 
 As a simple example, if one needed to have the line:
 
 trth align='left' Name/thtd align='right' html:text
 property='name'//td/tr
 
 appear in several places, how can one set a String namerow so that the line
 can be redisplayed by saying %=namerow% instead of repeating the whole
 snippet?  Note that the snippet includes a custom tag.
 
 
 


__
Do You Yahoo!?
Get email alerts  NEW webcam video instant messaging with Yahoo! Messenger. 
http://im.yahoo.com



Help with Struts and EJBS..

2001-09-24 Thread Strichartz, Beth

Hi,
I need some serious help.
I am a novice Java and Struts developer.
I am trying to develope a prototype that will work with backend EJBS..

I have an CustomerSearchForm, Form bean and  action bean
my Action class is below. 

Questions?
1) Is this the appropriate way to call EJBS (in an action class)?? 
2) How do I get what is returned from the EJB back into my actionform bean?
3) If I want a list of matching customers retruned...what is the best format
for these to be returned from the EJB so that I can
forward to another jsp and show them..  Currently the EJB is returning a
string.
4) Is there any sample applications out there that I can look at that use
EJBs?

Thanks in advance for ANY help.
Beth.


public ActionForward perform
(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) 
{   
ActionForward fwdAction = null;
CustomerSearchForm searchForm = (CustomerSearchForm) form;
try {

// Get an InitialContext
Properties initProps = new Properties();
initProps.put (Context.INITIAL_CONTEXT_FACTORY, 
weblogic.jndi.WLInitialContextFactory);
initProps.put(Context.PROVIDER_URL,  
t3://yshen:7001);
Context ctx =  new InitialContext(initProps);

Object home = (CustomerFacadeHome)
ctx.lookup(sov/CustomerFacade);
CustomerFacadeHome customerFacadeHome = (CustomerFacadeHome)
PortableRemoteObject.narrow
(home, CustomerFacadeHome.class);

CustomerFacade facade = (CustomerFacade)
PortableRemoteObject.narrow
(customerFacadeHome.create(), CustomerFacade.class);

String[] found  = facade.findCustomer
(searchForm.getCustomerName (), 
searchForm.getSsn (), searchForm.getAlphaKey (), 
searchForm.getBank ());

for (int i=0; ifound.length; i++) {
System.out.println (\t[ + i + ]\t + found[i]);
}
fwdAction = mapping.findForward (success);
} catch (Exception e) {

e.printStackTrace ();
fwdAction = mapping.findForward (failed);
}

return fwdAction;
}




This message contains information which may be confidential and privileged.
Unless you are the addressee  (or authorized to receive for the addressee),
you may not use, copy or disclose to anyone the message or any information
contained in the message.  If you have received the message in error, please
advise the sender by reply e-mail, and delete or destroy the message. 

Thank you.




newbe: radio button iteration

2001-09-24 Thread Alex Colic

Hi, I am trying to iterate through a bean and populate a list of radio
buttons. I pass an entity object (en) to a page. The entity object has a
number and name parameter. I want to create a list of radio buttons all with
the same name but the values being the entity number.
For example:

 input type=radio name=entityNumber value=123 1996 DODGE DAKOTA
PICK-UP TRUCK
 input type=radio name=entityNumber value=234 1996 DODGE BUS

I have tried the following:

logic:iterate id=en name=entitySearchList scope=request 
TR
  TD CLASS=TD_Border
  html:radio name=en property=entityNumber value=bean:write name=en
property=entityNumber /   /
  /TD

  TD CLASS=TD_Border
bean:write name=en property=entityName /
  /TD

/logic:iterate

The above obviously does not work. I would appreciate it if someone could
lend me a hand.

Thanks

Alex





Re: how to capture html

2001-09-24 Thread John Raley

This might be useful:

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

Brian K. Buckley wrote:

Is there a good way to capture the output from a snippet of jsp into a
String variable that can be reused multiple times in a page?

- Brian

As a simple example, if one needed to have the line:

trth align='left' Name/thtd align='right' html:text
property='name'//td/tr

appear in several places, how can one set a String namerow so that the line
can be redisplayed by saying %=namerow% instead of repeating the whole
snippet?  Note that the snippet includes a custom tag.









using the Parameter of config

2001-09-24 Thread Elmar Zorn (H2Opilot)

hi all,

I try to use an parameter of my struts.config

actionpath=/h2okoop_uebersicht
   type=h2ouapp.H2okoop_Uebersicht_a
   name=h2okoop_eingabe_f
   scope=session
   parameter=hello
   validate=false
forward   name=Koopuebersicht_ok path=/h2okoop_uebersicht.jsp/
/action


I try to access the parameter in the action like this:

import javax.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import org.apache.struts.action.*;
import org.apache.struts.util.*;

public final class H2okoop_Uebersicht_a extends Action  {


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

   String parameter = mapping.getParameter();


And when I compile i get this fault:

H2okoop_Uebersicht_a.java:23: cannot resolve symbol
symbol  : method getParameter  ()
location: class org.apache.struts.action.ActionMapping
 String parameter = mapping.getParameter();

So where is the problem??

thanks




RE: Help with Struts and EJBS..

2001-09-24 Thread Barry Glasco

1) No, but it will work. Look at previous posts on how to properly
implement.
2) Your form should have get and set methods?
3) Collection
4) None that I am aware of.

-Original Message-
From: Strichartz, Beth [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: Help with Struts and EJBS..


Hi,
I need some serious help.
I am a novice Java and Struts developer.
I am trying to develope a prototype that will work with backend EJBS..

I have an CustomerSearchForm, Form bean and  action bean
my Action class is below.

Questions?
1) Is this the appropriate way to call EJBS (in an action class)??
2) How do I get what is returned from the EJB back into my actionform bean?
3) If I want a list of matching customers retruned...what is the best format
for these to be returned from the EJB so that I can
forward to another jsp and show them..  Currently the EJB is returning a
string.
4) Is there any sample applications out there that I can look at that use
EJBs?

Thanks in advance for ANY help.
Beth.


public ActionForward perform
(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
ActionForward fwdAction = null;
CustomerSearchForm searchForm = (CustomerSearchForm) form;
try {

// Get an InitialContext
Properties initProps = new Properties();
initProps.put (Context.INITIAL_CONTEXT_FACTORY,
weblogic.jndi.WLInitialContextFactory);
initProps.put(Context.PROVIDER_URL,
t3://yshen:7001);
Context ctx =  new InitialContext(initProps);

Object home = (CustomerFacadeHome)
ctx.lookup(sov/CustomerFacade);
CustomerFacadeHome customerFacadeHome = (CustomerFacadeHome)
PortableRemoteObject.narrow
(home, CustomerFacadeHome.class);

CustomerFacade facade = (CustomerFacade)
PortableRemoteObject.narrow
(customerFacadeHome.create(), CustomerFacade.class);

String[] found  = facade.findCustomer
(searchForm.getCustomerName (),
searchForm.getSsn (), searchForm.getAlphaKey (),
searchForm.getBank ());

for (int i=0; ifound.length; i++) {
System.out.println (\t[ + i + ]\t + found[i]);
}
fwdAction = mapping.findForward (success);
} catch (Exception e) {

e.printStackTrace ();
fwdAction = mapping.findForward (failed);
}

return fwdAction;
}




This message contains information which may be confidential and privileged.
Unless you are the addressee  (or authorized to receive for the addressee),
you may not use, copy or disclose to anyone the message or any information
contained in the message.  If you have received the message in error, please
advise the sender by reply e-mail, and delete or destroy the message.

Thank you.





RE: Help with Struts and EJBS..

2001-09-24 Thread Mike Dewhirst

 I need some serious help.
 I am a novice Java and Struts developer.
 I am trying to develope a prototype that will work with backend EJBS..

taken those 3 into account, I think you really do need serious help. Not
being funny, but usually people either working with other experienced
developers or simply with a few years of Java and some EJB exposure should
be endevouring with such a task.

 1) Is this the appropriate way to call EJBS (in an action class)?? 

yes, it's fine to call EJB's from the action class.

 2) How do I get what is returned from the EJB back into my actionform
bean?

you (presumably) will get back an object/collection of data back from the
EJB. you can parse it and populatev the form with it/add to the request -
then pull it out in the jsp with the struts cust tags.


 3) If I want a list of matching customers retruned...what is the best
format
 for these to be returned from the EJB so that I can
 forward to another jsp and show them..  Currently the EJB is returning a
 string.

see above. To reiterate, put it an Collection (ArrayList for example) or in
a custom Object (JavaBean.. not Enterprise Java Bean!!)

 4) Is there any sample applications out there that I can look at that use
 EJBs?

as far as I know not of Struts/EJB. Weblogic comes with a good load of
examples, so does the Struts install.


Mike


===
Thanks in advance for ANY help.
Beth.


public ActionForward perform
(ActionMapping mapping, ActionForm form, 
HttpServletRequest request, HttpServletResponse response) 
{   
ActionForward fwdAction = null;
CustomerSearchForm searchForm = (CustomerSearchForm) form;
try {

// Get an InitialContext
Properties initProps = new Properties();
initProps.put (Context.INITIAL_CONTEXT_FACTORY, 
weblogic.jndi.WLInitialContextFactory);
initProps.put(Context.PROVIDER_URL,  
t3://yshen:7001);
Context ctx =  new InitialContext(initProps);

Object home = (CustomerFacadeHome)
ctx.lookup(sov/CustomerFacade);
CustomerFacadeHome customerFacadeHome = (CustomerFacadeHome)
PortableRemoteObject.narrow
(home, CustomerFacadeHome.class);

CustomerFacade facade = (CustomerFacade)
PortableRemoteObject.narrow
(customerFacadeHome.create(), CustomerFacade.class);

String[] found  = facade.findCustomer
(searchForm.getCustomerName (), 
searchForm.getSsn (), searchForm.getAlphaKey (), 
searchForm.getBank ());

for (int i=0; ifound.length; i++) {
System.out.println (\t[ + i + ]\t + found[i]);
}
fwdAction = mapping.findForward (success);
} catch (Exception e) {

e.printStackTrace ();
fwdAction = mapping.findForward (failed);
}

return fwdAction;
}




This message contains information which may be confidential and privileged.
Unless you are the addressee  (or authorized to receive for the addressee),
you may not use, copy or disclose to anyone the message or any information
contained in the message.  If you have received the message in error, please
advise the sender by reply e-mail, and delete or destroy the message. 

Thank you.


=**

If you are not the intended recipient, employee or agent responsible for delivering 
the message to the intended recipient, you are hereby notified that any dissemination 
or copying of this communication and its attachments is strictly prohibited.

If you have received this communication and its attachments in error, please return 
the original message and attachments to the sender using the reply facility on e-mail.

Internet communications are not secure and therefore the UCLES Group does not accept 
legal responsibility for the contents of this message.  Any views or opinions 
presented are solely those of the author and do not necessarily represent those of the 
UCLES Group unless otherwise specifically stated.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses although this does not guarantee that 
this email is virus free.

**=




RE: Help with Struts and EJBS..

2001-09-24 Thread Strichartz, Beth

Thanks,
My from has sets and gets.
I will try to look for previous posted messages..

Beth.
-Original Message-
From: Barry Glasco [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 1:40 PM
To: [EMAIL PROTECTED]
Subject: RE: Help with Struts and EJBS..


1) No, but it will work. Look at previous posts on how to properly
implement.
2) Your form should have get and set methods?
3) Collection
4) None that I am aware of.

-Original Message-
From: Strichartz, Beth [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 1:09 PM
To: [EMAIL PROTECTED]
Subject: Help with Struts and EJBS..


Hi,
I need some serious help.
I am a novice Java and Struts developer.
I am trying to develope a prototype that will work with backend EJBS..

I have an CustomerSearchForm, Form bean and  action bean
my Action class is below.

Questions?
1) Is this the appropriate way to call EJBS (in an action class)??
2) How do I get what is returned from the EJB back into my actionform bean?
3) If I want a list of matching customers retruned...what is the best format
for these to be returned from the EJB so that I can
forward to another jsp and show them..  Currently the EJB is returning a
string.
4) Is there any sample applications out there that I can look at that use
EJBs?

Thanks in advance for ANY help.
Beth.


public ActionForward perform
(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
ActionForward fwdAction = null;
CustomerSearchForm searchForm = (CustomerSearchForm) form;
try {

// Get an InitialContext
Properties initProps = new Properties();
initProps.put (Context.INITIAL_CONTEXT_FACTORY,
weblogic.jndi.WLInitialContextFactory);
initProps.put(Context.PROVIDER_URL,
t3://yshen:7001);
Context ctx =  new InitialContext(initProps);

Object home = (CustomerFacadeHome)
ctx.lookup(sov/CustomerFacade);
CustomerFacadeHome customerFacadeHome = (CustomerFacadeHome)
PortableRemoteObject.narrow
(home, CustomerFacadeHome.class);

CustomerFacade facade = (CustomerFacade)
PortableRemoteObject.narrow
(customerFacadeHome.create(), CustomerFacade.class);

String[] found  = facade.findCustomer
(searchForm.getCustomerName (),
searchForm.getSsn (), searchForm.getAlphaKey (),
searchForm.getBank ());

for (int i=0; ifound.length; i++) {
System.out.println (\t[ + i + ]\t + found[i]);
}
fwdAction = mapping.findForward (success);
} catch (Exception e) {

e.printStackTrace ();
fwdAction = mapping.findForward (failed);
}

return fwdAction;
}




This message contains information which may be confidential and privileged.
Unless you are the addressee  (or authorized to receive for the addressee),
you may not use, copy or disclose to anyone the message or any information
contained in the message.  If you have received the message in error, please
advise the sender by reply e-mail, and delete or destroy the message.

Thank you.



This message contains information which may be confidential and privileged.
Unless you are the addressee  (or authorized to receive for the addressee),
you may not use, copy or disclose to anyone the message or any information
contained in the message.  If you have received the message in error, please
advise the sender by reply e-mail, and delete or destroy the message. 

Thank you.




Reusable/composable Struts components?

2001-09-24 Thread Gary Johnston

How do folks generally approach building reusable or composable Struts
components?  I'm thinking about a situation where I'd like to define a
reusable sequence (not necessarily linear) of Struts JSPs/actions that can
be invoked as kind of a black box from some other part of the Struts
application and can be told where to transfer control to when done.

For example, let's say I'm building a Struts application that consists of
several possible services an end-user might want to use, so I have a main
menu page that has a link for each service (like, say, .../service1.do,
.../service2.do, etc.).  Now, let's say that each service requires that
the user be logged on, so each corresponding Action subclass' perform(...)
method needs to check the logon state of the current user and, if they're
not already logged on, route them to the logon sequence.  I'd like to factor
out that whole mess into a reusable ensure the user is logged on sequence.
I'd like to be able to invoke it from any Action that needs it, have it do
its thing, and then proceed on to the main functionality of the service.

Problem is, Struts forwards are essentially absolute gotos (albeit with a
level of indirection through the Struts config. file).  When I am coding,
say, the last action in my ensure the user is logged on sequence, I have
to return a forward that essentially says where to go next.  I'd rather be
able to return a forward (or code something else) that means, basically, go
to wherever whatever invoke me wanted me to go when I'm done.  Obviously,
this would require whatever invoked it to somehow record that information
when/before it did so.

An ad hoc solution is possible for any specific one-off situation, of
course,  but I'm interested in a more general solution (which would need to
involve a stack of some kind to support arbitrary nesting).  I can think of
a few possible general approaches, but surely others have had to deal with
this issue.  What approach did you use and how do you like it?

BTW, it seems like it may be that the proposed workflow support will start
to address this issue, but I'm wondering what people are doing today.

Gary Johnston
IBM Software Group, Research Triangle Park, NC





RE: Struts JBoss / Tomcat and Form

2001-09-24 Thread Nortje, Andrew
Title: Struts JBoss / Tomcat and From









Gregory



Have you got any examples on how to use
nested properties? My initial assumption would be to use public attributes in
the form bean and multiple dot operators in the .jsp
to populate the fields?





-Original Message-
From: Gregor Rayman
[mailto:[EMAIL PROTECTED]] 
Sent: Thursday, September 20, 2001
5:53 PM
To: [EMAIL PROTECTED]
Subject: Re: Struts JBoss / Tomcat
and From





Why do you use ActionForm as value object in EJB? I
thnik, this is not a clean design,





since you make your EJB code dependent on Struts.
Struts beloongs to the web layer, 





EJB to the businness layer. Your EJB do not need
things like HttpRequest, so'd try





to make them independet from the servlet.* package.











I'd suggest a simple redesign. Use simple beans as
value object and nest them in 





your action forms. Struts supports nested properties,
so will not need to create





delegating propertry setters and getters in your
action form. (unless you want to





do some conversions - ActionForms' properties should
be string based, value objects





should use the real type of the property)











--





gR

















P.S.: Of course it would be nice, if struts.jar could
be installed in server scope





instead of application scope. I suppose, it would need
some changes in the class





loading in ActionServlet.













- Original Message - 





From: Nortje, Andrew 





To: '[EMAIL PROTECTED]' 





Sent: Thursday,
September 20, 2001 10:50 PM





Subject: Struts
JBoss / Tomcat and From









I have deployed my app using JBoss/Tomcat. I recently
started using the ActionForm as value objects in my EJB's. JBoss now needs
struts.jar in the class path, so it can find ActionForm, so I put sturts.jar in
JBOSS_HOME/lib/ext. This works fine put it kills struts. Struts now throws a
ClassNotFoundException for my ActionForm's. 

If I remove the stuts.jar from the JBoss class path
JBoss dies and struts works again. 

Anyone got some advice for me here? 

Thanks in advance. 

Andrew 



This is the exception that get thrown by Tomcat


Error: 500 
Location:
/jazzman/contact/details/address.jsp 
Internal Servlet Error:


javax.servlet.ServletException: Exception creating
bean of class com.jazzman.contact.details.view.AddressValue:
java.lang.ClassNotFoundException: com.jazzman.contact.details.view.AddressValue

 at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)

 at
contact.details._0002fcontact_0002fdetails_0002faddress_0002ejspaddress_jsp_0._jspService(_0002fcontact_0002fdetails_0002faddress_0002ejspaddress_jsp_0.java:409)

 at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)

 at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)

 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)

 at org.apache.tomcat.core.Handler.service(Handler.java:287)

 at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)

 at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)

 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)

 at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

 at java.lang.Thread.run(Unknown Source) 

Root cause: 
javax.servlet.jsp.JspException:
Exception creating bean of class com.jazzman.contact.details.view.AddressValue:
java.lang.ClassNotFoundException: com.jazzman.contact.details.view.AddressValue

 at
org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:527)

 at contact.details._0002fcontact_0002fdetails_0002faddress_0002ejspaddress_jsp_0._jspService(_0002fcontact_0002fdetails_0002faddress_0002ejspaddress_jsp_0.java:95)

 at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 at
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

 at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)

 at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)

 at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)

 at 

transaction control mechanism (multi submit prevention)

2001-09-24 Thread stephaneg




Hello all.

I have aquestion regarding the postings 
explaining how to correctly use the transaction control mechanism provided 
within struts. Most postings mention that struts will forward you to an error 
page however I haven't been able to find any mention on how to then forward to a verification screen. 

Therefore, let's say that rather than forward to an 
error pageI would prefer it not forward at all and just remain idle 
waiting for the form submission to be processed and the be forwarded to a 
verification page. Another viable option for us is that we forward it to an 
error page, and that once the submission processing is completed it goes on to 
the verification page, but the issue here is that I don't believe it's possible 
to push a page, and even if it was, how would we determine when the processing 
is completed without javascript in the jsp. 

Any advice you could give me would be very 
appreciated as I haven't been able to find a proper solution. Also, as another 
requirement, all this is to be done without the help of any javascript (which by 
the postings all the work seems to be done in the action class anyways with the 
help of the token methods in the Action class).

Regarding my first issue, forward to nowhere, I did 
notice in the ActionAPI that the perform method when returned null should 
ignore the forward ("or 
null if the response has 
already been completed"), however when I implement this I find this is not the 
case. Therefore I'm not sure if I'm reading more into it then I 
should...

Thank you,Stephane Grenier




Struts, VAJ 3.5.3 Websphere Test Environment

2001-09-24 Thread West, Tedie

When I try to run the struts example application, I get the following error
message?
Any ideas ??

Error 503
An error has occured while processing
request:http://localhost:8080/strutsexamples/
Message: Application is currently unavailable for service
Target Servlet: null
StackTrace: 
Root Error-1: Application is currently unavailable for service
com.ibm.servlet.engine.webapp.ApplicationUnavailableException: Application
is currently unavailable for service java.lang.Throwable(java.lang.String)
java.lang.Exception(java.lang.String)
javax.servlet.ServletException(java.lang.String)
com.ibm.websphere.servlet.error.ServletErrorReport(java.lang.String)
com.ibm.servlet.engine.webapp.WebAppErrorReport(java.lang.String)
com.ibm.servlet.engine.webapp.ApplicationUnavailableException(com.ibm.servle
t.engine.webapp.WebApp) void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(c
om.ibm.servlet.engine.webapp.WebAppRequest,
javax.servlet.http.HttpServletResponse, boolean) void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(javax.servlet
.ServletRequest, javax.servlet.ServletResponse, boolean) void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(javax.servlet.
ServletRequest, javax.servlet.ServletResponse) void
com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(java.lang.Obje
ct) void
com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(java.lan
g.Object) void
com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(java.lang.S
tring, com.ibm.servlet.engine.srp.ISRPConnection) void
com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(com.ibm.ser
vlet.engine.oselistener.api.IOSEConnection) void
com.ibm.servlet.engine.http_transport.HttpTransportHandler.handleConnection(
java.net.Socket) void
com.ibm.servlet.engine.http_transport.HttpTransportHandler.run() void
java.lang.Thread.run() 



Tedie West




struts architecture question.

2001-09-24 Thread Alex Colic

Hi,

I am trying to figure out if I have properly designed my classes.

I have a class that extends ActionServlet. The only reason it does that is
because all my web apps need a couple of generic objects in the application
session before anyone can use the applications.

So I overrode the doGet and doPost and init() methods. Examples are below:

public void init() throws javax.servlet.ServletException
  {
super.init();
//do Some Configuration;
  }

public void doGet(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
  {
HttpSession session= request.getSession(true);

*/
if(session.getAttribute(Constants.SERVLET_CONFIG)==null)
  {
session.setAttribute(Constants.SERVLET_CONFIG, configSettings);
  }

/**
* place the rdserver object in the session
*/
if((session.getAttribute(Constants.RDSERVER))==null)
  {
rdServer server=new rdServer(strHost, strPort);
session.setAttribute(Constants.RDSERVER,server);
  }

  super.doGet( request,  response);
  }

I don't know what is wrong with the above it just looks wrong. And, when I
start this app in tomcat I can see that the web app is being parsed and
loaded twice.

Any design tips, comments on the above are appreciated.

Alex




Can you comment on this design idea?

2001-09-24 Thread Alex Colic

Hi,

hopefully someone can comment on an idea I have.

I have a VB backend that I talk to via a socket to handle db access. When a
connection is made to the back end I put a Boolean value of TRUE under the
active key in the application session. If for whatever reason the VB
backend goes down I get the key active and set it to FALSE. I created a
tag that as the user goes from page to page it checks this key and if it is
active it continues displaying the page and if it is not it takes the user
to a generic, back end down page.

A problem I found is that a user could be on a page and submit data to a
servlet. If the backend has gone down while the user has been on a page, the
servlet will not know about it and attempt to do some work. I do not want
this to happen. I want a similar set-up that I have for the pages for the
servlet.

I was thinking of overriding the doGet and Post methods of the ActionServlet
to check if the active key is true. If it is continue passing the request
to the servlets if it is not then send them to a generic, back end not
available page.

Something like this:

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
  {
String errorPage=/serverNotAvailable.jsp;
if(key)
{
//do usual work
}
else
{
RequestDispatcher disp=new request.getRequestDispatcher(errorPage);
disp.forward(request,response);
}

super.doGet(request, response);

any comments are appreciated.

Alex




Re: Postmortem (iterate, wrap, hashtable, nested)

2001-09-24 Thread Luis Olivares

If you want to iterate in the order you inserted your objects in the
collection, try using a java.util.Vector.

Regards
   Luis Olivares.
   [EMAIL PROTECTED]
   --
  Intelligence is the ability to avoid doing
   work, yet getting the work done
  --Linus Torvalds--


- Original Message -
From: Richard Yee [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, September 24, 2001 1:19 AM
Subject: RE: Postmortem (iterate, wrap, hashtable, nested)


 Ali,
 If you want the items to be in a specific order then you need to store
them
 in a Collection that preserves the order.  The HashMap or any other Map
for
 that matter that you are using WILL NOT preserve the order.  You need to
 use an ArrayList instead.

 InvoiceLineItems needs to be stored in an ArrayList.

 -Richard

 At 10:34 PM 9/23/01 -0400, you wrote:
 richard- i appreciate the input. i'd expect it to give back in the
natural
 order, the order in which i put my items. however, something else is
going
 on apparently. --a
 
 -Original Message-
 From: Richard Yee [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, September 23, 2001 3:47 PM
 To: [EMAIL PROTECTED]
 Subject: Re: Postmortem (iterate, wrap, hashtable, nested)
 
 
 Ali,
 You are getting the InvoiceLineItems out of order b/c you are storing
them
 in a Map or Hashtable.  These collections do not preserve the order of
the
 objects as they are inserted into them.  If you want to preserve the
 ordering, you need to use a Collection that implements the List interface
 (ArrayList, LinkedList)  You could use a TreeMap or SortedMap, but these
 would incur more overhead for your application than using a collection
that
 implements the List interface.
 
 -Richard




RE: Can you comment on this design idea?

2001-09-24 Thread Hans Gilde

Alex,

You probably want a connection pool. Your code in an Action class (or
wherever) would be something like:

MyConnection MyConnectionObject;

try {
//get the connection from the pool
MyConnectionObject = MyConnection.getInstance();
//do your stuff
} catch (MyConnectionInvalidException e) {
//error
} catch (MyConnectonInterruptedException e) {
//another error
} finally {
//release the connection back to the pool
MyConnection.releaseInstance(MyConnectionObject);
}

Where MyConnection.getInstance() and releaseInstance are public static
methods of MyConnection; they check the connection before returning it.
There are a couple of open source connection pools that help here. This
technique would be directly portable between a servlet and a GUI
application. It requires a ping before each connection attempt but is
probably worth the overhead.

If you're open to changing the architecture... Why not use SOAP calls to COM
objects running in MTS? There's a more overhead in each invocation but you
get to use neat new technology.


-Original Message-
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 4:14 PM
To: Struts
Subject: Can you comment on this design idea?


Hi,

hopefully someone can comment on an idea I have.

I have a VB backend that I talk to via a socket to handle db access. When a
connection is made to the back end I put a Boolean value of TRUE under the
active key in the application session. If for whatever reason the VB
backend goes down I get the key active and set it to FALSE. I created a
tag that as the user goes from page to page it checks this key and if it is
active it continues displaying the page and if it is not it takes the user
to a generic, back end down page.

A problem I found is that a user could be on a page and submit data to a
servlet. If the backend has gone down while the user has been on a page, the
servlet will not know about it and attempt to do some work. I do not want
this to happen. I want a similar set-up that I have for the pages for the
servlet.

I was thinking of overriding the doGet and Post methods of the ActionServlet
to check if the active key is true. If it is continue passing the request
to the servlets if it is not then send them to a generic, back end not
available page.

Something like this:

public void doPost(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, javax.servlet.ServletException
  {
String errorPage=/serverNotAvailable.jsp;
if(key)
{
//do usual work
}
else
{
RequestDispatcher disp=new request.getRequestDispatcher(errorPage);
disp.forward(request,response);
}

super.doGet(request, response);

any comments are appreciated.

Alex






populating an ActionForm using BeanUtils.populate

2001-09-24 Thread David Boardman

I am attempting to populate an ActionForm from a ValueObject using
BeanUtils.populate().  The ActionForm has all of the appropriately named
setter methods and attributes, and the ValueObject returns a map with keys
corresponding to the attribute names on the ActionForm.  The problem is that
when I place the value of the ValueObject's id attribute (a Long) in the
map, the populate method fails with the following exception:

java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.j
ava:986)
at
org.apache.commons.beanutils.PropertyUtils.setNestedProperty(PropertyUtils.j
ava:902)
at
org.apache.commons.beanutils.PropertyUtils.setProperty(PropertyUtils.java:93
0)
at org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:506)
at
com.integral7.web.durango.CandidateDetailAction.perform(CandidateDetailActio
n.java:118)

It appears that BeanUtils.populate() requires the values in the map to be of
type String or String[], is this true?  If so, should I be converting the id
to a String in the ValueObject.toMap() method?

Thanks,

Dave




Re: using the Parameter of config

2001-09-24 Thread Ted Husted

I don't see anything wrong with the code. Try removing the struts.jar
and replacing it with a new copy.

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


Elmar Zorn (H2Opilot) wrote:
 
 hi all,
 
 I try to use an parameter of my struts.config
 
 actionpath=/h2okoop_uebersicht
type=h2ouapp.H2okoop_Uebersicht_a
name=h2okoop_eingabe_f
scope=session
parameter=hello
validate=false
 forward   name=Koopuebersicht_ok path=/h2okoop_uebersicht.jsp/
 /action
 
 I try to access the parameter in the action like this:
 
 import javax.sql.*;
 import javax.servlet.*;
 import javax.servlet.http.*;
 import org.apache.struts.action.*;
 import org.apache.struts.util.*;
 
 public final class H2okoop_Uebersicht_a extends Action  {
 
   public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
   throws IOException, ServletException {
 
String parameter = mapping.getParameter();
 
 And when I compile i get this fault:
 
 H2okoop_Uebersicht_a.java:23: cannot resolve symbol
 symbol  : method getParameter  ()
 location: class org.apache.struts.action.ActionMapping
  String parameter = mapping.getParameter();
 
 So where is the problem??
 
 thanks



passing reference from page to page

2001-09-24 Thread cahana



I have a search page with some input fields. The values 
the user inputs are stored in my search form bean in the request scope called 
SearchBean. If the search returns 0 results, I send them to a message page 
saying "0 results found" with a link that will take the user back to the search 
page with the original search criteria filled in. Currently, I have hidden 
fields on the message page to pass around the original search criteria. Is 
there a way to pass a reference to the SearchBean from page to page so that I 
wouldn't have to use the hidden fields for every attribute in the 
SearchBean?


Re: Reusable/composable Struts components?

2001-09-24 Thread Ted Husted

People typically subclass the Action or the ActionServlet. 

Subclassing the Action can be advantageous when some Actions require a
login and others do not. The protected Actions can share a common
subclass that forward to login when someone is not logged in.

The Logged-In ancestor class might do something like this:

// -- isLoggedOn? 
HttpSession session = request.getSession();
Bean logonBean = (Bean)
session.getAttribute(Constants.LOGON_KEY);
if ((logonBean == null) {
session.setAttribute(Constants.ROUTE_TO_KEY,request);
return (mapping.findForward(logon));
}

// -- isCancelled?
if (isCancelled(request))
return (mapping.findForward(cancel));

return null;

And a subclass requiring login would do something like:

// -- Check Login
ActionForward actionForward =
super.perform(mapping,form,request,response);
if (actionForward!=null) return actionForward;

In this example, a logon bean has been placed in the user's session.
This could be any sort of bean, and not linked to the HTTP layer, and
actually be a business logic, or application logic bean. 

A similar approach would be to place service beans in the application
context, and access them through special methods in your application's
ancestor Action. This way, the components are not only reusable between
Struts Actions, but also in other environments (e.g. Swing, another
framework). The Action should simply be an adapter between the HTTP
layer and your components. This will become even easier to do as
development progresses on Oleg's ServiceManager. 

The service bean approach presumes that the (multi-threaded) service
beans do not store any data, and whatever data is required is passed to
them from the Action. This is a place where the workflow proposal's
Context objects could be useful. 

For more about securing Actions, see also Nic Hobb's Role-Based Actions. 

http://husted.com/about/struts/struts-security.htm

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


Gary Johnston wrote:
 
 How do folks generally approach building reusable or composable Struts
 components?  I'm thinking about a situation where I'd like to define a
 reusable sequence (not necessarily linear) of Struts JSPs/actions that can
 be invoked as kind of a black box from some other part of the Struts
 application and can be told where to transfer control to when done.
 
 For example, let's say I'm building a Struts application that consists of
 several possible services an end-user might want to use, so I have a main
 menu page that has a link for each service (like, say, .../service1.do,
 .../service2.do, etc.).  Now, let's say that each service requires that
 the user be logged on, so each corresponding Action subclass' perform(...)
 method needs to check the logon state of the current user and, if they're
 not already logged on, route them to the logon sequence.  I'd like to factor
 out that whole mess into a reusable ensure the user is logged on sequence.
 I'd like to be able to invoke it from any Action that needs it, have it do
 its thing, and then proceed on to the main functionality of the service.
 
 Problem is, Struts forwards are essentially absolute gotos (albeit with a
 level of indirection through the Struts config. file).  When I am coding,
 say, the last action in my ensure the user is logged on sequence, I have
 to return a forward that essentially says where to go next.  I'd rather be
 able to return a forward (or code something else) that means, basically, go
 to wherever whatever invoke me wanted me to go when I'm done.  Obviously,
 this would require whatever invoked it to somehow record that information
 when/before it did so.
 
 An ad hoc solution is possible for any specific one-off situation, of
 course,  but I'm interested in a more general solution (which would need to
 involve a stack of some kind to support arbitrary nesting).  I can think of
 a few possible general approaches, but surely others have had to deal with
 this issue.  What approach did you use and how do you like it?
 
 BTW, it seems like it may be that the proposed workflow support will start
 to address this issue, but I'm wondering what people are doing today.
 
 Gary Johnston
 IBM Software Group, Research Triangle Park, NC



validate() fails to re-populate the html:form

2001-09-24 Thread Blessing, Jeffrey

I've just recently read the entire thread on this issue posted
last Wed 9/19/01 and still have the following problem:

When the validate() method of my form bean returns a non-
empty ActionErrors list, struts fails to re-populate the form
fields with the text that was submitted successfully.  I've
checked the following:

In ApplicationResources.properties:

errors.header=ul
errors.footer=/ulhr

In struts-config:
==
actionpath=/saveTriage
   type=org.apache.struts.webapp.example.SaveTriageAction
   name=triageForm
  scope=request
  input=/triage.jsp
   validate=true
/action

The errors list *is* reported successfully on the input JSP page, however.
This is the only JSP page involved (no wizard like series of JSP pages).
I tried the fix suggested in the list, of changing the scope to session,
and
the app throws the following exception:
No bean found under attribute key triageForm

I've based this app on the struts-example app, as it appears that everyone
else is also doing.

What next?!




Re: passing reference from page to page

2001-09-24 Thread Blessing, Jeffrey



Did you try to store the reference in the 
session?

  - Original Message - 
  From: 
  cahana 
  To: [EMAIL PROTECTED] 
  
  Sent: Monday, September 24, 2001 5:59 
  PM
  Subject: passing reference from page to 
  page
  
  I have a search page with some input fields. The 
  values the user inputs are stored in my search form bean in the request scope 
  called SearchBean. If the search returns 0 results, I send them to a 
  message page saying "0 results found" with a link that will take the user back 
  to the search page with the original search criteria filled in. 
  Currently, I have hidden fields on the message page to pass around the 
  original search criteria. Is there a way to pass a reference to the 
  SearchBean from page to page so that I wouldn't have to use the hidden fields 
  for every attribute in the SearchBean?


Re: validate() fails to re-populate the html:form

2001-09-24 Thread Ted Husted

Try downloading Struts-simple, and porting the affected classes there. 

http://husted.com/about/struts/resources.htm#projects

Something strange is wrong. It does actually work as documented ;-0


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


Blessing, Jeffrey wrote:
 
 I've just recently read the entire thread on this issue posted
 last Wed 9/19/01 and still have the following problem:
 
 When the validate() method of my form bean returns a non-
 empty ActionErrors list, struts fails to re-populate the form
 fields with the text that was submitted successfully.  I've
 checked the following:
 
 In ApplicationResources.properties:
 
 errors.header=ul
 errors.footer=/ulhr
 
 In struts-config:
 ==
 actionpath=/saveTriage
type=org.apache.struts.webapp.example.SaveTriageAction
name=triageForm
   scope=request
   input=/triage.jsp
validate=true
 /action
 
 The errors list *is* reported successfully on the input JSP page, however.
 This is the only JSP page involved (no wizard like series of JSP pages).
 I tried the fix suggested in the list, of changing the scope to session,
 and
 the app throws the following exception:
 No bean found under attribute key triageForm
 
 I've based this app on the struts-example app, as it appears that everyone
 else is also doing.
 
 What next?!



RE: passing reference from page to page

2001-09-24 Thread Hans Gilde



As far 
as keeping the search in the session, if SearchBean is made session scoped, you 
can use the struts HTML form tag (http://jakarta.apache.org/struts/struts-html.html#form) 
to build the search form and the user will see their last search whenever they 
go to the search page. This can produce strange behavior for users that open 
multiple search windows within the same session, not to mention large sessions, 
so I'd advise against it. 

I'd 
use the struts HTML link tag (http://jakarta.apache.org/struts/struts-html.html#link). 
Make SearchBean implement java.util.Map, all keys and valuesshould be 
returned as type String from the Map methods. The link tag will let you include 
the contents of the Map as parameters on the end of a link. There's a helper 
class out there, somewhere, that will calculate Map keys and values from all the 
public getXXX methods in a bean via reflection. Your SearchBean becomes a proxy 
for this helper class, use the link tag on the search results page and the form 
tag on the search page.

-Original Message-From: 
Blessing, Jeffrey [mailto:[EMAIL PROTECTED]]Sent: Monday, September 
24, 2001 7:24 PMTo: [EMAIL PROTECTED]Subject: 
Re: passing reference from page to page

  Did you try to store the reference in the 
  session?
  
- Original Message - 
From: 
cahana 
To: [EMAIL PROTECTED] 

Sent: Monday, September 24, 2001 5:59 
PM
Subject: passing reference from page to 
page

I have a search page with some input fields. The 
values the user inputs are stored in my search form bean in the request 
scope called SearchBean. If the search returns 0 results, I send them 
to a message page saying "0 results found" with a link that will take the 
user back to the search page with the original search criteria filled 
in. Currently, I have hidden fields on the message page to pass around 
the original search criteria. Is there a way to pass a reference to 
the SearchBean from page to page so that I wouldn't have to use the hidden 
fields for every attribute in the 
SearchBean?


RE: passing reference from page to page

2001-09-24 Thread Hans Gilde

sorry about the html in my last message, it was:

As far as keeping the search in the session, if SearchBean is made session
scoped, you can use the struts HTML form tag
(http://jakarta.apache.org/struts/struts-html.html#form) to build the search
form and the user will see their last search whenever they go to the search
page. This can produce strange behavior for users that open multiple search
windows within the same session, not to mention large sessions, so I'd
advise against it.

I'd use the struts HTML link tag
(http://jakarta.apache.org/struts/struts-html.html#link). Make SearchBean
implement java.util.Map, all keys and values should be returned as type
String from the Map methods. The link tag will let you include the contents
of the Map as parameters on the end of a link. There's a helper class out
there, somewhere, that will calculate Map keys and values from all the
public getXXX methods in a bean via reflection. Your SearchBean becomes a
proxy for this helper class, use the link tag on the search results page and
the form tag on the search page.

-Original Message-
From: cahana [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 24, 2001 7:00 PM
To: [EMAIL PROTECTED]
Subject: passing reference from page to page


I have a search page with some input fields.  The values the user inputs are
stored in my search form bean in the request scope called SearchBean.  If
the search returns 0 results, I send them to a message page saying 0
results found with a link that will take the user back to the search page
with the original search criteria filled in.  Currently, I have hidden
fields on the message page to pass around the original search criteria.  Is
there a way to pass a reference to the SearchBean from page to page so that
I wouldn't have to use the hidden fields for every attribute in the
SearchBean?




controlling j2ee security authentication

2001-09-24 Thread Michelle Popovits

Hi,

I would like to control j2ee security in the following way.
1) have my app server use j2ee security for form login (done).
2) have my designated login jsp submit to a struts action (login.do).
3) be able to perform any additional validations I like in the struts login 
action.
4) then, manually invoke the j_security_check (forward?)
5) then, have the originally requested (secured) page displayed after 
successful container validation (as would normally happen when submitting a 
j_security_check page)

Is this possible or am I stuck with the simple j_security_check mechanism. 
It seems that if I don't submit from the page directly to j_security_check 
it doesn't work.

Please advise.

Thanks,
Michelle



_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp




Cannot find bean XX in scope null

2001-09-24 Thread David M. Karr

I'd appreciate some help figuring out what I'm doing wrong with my Struts/EJB
application.  I'm sure I've made more than one mistake, from architectural to
logical.

I have a simple EJB application.  I implemented JAAS using
DatabaseServerLoginModule.  I started to build a web app on top of this, and I
was able to get form-based auth working.

My main page just has a set of links to pages associated with domain objects
(one page per domain class), which will attempt to list all the objects of that
class.  I'd like to use logic:iterate on each page to iterate through each
object.

I'm certain of that much, at least.  As I get further on with this, I get less
certain of what I should be doing.

For each page listing the domain objects, I'm thinking I would need an
ActionForm subclass.  I thought the attribute of the Form class would be the
Collection containing the list of value objects I obtain through my DAO class
(the EJB bridge).  I thought the reset() method is where I would call the
method on the DAO to get the collection of objects.

I assume that in my struts-config.xml, I would have a form-beans element
containing a form-bean element which describes my ActionForm subclass.

I also assume that I would have an action element in the
action-mappings element that has the path, name, and scope
attributes.  I don't have a type setting because it didn't seem like I needed
an Action class, but it's not clear to me whether that's legal (I didn't see an
error message).

So, to summarize the symptom I see, when the JSP compiler tries to generate and
compile my servlet from the JSP, I see the following:

-
javax.servlet.ServletException: Cannot find bean listClassesForm in scope null
at 
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at 
c_00025ass._0002fclass_0002flistClasses_0002ejsplistClasses_jsp_6._jspService(_0002fclass_0002flistClasses_0002ejsplistClasses_jsp_6.java:169)
   ...
Root cause:

javax.servlet.jsp.JspException: Cannot find bean listClassesForm in scope null
at org.apache.struts.util.RequestUtils.lookup(RequestUtils.java:495)
   ...
-

I also include here my struts-config.xml:
-
struts-config
 form-beans
  form-bean name=listClassesForm 
type=com.intsoft.sgs.web.actions.ListClassesForm/
 /form-beans
 global-forwards type=org.apache.struts.action.ActionForward
  forward name=home path=/main/main.jsp redirect=false /
  forward name=listUsers path=/user/listUsers.jsp redirect=false /
  forward name=listClasses path=/class/listClasses.jsp redirect=false /
  forward name=listStudents path=/student/listStudents.jsp redirect=false /
 /global-forwards
 action-mappings
  action path=/listClasses name=listClassesForm scope=request/
 /action-mappings
/struts-config
-

Again, I would appreciate any guidance towards the right path.

-- 
===
David M. Karr  ; Best Consulting
[EMAIL PROTECTED]   ; Java/Unix/XML/C++/X ; BrainBench CJ12P (#12004)




Re : Struts in VAJ 3.53

2001-09-24 Thread listener
Title: 




Harshal,

I am not sure this applies because you are using the Websphere test environment, 
but I get this with Tomcat 3.2.3 in VAJ unless I add struts to the classpath as a 
jar and not as a project. It did not happen with the Tomcat 3.2.1 test environment 
(at least that appears to be the main difference between my development system 
that works and the one that doesn't).

David Morris

 [EMAIL PROTECTED] 09/22/01 02:46PM 
Also Iam seeing this a lot of this.
 Field initialization: The type named FastHashMap is deprecated.
Please Help.

Thanks
Harshal.


-Original Message-
From: Jhaveri, Harshal [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, September 22, 2001 4:42 PM
To: '[EMAIL PROTECTED]' 
Subject: Re : Struts in VAJ 3.53


Hi! All
   I followed all the instructions on the Url:
http://www7.software.ibm.com/vad.nsf/Data/Document2558?OpenDocumentSubMast 
but when I start the WTE . I get the following error.
[01.09.22 16:26:39:339 EDT] 2535 ServletInstan X Uncaught init() exception
thrown by servlet : 
 "action"
 javax.servlet.ServletException
	java.lang.Throwable(java.lang.String)
	java.lang.Exception(java.lang.String)
	javax.servlet.ServletException(java.lang.String,
java.lang.Throwable)
	void org.apache.struts.action.ActionServlet.initMapping()
	void org.apache.struts.action.ActionServlet.init()
	void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
	void com.ibm.servlet.engine.webapp.StrictServletInstance.doInit()
	void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._init(javax.servlet.Ser
vletConfig)
	void
com.ibm.servlet.engine.webapp.PreInitializedServletState.init(com.ibm.servle

t.engine.webapp.StrictLifecycleServlet, javax.servlet.ServletConfig)
	void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.init(javax.servlet.Serv
letConfig)
	void com.ibm.servlet.engine.webapp.ServletInstance.init()
	void javax.servlet.GenericServlet.init(javax.servlet.ServletConfig)
	void
com.ibm.servlet.engine.webapp.ServletManager.addServlet(java.lang.String,
javax.servlet.Servlet, java.util.Properties)
	void
com.ibm.servlet.engine.webapp.WebAppServletManager.loadServlet(java.lang.Str
ing)
	void
com.ibm.servlet.engine.webapp.WebAppServletManager.loadAutoLoadServlets()
	void com.ibm.servlet.engine.webapp.WebApp.loadServletManager()
	void
com.ibm.servlet.engine.webapp.WebApp.init(com.ibm.servlet.engine.config.WebA
ppInfo, com.ibm.servlet.engine.webapp.WebAppContext)
	void com.ibm.servlet.engine.srt.WebGroup.loadWebApp()
	void
com.ibm.servlet.engine.srt.WebGroup.init(com.ibm.servlet.engine.ServletHost,
com.ibm.servlet.engine.config.WebGroupInfo)
	void com.ibm.servlet.engine.ServletHost.loadWebGroups()
	void
com.ibm.servlet.engine.ServletHost.init(com.ibm.servlet.engine.ServletEngine
, com.ibm.servlet.engine.config.ServletHostInfo)
	void com.ibm.servlet.engine.ServletEngine.loadServletHosts()


This message was posted using eunumTo interact with a real-time, threaded interface to this e-mail list, clickthe link below:[EMAIL PROTECTED]






How do you show a html:select's default selection only unti

2001-09-24 Thread listener
Title: 




Hi,

Is it possible to use the "value" property of the html:select tag to display
a default selection but *only until* the
user makes their own choice? The user's selection should be selected
thereafter.

In my form, if I specify html:select's "value" property with a default
selection, this value is always displayed
when the page is loaded, even if the user has previously made a selection on
that page (I'm using multi-page forms).
The form bean is not being resetted so the user's selection is available in
the bean, yet it is still not displayed as the selection.

Can anyone help me with this?

Thanks in advance

Steve






This message was posted using eunumTo interact with a real-time, threaded interface to this e-mail list, clickthe link below:[EMAIL PROTECTED]