Re: Cannot find message resources under key org.apache.struts.action.MESSAGE

2001-09-23 Thread Ted Husted

This is usually a XML parsing issue. Either there are too many parsers,
or not enough. 
First, check to see which parsers are available to your container and
application, these can be specified in several of places: 

The CLASSPATH environment variable
The ext/lib folder under your JAVA_HOME
The WEB_INF/lib folder under your application's root
Any kind of lib folder your container may use
Tomcat 4 does not expose an XML parser to web applications. Thus, you'll
need to do one of the following:

* Stick an XML parser into the $CATALINA_HOME/lib directory to make it
available to all web apps, or
* Stick an XML parser into the /WEB-INF/lib directory of your web app.

Many field engineers have reported having the best results when exposing
Xerces 1.3 or later to their container.

Note that the WARs shipped with Struts do *not* have parsers with them.


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


aswin nair wrote:
 
 hiii ,
  I am using Tomcat4.0 -rc 2 to make struts work. well i get the error message
 javax.servlet.ServletException: Cannot find message resources under key 
org.apache.struts.action.MESSAGE , when i try running struts-blank or any other 
default implementation of struts. In short i was not able to make even a single 
struts program work, If you could tell me the possible reasons, i would be really 
thankful..
 aswin
 




Re: referencing images

2001-09-23 Thread Ted Husted

The html:base/ tag will let you use relative paths to your images. 

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


Anish Acharya wrote:
 
 Hello everyone.  I'm just wondering if anyone has had trouble referencing
 images from within a .jsp page that includes Struts tags?  None of my images
 display.  I can't seem to figure out which directory struts is running under
 when it gets to the page, and consequently I can't set the right image path.
 That seems to be the only possibility.  Any idea's?
 
 Thanks,
 
 -Anish



Re: ActionMapping/Action Form Bean Collection Missing

2001-09-23 Thread Ted Husted

The struts-config.xml probably references a class that does not exist.
Anything under WEB-INF/classes shoudl be found.

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

Marco Wuest wrote:
 
 Hello,
 
  i'm new to both: Tomcat and Struts, so apologize for a newbie question ;-)
 
  I've installed a test application and get follwoing Exception: Action
 Mapping / ActionFormBean Collection missing or so.
 
  My problem is where to look for that error: Is the mapping in
 structs-config.xml not correct or are the classes(ex. classpath) not found?
 
 Thanks for any help!
 
  Regards,
 Marco




Re: Multiple HttpSession objects being created

2001-09-23 Thread Ted Husted

Each application does get it's own session. It's a security issue, so
one application can't spy on another. 

I believe you're going to have to resort to cookies, unless there is a
way that the business logic in the non-Struts application can be called
from within the Struts application. You could also send it on the query
string, perhaps encrypted and with a confirmation token, but that could
be some work ;-(

The Tomcat 4 Single Login source code might be a starting point for your
own implementation, if cookies can be required and don't raise security
issues. I don't have the package reference handy, but it's now hard to
find if you look.

-- 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,
 
 Not sure if this is a Struts/general servlet issue.
 
 I have a non-struts servlet application that allows the user to logon , adding
 logon info to the httpSession, and then after choosing a menu item is redirected
 (response.sendRedirect(response.encodeRedirectURL(path)) to a struts
 application.
 
 The issue is that the non-struts application and struts application each get
 their own session. So the struts application can not get any logon values from
 the session object.
 
 I
 
   
 
 ?ve subclassed ActionServlet, and am calling HttpSession session =
 request.getSession(); from within the process method.
 
 I?m running Weblogic sp8, and all the apps are running on the same box.
 
 thanks
 neil
 
 NOTICE
 The information contained in this electronic mail message is privileged and
 confidential, and is intended only for use of the addressee.  If you are not the
 intended recipient, you are hereby notified that any disclosure, reproduction,
 distribution or other use of this communication is strictly prohibited.  If you
 have received this communication in error, please notify the sender by reply
 transmission and delete the message without copying or disclosing it.



Re: Wizard features in future struts?

2001-09-23 Thread Ted Husted

What's on the table now for Wizards is the Workflow proposal. 

http://jakarta.apache.org/struts/proposal-workflow.html

No estimated time of arrival, though. The source is in the Commons
Sandbox CVS.

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


D. Veniseleas wrote:
 
 Hi,
 
 does anybody know smartmode from www.smartmode.com ?
 It has O/R mapping, generates SQL commands, EJB and Java Beans, jsp-pages
 out of a single xml-file.
 Unfortunately it's not open-source. For a project, I don't know if we will
 have to extend the code of such a product, and without the sources...
 Are similar features being discussed to be implemented into struts?
 Or will I have to use something like torque from Apache and make my own
 toolset?? (I don't know, if I can... ;-)
 
 Thanks,
 Dimitris



Re: Struts and XML

2001-09-23 Thread Ted Husted

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.java: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(Unknown 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: html:text align=....

2001-09-23 Thread Ted Husted

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?
 



RE: Re : Struts in VAJ 3.53

2001-09-23 Thread David Morris

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 {0}: {1}
 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()
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 [])


[01.09.22 16:26:39:430 EDT] 2535 WebGroup  X [Servlet Error]-[{0}]: {1}:
{2}
 action
 Failed to load servlet
 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

RE: Re : Struts in VAJ 3.53

2001-09-23 Thread Jhaveri, Harshal

Thanks , But that didn't work.
I am still getting the same error.
[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 [])

this is after I followed all the instructions on the Struts with VAJ 3.53
http://www7.software.ibm.com/vad.nsf/Data/Document2558?OpenDocumentSubMast

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

Thanks,
Harshal.


-Original Message-
From: David Morris [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 23, 2001 10:33 AM
To: [EMAIL PROTECTED]
Subject: RE: Re : Struts in VAJ 3.53


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 {0}: {1}
 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

Re: html:text align=....

2001-09-23 Thread martin . cooper

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?
  





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

2001-09-23 Thread martin . cooper

The logic:iterate tag has a 'type' attribute, which can be used to specify
the type to be used for the element exposed through the 'id' attribute. This
should allow you to get rid of the cast like this:

logic:iterate name=invoiceForm
   property=invoice.invoiceLineItems
   id=lineItem
   type=InvoiceLineItem 
bean:write name=lineItem property=aLineItemProperty/
/p
/logic:iterate

--
Martin Cooper


- Original Message -
From: Ali Ozoren [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 22, 2001 10:52 PM
Subject: Postmortem (iterate, wrap, hashtable, nested)


 Hi all-

 I finally solved my iterate problem. It was a learning experience, and
very
 time consuming. Hence here is the distilled version briefly.

 We have an Invoice business object (what a fancy name for a plain
bean)
 with a member invoiceLineItems of type Hashtable. It has static methods
to
 instantiate a Invoice object from db and public method to save itself to
 db. It has no knowledge of it's container which is a servlet engine this
 time.

 We have an invoiceForm view object of type InvoiceForm, which in
return
 is an ActionForm, with a member property invoice of type Invoice. In
the
 default constructor of InvoiceForm, an Invoice is instantiated and
 assigned to invoice member.

 We have a invoice.jsp that refers to InvoiceForm's elemets as follows:

 html:text property=invoice.aProperty size=16 maxlength=16/

 The individual InvoiceLineItems stored in
 invoiceForm-invoice-invoiceLineItems are referred as follows:

 logic:iterate name=invoiceForm property=invoice.invoiceLineItems
 id=lineItemAsEntry //this only returns an Map.Entry, where's
 introspection?
 bean:define id=lineItem name=lineItemAsEntry property=value
 type=InvoiceLineItem/ //now we cast
 bean:write name=lineItem property=aLineItemProperty/ //finally
we
 have an InvoiceLineItem!
 /p
 /logic:iterate

 So, I had to cast the individual Hashtable entries to type InvoiceLineItem
 to be able to access its properties. Even after so, there is one problem
 remained. I got back the elements in the wrong order. It iterated like
 3-1-2, 1 being the first element I put into the hashtable.

 I hope I shed some light into the infamous iteration problem. I thank
Adam
 for the generous help which helped me tackle it from a different angle.

 --a

 PS. Also, don't forget to put %@ taglib uri=/WEB-INF/struts-logic.tld
 prefix=logic % at the beginning of the page.






Re: run time expressions jsp:xxx attributes

2001-09-23 Thread martin . cooper

The value of the 'name' attribute on the jsp:getProperty tag cannot be a
runtime expression, per the JSP spec. See the section entitled Request Time
Attribute Values for the details.

--
Martin Cooper


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 21, 2001 1:49 PM
Subject: run time expressions  jsp:xxx attributes



 Hi, the struts example mainMenu.jsp page accesses the User bean like so:
 ...
 jsp:useBean id=user scope=session type
 =org.apache.struts.webapp.example.User/
 ...
 jsp:getProperty name=user property=username/


 However, the bean is set in LogonAction like so:

 session.setAttribute(Constants.USER_KEY, user);


 Is it possible to use a run time expression instead?

 %@ page import=org.apache.struts.webapp.example.Constants%

 jsp:getProperty name=%=Constants.USERBEAN% property=username/



 I am not able to do so, I get a org.apache.jasper.JasperException:
 Attempted a bean operation on a null object.


 Is it possible to do this?







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

2001-09-23 Thread Richard Yee

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

At 01:52 AM 9/23/01 -0400, you wrote:
Hi all-

I finally solved my iterate problem. It was a learning experience, and very
time consuming. Hence here is the distilled version briefly.

We have an Invoice business object (what a fancy name for a plain bean)
with a member invoiceLineItems of type Hashtable. It has static methods to
instantiate a Invoice object from db and public method to save itself to
db. It has no knowledge of it's container which is a servlet engine this
time.

We have an invoiceForm view object of type InvoiceForm, which in return
is an ActionForm, with a member property invoice of type Invoice. In the
default constructor of InvoiceForm, an Invoice is instantiated and
assigned to invoice member.

We have a invoice.jsp that refers to InvoiceForm's elemets as follows:

The individual InvoiceLineItems stored in 
invoiceForm-invoice-invoiceLineItems are referred as follows: //this 
only returns an Map.Entry, where's introspection? //now we cast //finally 
we have an InvoiceLineItem!
So, I had to cast the individual Hashtable entries to type InvoiceLineItem 
to be able to access its properties. Even after so, there is one problem 
remained. I got back the elements in the wrong order. It iterated like 
3-1-2, 1 being the first element I put into the hashtable. I hope I shed 
some light into the infamous iteration problem. I thank Adam for the 
generous help which helped me tackle it from a different angle. --a PS. 
Also, don't forget to put %@ taglib uri=/WEB-INF/struts-logic.tld 
prefix=logic % at the beginning of the page.




Re: ClassNotFoundException building Struts src with ant

2001-09-23 Thread martin . cooper

Do you have the Ant optional jar (jakarta-ant-1.4-optional.jar)? Per the
Struts documentation, this is needed to build Struts from source. See:

http://jakarta.apache.org/struts/installation.html

for more.

--
Martin Cooper


- Original Message -
From: Paap, Keith [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 21, 2001 8:04 AM
Subject: RE: ClassNotFoundException building Struts src with ant


 In order to at least move forward I went out and got the binary version of
 one of the recent nightly builds.   That at least lets me make use of some
 of the newer features I was looking for.

 However, if anyone has run into this problem trying to build from source
 using Ant I would still be interested in how you got it resolved or even
if
 anyone has any suggestions.  Ant is one of those 'todo' items on my list
to
 get over the learning curve but just haven't taken the time yet.


 -Original Message-
 From: Paap, Keith [mailto:[EMAIL PROTECTED]]
 Sent: Friday, September 21, 2001 8:33 AM
 To: '[EMAIL PROTECTED]'
 Subject: ClassNotFoundException building Struts src with ant


 I'm attempting to build a new distribution version of Struts using Ant but
 I'm getting the following exception:

 [style] java.lang.ClassNotFoundException:
 org.apache.tools.ant.taskdefs.optional.XalanLiaison

 The version of Ant that I have is 1.4 and if I look in the ant.jar there
is
 a package of that name but there's only one class (TraXLiason).  Can
anyone
 tell me where that class could be found to get the build to go through?
 (Just an additional note to mention this is my first attempt at using
Ant.)

 The source I'm attempting to build is actually the 1.0 source with a few
 source files replaced based on the 'indexed' attribute being added in the
 html form tags.  Is there is more recent nightly source that anyone could
 recommend that has this 'indexed' attribute enhancement?  Would a later
 source version help with this exception?

 Keith Paap





More than one action for a request

2001-09-23 Thread Hakan Forss

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




Re: Dynamic forward to jsps

2001-09-23 Thread martin . cooper

Another option might be to modify the path of the forward dynamically to
include the locale. A couple of ways of doing this might be:

1) Define your forwards with the path containing a slot for the locale, like
this:

forward name=success path=menu_%1.jsp /

At run time, you can fill in the blank after getting the code from the
Locale object. If you do this, remember not to modify the ActionForward
object you get back from findForward(), otherwise, it will only work the
first time.

2) Forward to an action that does the decision making. In this case, your
forwards might look something like this:

forward name=success path=localeFixerUpper.do?successpage=menu.jsp
/

Then your LocaleFixerUpper (catchy name, huh? :-) ) action can do whatever
it needs to modify the successpage value before forwarding to it.

Neither of these is particularly clean, but they should work.

--
Martin Cooper


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 21, 2001 7:06 AM
Subject: RE: Dynamic forward to jsps



 Thanks for the reply Mike.  While the JSPs I have in mind will utilize the
 i18n features of struts ( through the MessageTag class  application
 resource files), I would also like the ability to use completely different
 JSPs altogether.  For example, think of a languages that read from right
to
 left.  In these instances it would be nice to have forms with text to the
 right of the the input fields.  So far I'm not sure how to best accomplish
 this with Struts.

 -Craig





 Synovic,
 Michael  To:
'[EMAIL PROTECTED]' [EMAIL PROTECTED]
 michael.synovi   cc: (bcc: Craig
Reichenbach/CAM/Lotus)
 [EMAIL PROTECTED]Subject: RE: Dynamic forward
to jsps

 09/19/2001
 04:45 PM
 Please respond
 to struts-user






 Hey Craig,

 Don't know how to implement dynamic forwarding, but based on your example,
 you might want to investigate how to build a single JSP to handle multiple
 languages, rather than using different JSPs for different languages.

 Check out the I18N (internationalization) features of Struts.

 Mike




 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 18, 2001 11:44 AM
 To: [EMAIL PROTECTED]
 Subject: Dynamic foward to jsps



 I have seen some discussion of dynamic forwarding in the archives as it
 pertains to passing parameters.  But I haven't seen anything yet that
 speaks to how one might have more than 1 success page.  For example,
 suppose I had menu.jsp and menu_es.jsp and I wanted to dynamically forward
 all requests from browsers set to accept Spanish to the Spanish jsp.

 Ignoring all  realistic implications  in order to get my question across,
 what comes to mind is a dynamic page attribute in struts-config, ie:

 forward name=success  page=${user.succes.page}

 The value of success.page would then correspond to an entry in the various
 properties files, ie:

 AppResources.properties contains:
 user.success.page=menu.jsp

 AppResources_es.properties contains:
 user.successpage=menu_es.jsp



 The other thought that comes to mind is for the Action class to extract
the
 locality from the browser or session and then set a String variable
 representing the success  or failure page accordingly.   For example:

 String success = success;

 if (locale == spanish)
  success = success_es;

 return mapping.findForward( success );

 Meanwhile the struts-config contains multiple 'success' forwards:
 forward name=success  page=menu.jsp
 forward name=success_espage=menu_es.jsp


 This would be pretty weak and unscalable.

 I appreciate your thoughts, ideas,  solutions.

 Thanks,
 Craig









Re: More than one action for a request

2001-09-23 Thread martin . cooper

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






logic:Iterate question

2001-09-23 Thread Shea Kelly



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: AI 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 
EngineerObject Oriented Pty LtdPO Box 528, North Sydney NSW 2059Phone: 
+61 2 9957-1092Direct: +61 2 9459-3335Fax: +61 2 9956-5089 
Mobile: 0416 110 
499Email: 
[EMAIL PROTECTED]Web: http://www.oopl.com.au 



Struts installation on iPlanet 4.1 SP7

2001-09-23 Thread jsimons



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

Thanks
  John






Uisng multiple ApplicationResources in a team

2001-09-23 Thread Debasish Ghosh

Hi -

I have got a reference where it is mentioned that a
patch is available for team development using multiple
struts-config.xml and ApplicationResources.properties
files. I first found it in Struts catalog in Ted
Husted's site. He refers to the link
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg10052.html,
where Dan has discussed about this offering. 

Is this patch available somewhere, so that I can use
it in our project. I could not get any link where this
patch is made available.

Thanks for the help.

- Debasish

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



Re: Struts installation on iPlanet 4.1 SP7

2001-09-23 Thread martin . cooper

There are installation instructions on the Struts web site:

http://jakarta.apache.org/struts/installation-ip.html

--
Martin Cooper


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 4:30 PM
Subject: 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: Postmortem (iterate, wrap, hashtable, nested)

2001-09-23 Thread Ali Ozoren

martin- I get java.lang.ClassCastException: java.util.Hashtable$Entry if I
do what you suggest.
--a

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, September 23, 2001 3:05 PM
To: [EMAIL PROTECTED]
Subject: Re: Postmortem (iterate, wrap, hashtable, nested)


The logic:iterate tag has a 'type' attribute, which can be used to specify
the type to be used for the element exposed through the 'id' attribute. This
should allow you to get rid of the cast like this:

logic:iterate name=invoiceForm
   property=invoice.invoiceLineItems
   id=lineItem
   type=InvoiceLineItem 
bean:write name=lineItem property=aLineItemProperty/
/p
/logic:iterate

--
Martin Cooper




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

2001-09-23 Thread Ali Ozoren

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





HTML:FORM Action problem with proxy server

2001-09-23 Thread Lou Morin

I've been using Struts for the last couple of months and have been pretty 
much able to resolve all my problems by reading the documentation, 
tutorials, etc.
Now, I'm looking to deploy this to my ISP server. The ISP is translating my 
domain name as follows:

  www.tarponweb.com --  http://webappcabaret.com/tarponweb1;

My action-mappings are as follows:

  action
   path=/SaintIgnatiusYouthGroup/Admin/AdminLogon
   type=com.tarponweb.AdminLogonAction
   name=AdminLogon
   Input=/SaintIgnatiusYouthGroup/Admin/AdminLogonPage.jsp
 forward name=adminHome
path=/SaintIgnatiusYouthGroup/Admin/AdminHomePage.jsp/
 forward name=adminLogon   
path=/SaintIgnatiusYouthGroup/Admin/AdminLogonPage.jsp/
/action


My html form start like this:

html:form

action=/SaintIgnatiusYouthGroup/Admin/AdminLogon.do
focus=userId


When the form is displayed, if you view the generated source the action 
contains a /tarponweb1 prefix as follows:

 form name=AdminLogon method=POST
 
action=/tarponweb1/SaintIgnatiusYouthGroup/Admin/AdminLogon.do

The Problem:

When the submit button is pressed the following URL is submitted:
 
http://www.tarponweb.com/tarponweb1/SaintIgnatiusYouthGroup/Admin/AdminLogon.do;

This gets translatted to the following:
 
http://webappcabaret.com/tarponweb1/tarponweb1/SaintIgnatiusYouthGroup/Admin/AdminLogon.do;

Hence, I get a page not found because of the double  
/tarponweb1/tarponweb1 directories in the URL.

It looks like Struts is adding the /tarponweb1 to the generated form 
because this is the context that it is in ... it does this in my test 
environment and it works because localhost does not get translated to 
localhost/tarponweb1.

Is there a way to tell Struts not to add the Servlet Context to the form 
action?
Has anybody come across this problem?

Any help would be greatly appreciated!

Thanks,
Lou

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




Re: More than one action for a request

2001-09-23 Thread Hakan Forss

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




Javascruot with html:errors

2001-09-23 Thread Francois Duchaussoy

Hi,

Would anyone know how to call a javascript method from a html:errors/ tag?
Basically I would like to highlight a field where an error occurs...

Any ideas??
Francois.



i18n: bean:option value=i18n_value?

2001-09-23 Thread Ken'ichi Unnai


Hi All, 

I'm building a small select.jsp - ReceiveServlet - result.jsp
webapp as an experiment for struts mvc framework.

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...
Could anyone please point me out how to do it?

Really thanks in advance,
Ken



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



Re: Javascruot with html:errors

2001-09-23 Thread martin . cooper

If I understand what you're asking, it's not possible. JavaScript is
executed at the client (e.g. the browser), while JSP, including the
html:errors tag, is executed on the server.

--
Martin Cooper


- Original Message -
From: Francois Duchaussoy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 9:13 PM
Subject: Javascruot with html:errors


 Hi,

 Would anyone know how to call a javascript method from a html:errors/
tag?
 Basically I would like to highlight a field where an error occurs...

 Any ideas??
 Francois.





Re: bean:option value=i18n_value?

2001-09-23 Thread martin . cooper

You probably want to use html:options instead of html:option, and do a
little more setup work in your action class.

--
Martin Cooper


- Original Message -
From: Ken'ichi Unnai [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 9:49 PM
Subject: i18n: bean:option value=i18n_value?



 Hi All,

 I'm building a small select.jsp - ReceiveServlet - result.jsp
 webapp as an experiment for struts mvc framework.

 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...
 Could anyone please point me out how to do it?

 Really thanks in advance,
 Ken



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





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

2001-09-23 Thread martin . cooper

When you use a Map, there is no defined order in which the entries will be
enumerated. The actual order is implementation-specific. If you need a
particular order, then it is up to you to take care of that.

--
Martin Cooper


- Original Message -
From: Ali Ozoren [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 23, 2001 7:34 PM
Subject: RE: Postmortem (iterate, wrap, hashtable, nested)


 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







can html:checkbox indexed??

2001-09-23 Thread Shea Kelly



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(JspParseEventListener.java:759)	at 
org.apache.jasper.compiler.JspParseEventListener.addGenerator(JspParseEventListener.java:138)	at 
org.apache.jasper.compiler.JspParseEventListener.handleTagBegin(JspParseEventListener.java:909)	at 
org.apache.jasper.compiler.DelegatingListener.handleTagBegin(DelegatingListener.java:194)
Here is my code snippet:

logic:iterate id="facility" name="surveyForm" 
property="generalFacilityList"

 td height="15" 
colspan="4" 
bean:write name="facility" 
property="code"/ 
bean:write name="facility" 
property="description"/ 
/td td width="5%" 
height="15" 
font size="1" 
face="Arial" 
html:checkbox name="facility" property="state" value="true" 
indexed="true"/ 
!--bean:write name="facility" 
property="state"/-- 
/font 
/td

 % if(i % numOfColumns == 
0){ % 
/tr 
tr % } 
%

 % i++; 
%

 /logic:iterate

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



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

2001-09-23 Thread Richard Yee

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