RE: Returning from a form apge

2001-04-30 Thread Lewis Henderson

Thx,

My idea was to allow multi-level popup.


Jsp1 = Jsp2 = Jsp3
Jsp1 = Jsp2 = Jsp3

...or any combination...

Lewis

-Original Message-
From: Peter Alfors [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 20:41
To: [EMAIL PROTECTED]
Subject: Re: Returning from a form apge


The request contains the referring page.
request.getHeader(Referer)
Therefore, your action class for the 3rd page could look up where he came
from
in the request.

HTH,
Pete


Lewis Henderson wrote:

 Hi,

 I also have a similar issue...a reuseable popup...

 The problem with your passing the return page as a parameter is that you
can
 only nest to one level...

 I am thinking of writing a 'push'/'pop'/'peek' implementation to allow
this
 to occur...

 Does anyone have any comments/ideas.

 Lewis

 -Original Message-
 From: James Howe [mailto:[EMAIL PROTECTED]]
 Sent: 30 April 2001 19:44
 To: [EMAIL PROTECTED]
 Subject: Returning from a form apge

 In our web application, we have two pages from which a user can access a
 third page.  From the third page (which is form to fill out and save), the
 user either saves or cancels their action, and the user is returned to the
 page from which they originally started.  However, the third page has no
 knowledge about where it came from so it doesn't no who to forward to when
 its action is complete.

 I'm not sure how best to handle this situation.  One option would be to
use
 a parameter on the link to the third page with a value indicating the page
 to return to.  However, I'm using an html:link tag which is passing
other
 object related parameters on to the third screen (the form uses this
 information to populate itself).  What I would like to do is get the
 parameters from the object and then append another parameter which
 indicates the page to return to but I can't do that and use the link
 tag.  I'm toying with the idea of building a custom link tag which also
 takes a return attribute.  This tag would put the return information in
 the parameter list that gets generated.  Before I do that, however, I'm
 wondering what other ways people have used to address this sort of
problem?
 (I assume that I'm not the only person to have encoutered this situation)

 Any tips or suggestions would be appreciated.

 Thanks.




RE: How to embed bean:message within a template

2001-04-30 Thread Niall Pemberton



template:put name="title" 
direct="true"
 bean:message 
key="index.title"/

/template:put

  -Original Message-From: Jeff Trent 
  [mailto:[EMAIL PROTECTED]]Sent: 30 April 2001 
  20:10To: [EMAIL PROTECTED]Subject: How to 
  embed bean:message within a template
  Newbie here. Just wondering how to 
  accomplish this using templates. 
  
   template:put name='title' 
  content='bean:message key="app.title"/' direct='true' 
  /
  Can't seem get the bean to evaluate the message 
  text... Suggestions? I tried direct on  off but no 
  luck.
  
  Thanks,
  Jeff
  
  


Why need to remove FormBean ??

2001-04-30 Thread John Festa

The Action objects that are in the struts-example removes the form bean
regardless of whether it is held in the request or session object.

If it is held in the request object, why is it necessary to remove it?
Doesn't the request object get destroyed between requests (hence destroying
the form bean)?

Thanks in advance !

mailto:[EMAIL PROTECTED]
908-516-9624

Aspen Technology, Inc.
890 Mountain Avenue
New Providence, New Jersey 07974



RE: Why need to remove FormBean ??

2001-04-30 Thread Jason Chaffee
Title: RE: Why need to remove FormBean ??





I don't know the exact reason it is being done, but it may be a safety net in case the container doesn't remove it properly. As many of you have probably come to find out, many of the app servers haven't implemented every part of the servlet implementation correctly.

-Original Message-
From: John Festa [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 1:31 PM
To: '[EMAIL PROTECTED]'
Subject: Why need to remove FormBean ??



The Action objects that are in the struts-example removes the form bean
regardless of whether it is held in the request or session object.


If it is held in the request object, why is it necessary to remove it?
Doesn't the request object get destroyed between requests (hence destroying
the form bean)?


Thanks in advance !


mailto:[EMAIL PROTECTED]
908-516-9624


Aspen Technology, Inc.
890 Mountain Avenue
New Providence, New Jersey 07974





Form submission from did n't occurr

2001-04-30 Thread M . Amin

Dear Geir and all,
I'm using velocity integrated with struts and i have a trouble regarding
action mapping :
  
look at my attched files 

The form submission from product.vm to its action configured in .xml did n't
occurr, i do n't what's wrong

Any help will be appreciated.

Regards,
M. Amin

Title: Test


 





  


  
 description
  
  
   
  



  
  categorie
  
  

  



  
long description
  
  
   
  



  
supplier
  
  
   
 



  
   producer
  
  
   
  




  
 
  
   

  



Title: Test

 





  


  
 description
  
  
   $productForm.description
  



  
  categorie
  
  
   $productForm.serviceCategorie
  



  
long description
  
  
   $productForm.longDescription
  



  
supplier
  
  
   $productForm.supplier
 



  
   producer
  
  
   $productForm.producer
  




  
 
  
   

  





?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

!--
 This is the Struts configuration file for the example application,
 using the proposed new syntax.

 NOTE:  You would only flesh out the details in the form-bean
 declarations if you had a generator tool that used them to create
 the corresponding Java classes for you.  Otherwise, you would
 need only the form-bean element itself, with the corresponding
 name and type attributes.
--


struts-config


  !-- == Data Source Configuration === --
 data-sources
data-source
   autoCommit=false
  description=Example Data Source Configuration
  driverClass=org.postgresql.Driver
 maxCount=4
 minCount=2
 password=
  url=jdbc:postgresql://10.0.1.14/webshop
 user=postgres
/
  /data-sources


  !-- == Form Bean Definitions === --
  form-beans

form-bean  name=productForm
type=com.imkenberg.manager.ProductForm/

  /form-beans


  !-- == Global Forward Definitions == --
  global-forwards
   forward   name=success  path=/show.vm/
  /global-forwards


  !-- == Action Mapping Definitions == --
  action-mappings

actionpath=/savePrd
   type=com.imkenberg.manager.SaveAction
   name=productForm
  scope=request
  input=/product.vm
 forward   name=success  path=/show.vm/
/action


!-- The standard administrative actions available with Struts --
!-- These would be either omitted or protected by security --
!-- in a real application deployment --
actionpath=/admin/addFormBean
   type=org.apache.struts.actions.AddFormBeanAction/
actionpath=/admin/addForward
   type=org.apache.struts.actions.AddForwardAction/
actionpath=/admin/addMapping
   type=org.apache.struts.actions.AddMappingAction/
actionpath=/admin/reload
   type=org.apache.struts.actions.ReloadAction/
actionpath=/admin/removeFormBean
   type=org.apache.struts.actions.RemoveFormBeanAction/
actionpath=/admin/removeForward
   type=org.apache.struts.actions.RemoveForwardAction/
actionpath=/admin/removeMapping
   type=org.apache.struts.actions.RemoveMappingAction/


  /action-mappings

/struts-config








  
  
database
org.apache.struts.webapp.example.DatabaseServlet

  debug
  2

1
  


  
  
action
org.apache.struts.action.ActionServlet

  application
  org.apache.struts.webapp.example.ApplicationResources


  config
  /WEB-INF/struts-config.xml


  debug
  2


  detail
  2


  validate
  true

2
  

 
vel
org.apache.velocity.struts.VelServlet
4
  


  
  
action
*.do
  

  
vel
*.vm
  

  
  
index.vm
  

  
  
/WEB-INF/app.tld
/WEB-INF/app.tld
  

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

  
  

RE: Returning from a form apge

2001-04-30 Thread Eric Butterfield

If you hard code a parameter into the href or page attribute of html:link, it is 
smart enough to know how to append the other
parameters contained in your parameter map.  For example if your page value is 
/myForm.do?ref=1, and your parameter map contains
the pairs param1=abc and param2=def, html:link will correctly form the URL:

http://www.mycompany.com/myApp/myForm.do?ref=1param1=abcparam2=def


-Original Message-
From: James Howe [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 11:44 AM
To: [EMAIL PROTECTED]
Subject: Returning from a form apge


In our web application, we have two pages from which a user can access a
third page.  From the third page (which is form to fill out and save), the
user either saves or cancels their action, and the user is returned to the
page from which they originally started.  However, the third page has no
knowledge about where it came from so it doesn't no who to forward to when
its action is complete.

I'm not sure how best to handle this situation.  One option would be to use
a parameter on the link to the third page with a value indicating the page
to return to.  However, I'm using an html:link tag which is passing other
object related parameters on to the third screen (the form uses this
information to populate itself).  What I would like to do is get the
parameters from the object and then append another parameter which
indicates the page to return to but I can't do that and use the link
tag.  I'm toying with the idea of building a custom link tag which also
takes a return attribute.  This tag would put the return information in
the parameter list that gets generated.  Before I do that, however, I'm
wondering what other ways people have used to address this sort of problem?
(I assume that I'm not the only person to have encoutered this situation)

Any tips or suggestions would be appreciated.

Thanks.





Components problem: Unable to convert a String to java.lang.Object for attribute content

2001-04-30 Thread Tim Moore

I'm trying to figure out the Components Library extension to Struts.  I've
got a simple JSP:

%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/components.tld  prefix=template %

html:html
  head
titleContent Form/title
  /head

  body bgcolor=white

html:errors/

html:form name=testForm action=saveContent.do
   type=blackboard.presentation.common.TestForm

  template:insert template=/contentForm.jsp
template:put name=labelcontent=Text:   direct=true/
template:put name=property content=contentForm direct=true/
  /template:insert

  table border=0 width=100% cellpadding=5 cellspacing=0
tr
  td width=10 align=left valign=topimg
src=/images/spacer.gif alt= width=10 height=1 border=0/td

  td align=righthtml:cancel/ html:submit//td
/tr
  /table
/html:form
  /body
/html:html

When I try to hit the page, I get this error:

Error: 500
Location: /sleepyweasel/content.jsp
Internal Servlet Error:
org.apache.jasper.compiler.CompileException:
D:\jakarta-tomcat-3.2.1\webapps\sleepyweasel\content.jsp(16,8) Unable to
convert a String to java.lang.Object for attribute content
at
org.apache.jasper.compiler.TagBeginGenerator.convertString(TagBeginGenerator
.java:271)
at
org.apache.jasper.compiler.TagBeginGenerator.generateSetters(Compiled Code)
at
org.apache.jasper.compiler.TagBeginGenerator.generateServiceMethodStatements
(TagBeginGenerator.java:291)
at
org.apache.jasper.compiler.TagBeginGenerator.generate(TagBeginGenerator.java
:360)
at
org.apache.jasper.compiler.JspParseEventListener$GeneratorWrapper.generate(C
ompiled Code)
at
org.apache.jasper.compiler.JspParseEventListener.generateAll(Compiled Code)
at
org.apache.jasper.compiler.JspParseEventListener.endPageProcessing(JspParseE
ventListener.java:175)
at org.apache.jasper.compiler.Compiler.compile(Compiled Code)
at
org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
at
org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
at org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspSe
rvlet.java:152)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:164)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(Compiled Code)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(Compiled Code)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(Compiled
Code)
at java.lang.Thread.run(Thread.java:479)

Can Cedric or anyone shed some light?  My page seems straightforward enough,
and it seemed to work OK with standard Struts templates, but I need to use
some advanced features in the contentForm.jsp that require the use of the
Components Library.

Thanks!
-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW/ 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863




struts and XSP

2001-04-30 Thread Thorsten Mauch

Hi All
I review the mailing list. I found some discussion about
the posibiltiy to use XSP with struts, but i didn't know the 
latest result.
Does anybody now use XSP as a view for stuts. 
Or does anybody create XML content with a JSP
and perform a server side XSL transformation.

Thanx Thosten



html:message tag

2001-04-30 Thread Sue Deng

Hi,

I am trying to build form using struts taglib.  But I get no such tag
message  ...error when I use html:message tag.  I found that
struts-html.tld and struts-bean.tld files do not have a tag named
message, but the struts example uses that tag.  Why?

Thanks,

-Sue




RE: html:message tag

2001-04-30 Thread Jason Chaffee
Title: RE: html:message tag





it should be bean:message


-Original Message-
From: Sue Deng [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 5:26 PM
To: [EMAIL PROTECTED]
Subject: html:message tag



Hi,


I am trying to build form using struts taglib. But I get no such tag
message ...error when I use html:message tag. I found that
struts-html.tld and struts-bean.tld files do not have a tag named
message, but the struts example uses that tag. Why?


Thanks,


-Sue





RE: How to embed bean:message within a template

2001-04-30 Thread Michael Mok









Hi Jeff



Try this



template:put
name='title'

bean:message key=app.title/

 /template:put



Regards,



Michael Mok



-Original
Message-
From: Jeff Trent
[mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 1 May 2001 9:26
To: [EMAIL PROTECTED]
Subject: How to embed bean:message
within a template



Newbie
here. Just wondering how to accomplish this using templates. 




template:put name='title' content='bean:message
key=app.title/' direct='true' /

Can't
seem get the bean to evaluate the message text... Suggestions? I
tried direct on  off but no luck.



Thanks,

Jeff












What causes the Action Servlet to be Invoked at the Server Startup

2001-04-30 Thread Natra, Uday

Hi All,
I have a very fundamental question. Please bear with my naivete. Can any one
tell me how the ActionServlet gets invoked at the Application Server Start
up? I am using Weblogic6.0 and when I am starting the server, My Struts
application is being deployed and I see some messages being displayed on the
console where the code in the ActionServlet is being executed. I don't have
a clue as for how the ActionServlet is getting executed at the Startup. Does
it have anything to do with J2EE web application deployment?? Thank you very
much in Advance.

Uday.



RE: Creating html:hidden ... dynamically

2001-04-30 Thread Niall Pemberton

 We plan to store bean data has hidden form objects , so that it could be
 passed to the subsequent pages, without having to make the scope of the
 beans to be session. We do not know how many attributes the bean objects
 can have, and plan to store it in an array of hidden form objects like
 this.

How about using a Tag to generate the hidden fields for each of the beans
properties.

I have written the following StoreBeanTag which does this.

Niall


 Start of StoreBeanTag---
package mytaglib;

import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;

import javax.servlet.jsp.tagext.TagSupport;
import javax.servlet.jsp.JspException;

import org.apache.struts.util.PropertyUtils;
import org.apache.struts.util.RequestUtils;
import org.apache.struts.util.ResponseUtils;

/**
 *
 * This tag takes a Bean and stores all its properties/values
 * as hidden input type html tags.
 *
 * @author Niall Pemberton
 * @version 1.0
 */

public class StoreBeanTag extends TagSupport {

public static String QUOTE = \;

protected String name = null;
protected String property = null;
protected String scope = null;

/** Get the name */
public String getName() {
return (this.name);
}

/** Set the name */
public void setName(String name) {
this.name = name;
}

/** Get the property  */
public String getProperty() {
return (this.property);
}

/** Set the property */
public void setProperty(String property) {
this.property = property;
}

/** Get the scope of the property */
public String getScope() {
return (this.scope);
}

/** Set the scope of the property */
public void setScope(String scope) {
this.scope = scope;
}

/**
 * Process the tag
 */
public int doStartTag() throws JspException {

  StringBuffer buffer = new StringBuffer();

  // Find the specified Bean
  Object bean = null;
  if (property == null) {
bean = RequestUtils.lookup(pageContext, name, scope);
  } else {
bean = RequestUtils.lookup(pageContext, name, property, scope);
  }

  if (bean == null) {
// return (SKIP_BODY);
 JspException e = new JspException(StoreBeanTag: Missing bean  +
name+ +property);
 RequestUtils.saveException(pageContext, e);
 throw e;
  }

  // Get the beans properties
  PropertyDescriptor[] descriptors =
PropertyUtils.getPropertyDescriptors(bean);
  for (int i = 0; i  descriptors.length; i++) {
  String name = descriptors[i].getName();
  if (!(name.equals(class))) {
try {
  Object value = PropertyUtils.getSimpleProperty(bean, name);
  name = property == null ? name : property+.+name;
  buffer.append(createHiddenField(name, value));
}
catch (NoSuchMethodException ex) {}
catch (InvocationTargetException ex) {}
catch (IllegalAccessException ex) {}
  }
  }

  // Print the created message to our output writer
  ResponseUtils.write(pageContext, buffer.toString());

  // Continue processing this page
  return (SKIP_BODY);
}


/**
 * Create a hidden field for the property
 */
protected String createHiddenField(String property, Object obj) {

  if (obj == null)
return ;

  String value = obj.toString();
  if (value == null  || value.equals())
return ;

  return input type=+QUOTE+hidden+QUOTE+
name=+QUOTE+property+QUOTE+
   value=+QUOTE+value+QUOTE+/\r\n;

}
/**
 * Release all allocated resources.
 */
public void release() {

super.release();

name = null;
property = null;
scope = null;
}

}
 End of StoreBeanTag---




Re: What causes the Action Servlet to be Invoked at the Server Startup

2001-04-30 Thread Jason Chaffee

yes, it your deployment descriptor (web.xml) there is an attribute for
load-on-startup

Natra, Uday wrote:

 Hi All,
 I have a very fundamental question. Please bear with my naivete. Can any one
 tell me how the ActionServlet gets invoked at the Application Server Start
 up? I am using Weblogic6.0 and when I am starting the server, My Struts
 application is being deployed and I see some messages being displayed on the
 console where the code in the ActionServlet is being executed. I don't have
 a clue as for how the ActionServlet is getting executed at the Startup. Does
 it have anything to do with J2EE web application deployment?? Thank you very
 much in Advance.

 Uday.

--
Jason Chaffee
Software Engineer
MetaTV Inc.
Phone:(415) 289-8516





RE: What causes the Action Servlet to be Invoked at the Server Startup

2001-04-30 Thread Natra, Uday

Oh! I thought of some thing like that. But I completely missed it. Thank You
very much Jason.


-Original Message-
From: Jason Chaffee [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 9:33 PM
To: [EMAIL PROTECTED]
Subject: Re: What causes the Action Servlet to be Invoked at the Server
Startup


yes, it your deployment descriptor (web.xml) there is an attribute for
load-on-startup

Natra, Uday wrote:

 Hi All,
 I have a very fundamental question. Please bear with my naivete. Can any
one
 tell me how the ActionServlet gets invoked at the Application Server Start
 up? I am using Weblogic6.0 and when I am starting the server, My Struts
 application is being deployed and I see some messages being displayed on
the
 console where the code in the ActionServlet is being executed. I don't
have
 a clue as for how the ActionServlet is getting executed at the Startup.
Does
 it have anything to do with J2EE web application deployment?? Thank you
very
 much in Advance.

 Uday.

--
Jason Chaffee
Software Engineer
MetaTV Inc.
Phone:(415) 289-8516




RE: File upload problems

2001-04-30 Thread Azariah Jeyakumar

Hi,
I am picking up on an old thread.

 The first problem you reported might be fixed as of recent builds,
 please try a nightly build and let me know if it works.

I tried last night's build (20010430) and I could not reproduce the
file-upload problem that I was facing.

 As for the multibox issue, I'll definately look into it this week.

I noticed that this problem also has been fixed, Thanks.

Thanks
Azariah

*   From: Schachter, Michael 
*   Subject: RE: File upload problems 
*   Date: Mon, 23 Apr 2001 17:03:36 -0700 

Azariah,

The first problem you reported might be fixed as of recent builds,
please try a nightly build and let me know if it works.

As for the multibox issue, I'll definately look into it this week.

Thank you

-Original Message-
From: Azariah Jeyakumar [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 23, 2001 6:11 PM
To: '[EMAIL PROTECTED]'
Cc: Martin Cooper
Subject: File upload problems


Hi,

We are using the file upload feature of struts heavily. We face the foll
problems:

1. I get java.io.IOException: end of stream before boundary found!
intermittently (full stack trace below). Roughly 1 out of 10 or 20 times I
submit the form that contains File upload. I have not been able to identify
a pattern when this exception happens. But I think the exception happens
only when no file is actually entered/uploaded.

To elaborate, my form has several Submit buttons. Only 1 of the submit
button expects the type=file field to have a valid file name. All other
submit buttons dont care about the field. When I click on one of these other
submit buttons, I get the above exception, intermittently.

2. The tag struts:multibox does not work well in a form that has
enctype=multipart/form-data. Only the last checkbox that I selected is set
in the multibox form field. I expect a comma separated list of the value of
all the selected checkboxes. This works in the form if I remove the enctype
attribute.

We use jakarta-struts-1.0-b1.

Thanks
Azariah


Full stack trace for first problem:
500 Servlet Exception
java.io.IOException: end of stream before boundary found!
at
org.apache.struts.upload.MultipartValueStream.init(MultipartValueStream.ja
va:65)
at
org.apache.struts.upload.MultipartIterator.createLocalFile(MultipartIterator
.java:469)
at
org.apache.struts.upload.MultipartIterator.getNextElement(MultipartIterator.
java:201)
at
org.apache.struts.upload.DiskMultipartRequestHandler.handleRequest(DiskMulti
partRequestHandler.java:70)
at org.apache.struts.util.RequestUtils.populate(RequestUtils.java:447)
at
org.apache.struts.action.ActionServlet.processPopulate(ActionServlet.java:19
10)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1521)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:83)
at com.caucho.server.http.Invocation.service(Invocation.java:291)
at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121)
at
com.caucho.server.http.RunnerRequest.handleRequest(RunnerRequest.java:333)
at
com.caucho.server.http.RunnerRequest.handleConnection(RunnerRequest.java:266
)
at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
at java.lang.Thread.run(Thread.java:484)





abstract metohd error

2001-04-30 Thread Oussama Ktiri


 Hi,
I downloaded the latest version of struts, I am trying to get a JDBC example
work, the driver is alright..but I get this error
I am using mysql and tomcat

java.lang.AbstractMethodError
 at org.apache.struts.util.GenericConnection.(GenericConnection.java:118)
 at
org.apache.struts.util.GenericDataSource.createConnection(GenericDataSource.
java:623)
 at
org.apache.struts.util.GenericDataSource.getConnection(GenericDataSource.jav
a:417)
 at
com.husted.coreservlets.jdbc.FruitCreationAction.perform(FruitCreationAction
.java:107)
 at
org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1618)
 at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1428)
 at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:463)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at org.apache.tomcat.core.Handler.service(Handler.java:286)
 at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:79
7)
 at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpC
onnectionHandler.java:210)
 at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)
does anyone has an idea what this may be about




Re: Antwort: RE: Visual Age 3.5.3 Tomcat with Struts

2001-04-30 Thread Darren_James


 1.) Install Tomcat 3.1 Test Environment  look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to
 find IVJJavaCompiler.java

Tomcat Test Environment won't install on top of VA 3.5.3.  It says that the
correct version
of VisualAge is not installed, and exits the installer application.  Any
ideas on how to
trick the Tomcat Test Environment installer?  It says it expects VisualAge
3.5, but
apparently doesn't recognize 3.5.3 :

- Darren

P.S.
Thanks for the very detailed message on how to get things going with VA and
Tomcat.



   

Juergen.Walter 

@hrmcon.deTo: [EMAIL PROTECTED]   

  cc:  

04/27/01 04:49Subject: Antwort: RE: Visual Age 3.5.3  
Tomcat with Struts  
AM 

Please respond 

to struts-user 

   

   







Hi Darren,

we're using VAJ 3.5.2 Enterprise with Tomcat and Struts. First we tried to
run Struts 1.0b1 with Tomcat Test Env 3.1 but unfortunately Struts does not
work with Tomcat 3.1's XML-Parser. If you want you can make a XML
(javax.xml.*)  SQL (javax.sql.*) package and put it into Tomcats ./lib
directory and add it to VAJ's classpath. But if you use Tomcat 3.2.1,
struts works out of the box - but not that comfortable as the Tomcat Test
Env does, e.g. you can't debug JSP and Servlet Code anymore :(((
I did a hack (in Tomcats WebReaderXML.java to enable "jspPageCompiler"
again) and added "com.ibm.ivj.tomcat.IJVJavaCompiler" again to re-enable
in-workspace JSP and Servlet Debugging.

Running Tomcat 3.2.1 in VAJ 3.5.x
~~~
In short:
0.) Prerequisites:
  * latest jakarta-servlet-api _source_
  * tomcat 3.2.1 binary distribution (includes ./src already)
  * Tomcat 3.1 Test Environment from www.ibm.com/vadd (to get
"com.ibm.ivj.tomcat.IVJJavaCompiler.java")
  * struts 1.0b1 source distribution
1.) Install Tomcat 3.1 Test Environment  look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to find
IVJJavaCompiler.java
2.) Start VAJ, do _not_ "Add feature Apache Test Env 3.1"!!!
3.) Create new Package, e.g. Apache_Tomcat_321
4.) Import all source from jakarta-servlet-api (do _not_ use servlet-api
from VAJ or other precompiled javax.servlet.* - classes; they _must_ be
compiled within VAJ Workspace to enable debugging of your own servlets and
JSPs) into your Project
5.) import following -- compiled classes (not source!) - from jasper.jar
and webserver.jar  (both in tomcat-3.2.1/lib/)
jasper: all .class
webserver: org.apache.tomcat.logging.Logger,
org.apache.tomcat.logging.LogHelper, org.apache.tomcat.util.SimplePool
If VAJ still complains about missing classes (you see this in "All
Problems" - Tab) import compiled .class files from ./lib/*.jar until VAJ is
happy.
6.) create two classes: StartTomcat  StopTomcat (code is the same for
both!)

public class StartTomcat {
/**
 * StartTomcat constructor comment.
 */
public StartTomcat() {
 super();
}
/**
 * Starts the application.
 * @param args an array of command-line arguments
 */
public static void main(java.lang.String[] args) {
 // Insert code to start the application here.
 try {
  Class aClass = Class.forName("org.apache.tomcat.startup.Tomcat");
  java.lang.reflect.Method method = null;
  Class[] argsClass = new Class[] { String[].class };
  method = aClass.getMethod("main", argsClass);
  Object object = null;
  Object[] arguments = new Object[] { args };
  method.invoke(object, arguments);
 } catch (Exception e) {
  System.out.println("Exception occured: " + e.getMessage());
  e.printStackTrace();

 }
}
}

Right click StartTomcat in VAJ and goto "Properties-Classpath": have
follwing files and dirs in classpath:

.;
..\Apache_Struts;
..\IBM IDE Utility class libraries;
..\JSP Page Compile Generated Code;
.\;
.\conf\;
.\src\;
.\lib\jaxp.jar;
.\lib\parser.jar;
.\lib\webserver.jar;
.\lib\jasper.jar;
.\webapps\;
.\webapps\admin\;
.\webapps\admin\WEB-INF\classes\;
.\webapps\examples\;
.\webapps\examples\WEB-INF\classes\;
..\IBM IDE Utility local implementation\;

And in Properties-Programm have no 

Re: Antwort: RE: Visual Age 3.5.3 Tomcat with Struts

2001-04-30 Thread dion


Is there a reason you don't want to use the WebSphere Test Environment in
3.5.3?
--
dIon Gillard, Multitask Consulting
Work:  http://www.multitask.com.au
NetRexx: http://www.multitask.com.au/NetRexx.nsf


   
 
Darren_James@  
 
i2.com   To: [EMAIL PROTECTED]
 
 cc:   
 
01/05/2001   Subject: Re: Antwort: RE: Visual Age 
3.5.3  Tomcat with Struts
01:14 PM   
 
Please 
 
respond to 
 
struts-user
 
   
 
   
 





 1.) Install Tomcat 3.1 Test Environment  look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to
 find IVJJavaCompiler.java

Tomcat Test Environment won't install on top of VA 3.5.3.  It says that the
correct version
of VisualAge is not installed, and exits the installer application.  Any
ideas on how to
trick the Tomcat Test Environment installer?  It says it expects VisualAge
3.5, but
apparently doesn't recognize 3.5.3 :

- Darren

P.S.
Thanks for the very detailed message on how to get things going with VA and
Tomcat.




Juergen.Walter

@hrmcon.deTo:
[EMAIL PROTECTED]
  cc:

04/27/01 04:49Subject: Antwort: RE: Visual
Age 3.5.3  Tomcat with Struts
AM

Please respond

to struts-user









Hi Darren,

we're using VAJ 3.5.2 Enterprise with Tomcat and Struts. First we tried to
run Struts 1.0b1 with Tomcat Test Env 3.1 but unfortunately Struts does not
work with Tomcat 3.1's XML-Parser. If you want you can make a XML
(javax.xml.*)  SQL (javax.sql.*) package and put it into Tomcats ./lib
directory and add it to VAJ's classpath. But if you use Tomcat 3.2.1,
struts works out of the box - but not that comfortable as the Tomcat Test
Env does, e.g. you can't debug JSP and Servlet Code anymore :(((
I did a hack (in Tomcats WebReaderXML.java to enable jspPageCompiler
again) and added com.ibm.ivj.tomcat.IJVJavaCompiler again to re-enable
in-workspace JSP and Servlet Debugging.

Running Tomcat 3.2.1 in VAJ 3.5.x
~~~
In short:
0.) Prerequisites:
  * latest jakarta-servlet-api _source_
  * tomcat 3.2.1 binary distribution (includes ./src already)
  * Tomcat 3.1 Test Environment from www.ibm.com/vadd (to get
com.ibm.ivj.tomcat.IVJJavaCompiler.java)
  * struts 1.0b1 source distribution
1.) Install Tomcat 3.1 Test Environment  look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to find
IVJJavaCompiler.java
2.) Start VAJ, do _not_ Add feature Apache Test Env 3.1!!!
3.) Create new Package, e.g. Apache_Tomcat_321
4.) Import all source from jakarta-servlet-api (do _not_ use servlet-api
from VAJ or other precompiled javax.servlet.* - classes; they _must_ be
compiled within VAJ Workspace to enable debugging of your own servlets and
JSPs) into your Project
5.) import following -- compiled classes (not source!) - from jasper.jar
and webserver.jar  (both in tomcat-3.2.1/lib/)
jasper: all .class
webserver: org.apache.tomcat.logging.Logger,
org.apache.tomcat.logging.LogHelper, org.apache.tomcat.util.SimplePool
If VAJ still complains about missing classes (you see this in All
Problems - Tab) import compiled .class files from ./lib/*.jar until VAJ is
happy.
6.) create two classes: StartTomcat  StopTomcat (code is the same for
both!)

public class StartTomcat {
/**
 * StartTomcat constructor comment.
 */
public StartTomcat() {
 super();
}
/**
 * Starts the application.
 * @param args an array of command-line arguments
 */
public static void main(java.lang.String[] args) {
 // Insert code to start the application here.
 try {
  Class aClass = Class.forName(org.apache.tomcat.startup.Tomcat);
  java.lang.reflect.Method method = null;
  Class[] argsClass = new Class[] { String[].class };
  method = aClass.getMethod(main, argsClass);
  Object object = null;
  Object[] 

Re: Antwort: RE: Visual Age 3.5.3 Tomcat with Struts

2001-04-30 Thread Darren_James


Dion,

I had problems trying to configure the WTE.  The documentation
in VAJ was lousy in my opinion.  I was able to get the
default application working with WTE, access the samples, etc.,
but had troubles attempting to create an additional webapp.  I
followed the instructions in VAJ help for creating an additional
webapp, but got an exception when reloading the servlet engine.
The problem wasn't obvious, so after trying several different
permutations of changes, I gave up.  It may have been something
simple, but I ran out of ideas on how to debug the configuration.

Also, it seemed that the layout of directories, etc for WTE was
different than a standard j2ee webapp structure.  (e.g. the
default app had no WEB-INF).  I kind-of prefer open-source,
j2ee compliance, etc.

- Darren.



   
   
dion@multitas  
   
k.com.au To: [EMAIL PROTECTED]
   
 cc: [EMAIL PROTECTED]   
   
04/30/01 Subject: Re: Antwort: RE: Visual Age 
3.5.3  Tomcat with Struts  
10:39 PM   
   
Please 
   
respond to 
   
struts-user
   
   
   
   
   





Is there a reason you don't want to use the WebSphere Test Environment in
3.5.3?
--
dIon Gillard, Multitask Consulting
Work:  http://www.multitask.com.au
NetRexx: http://www.multitask.com.au/NetRexx.nsf



Darren_James@

i2.com   To:
[EMAIL PROTECTED]
 cc:

01/05/2001   Subject: Re: Antwort: RE:
Visual Age 3.5.3  Tomcat with Struts
01:14 PM

Please

respond to

struts-user








 1.) Install Tomcat 3.1 Test Environment  look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to
 find IVJJavaCompiler.java

Tomcat Test Environment won't install on top of VA 3.5.3.  It says that the
correct version
of VisualAge is not installed, and exits the installer application.  Any
ideas on how to
trick the Tomcat Test Environment installer?  It says it expects VisualAge
3.5, but
apparently doesn't recognize 3.5.3 :

- Darren

P.S.
Thanks for the very detailed message on how to get things going with VA and
Tomcat.




Juergen.Walter

@hrmcon.deTo:
[EMAIL PROTECTED]
  cc:

04/27/01 04:49Subject: Antwort: RE: Visual
Age 3.5.3  Tomcat with Struts
AM

Please respond

to struts-user









Hi Darren,

we're using VAJ 3.5.2 Enterprise with Tomcat and Struts. First we tried to
run Struts 1.0b1 with Tomcat Test Env 3.1 but unfortunately Struts does not
work with Tomcat 3.1's XML-Parser. If you want you can make a XML
(javax.xml.*)  SQL (javax.sql.*) package and put it into Tomcats ./lib
directory and add it to VAJ's classpath. But if you use Tomcat 3.2.1,
struts works out of the box - but not that comfortable as the Tomcat Test
Env does, e.g. you can't debug JSP and Servlet Code anymore :(((
I did a hack (in Tomcats WebReaderXML.java to enable "jspPageCompiler"
again) and added "com.ibm.ivj.tomcat.IJVJavaCompiler" again to re-enable
in-workspace JSP and Servlet Debugging.

Running Tomcat 3.2.1 in VAJ 3.5.x
~~~
In short:
0.) Prerequisites:
  * latest jakarta-servlet-api _source_
  * tomcat 3.2.1 binary distribution (includes ./src already)
  * Tomcat 3.1 Test Environment from www.ibm.com/vadd (to get
"com.ibm.ivj.tomcat.IVJJavaCompiler.java")
  * struts 1.0b1 source distribution
1.) Install Tomcat 3.1 Test Environment  look into
/path/to/vaj35/ide/features/com.ibm.ivj.tomcat/... to find
IVJJavaCompiler.java
2.) Start VAJ, do _not_ "Add feature Apache Test Env 3.1"!!!
3.) Create new Package, e.g. Apache_Tomcat_321
4.) Import all source from jakarta-servlet-api (do _not_ use servlet-api
from VAJ or other precompiled javax.servlet.* - classes; they _must_ be
compiled within VAJ Workspace to enable debugging of your own 

Shopping Cart Project

2001-04-30 Thread josephhakim


Hi guys !

Well. Ok. So there's no Shopping Cart example utilising struts out there.
And although it's been done so many times using other languages and
frameworks, it's time to put one together for the struts community. After
all, the 'shopping cart' is really the 'hello world' for web apps !! It will
make a great foundation for struts newbies and hopefully decrease the
learning curve a little. It may also allow the struts veterans to show off
some of the advanced concepts. Who knows, it may even be added to the struts
distribution as an advanced example!

Is anyone interested in contributing to this ? What are some thoughts ?

If I get enough people on board, then I'll set up a CVS (source control)
server and get the project underway !

Cheers,

Joe.


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




RE: switch from http to https

2001-04-30 Thread Michael Wilimsky

thanx...

can You give a code example for that approach?

michael

-Original Message-
From: Jonathan [mailto:[EMAIL PROTECTED]]
Sent: Freitag, 27. April 2001 17:26
To: [EMAIL PROTECTED]
Subject: Re: switch from http to https


You have to use url rewriting to send and save the session temporarily on
the https side, and when you are done you have to resend the saved session
info, again via url rewriting, back to the non-secure side which will still
have your session if you didnt take too long on the https side, and then you
get the session with the session you passed back.
Otherwise you need to have a webserver / appserver combo which has the
ability to cluster and share sessions

- Original Message -
From: Michael Wilimsky [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 9:22 AM
Subject: switch from http to https


 does anyone out there have an idea of how to perform

 the switching between http and https?

 i want to make the login.jsp secure but leave the other jsp-files in the
 insecure section...

 i also have problems to perform a download via https... i get strange
 browser error-messages

 any help appreciated

 michy






RE: Struts and WebSphere

2001-04-30 Thread Assenza, Chris

Yeah, that's what I did/meant. I should have been more clear. :)
Unfortunately, that never worked for me!  

However, there is nothing to preclude user error on my part, albeit that is
not a difficult or complex task.  I haven't had the opportunity to go back
and try again since then and the second WEB-INF has actually been useful for
us.  So, who knows, technology is weird! :D (hehe)

Chris

-Original Message-
From: Stephen Schaub [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 10:49 AM
To: [EMAIL PROTECTED]
Subject: Re: Struts and WebSphere


Don't add WEB-INF to the classpath; instead, add its parent
(/web) to the classpath. If you add WEB-INF to the
classpath, when a servlet looks for /WEB-INF/whatever, it
will try to find it in WEB-INF/WEB-INF/whatever.

Does that make sense?

Stephen

- Original Message -
From: Assenza, Chris [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 30, 2001 9:03 AM
Subject: RE: Struts and WebSphere


Oops, sorry guys - missed your discussion below, ignore what
I just said! :P

BTW, I've had no success adding WEB-INF to the classpath.  I
guess it should probably be listed as an alternate method,
but not a guaranteed one.
:)

Chris

-Original Message-
From: Assenza, Chris [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 9:02 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Struts and WebSphere


Did you make sure to create a WEB-INF directory under the
servlets
directory, per step 5? :)

-Chris Assenza



-Original Message-
From: Stephen Schaub [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 5:57 PM
To: [EMAIL PROTECTED]
Subject: Re: Struts and WebSphere


 I'd appreciate it if someone else running WAS would
 give this a spin to  double-check me.

I'm running WAS 3.5.3 Advanced 60-day trial. I followed your
instructions and was able to get index.jsp from the
struts-example app to display. However, when I click on the
Register link, I get the following error:

Error 500
An error has occured while processing request:
http://localhost/struts-example/editRegistration.do
Message: Failed to load target servlet [action]

Target Servlet: action
StackTrace:


Root Error-1: Missing configuration resource for path
/WEB-INF/struts-config.xml


javax.servlet.UnavailableException: Missing configuration
resource for path /WEB-INF/struts-config.xml
 at
javax.servlet.ServletException.init(ServletException.java:
107)
 ...

I also notice that when the application is starting up, the
following messages appear in the log:

Loading servlet: database
[Servlet LOG]: database: init
[Servlet LOG]: database: Initializing database servlet
[Servlet LOG]: database: Loading database from
'/WEB-INF/database.xml'
[Servlet LOG]: database: No such resource available -
loading empty database
Servlet available for service: database

.

Seems like it's having difficulty finding resources in the
/WEB-INF folder. Any suggestions?

Stephen Schaub

- Original Message -
From: Dan Miser [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 8:27 PM
Subject: Struts and WebSphere


I noticed the WAS installation instructions at the URLs
below needed to be  merged. At this point, there is no
reason to recompile the Struts source to  make things work
with WAS, so the second URL is a bit dated. I also
found  the key to making Struts work without resorting to
creating extra WEB-INF directories or moving files around.

I took the text from the first URL and modified it. I split
the doc up into  2 parts: general Struts config and getting
the struts-example to run under  WAS.

I'd appreciate it if someone else running WAS would give
this a spin to  double-check me. If it checks out OK, I
would suggest that this doc replace the other two.
.




Creating html:hidden ... dynamically

2001-04-30 Thread Anil Guntgatti

Hi,

We plan to store bean data has hidden form objects , so that it could be
passed to the subsequent pages, without having to make the scope of the
beans to be session. We do not know how many attributes the bean objects
can have, and plan to store it in an array of hidden form objects like
this.

input type=hidden name=hidden1 value=value1
input type=hidden name=hidden2 value=value2
...
input type=hidden name=hiddenn value=valuen

As per the struts framework, we need to define getter and setter for each
and every html form objects in the java form object. How do we go about
doing this.
Any help would be appreciated.

Anil.
Mail to: [EMAIL PROTECTED]





New User

2001-04-30 Thread Sanjeev Mishra

Hi! All :

I am new to struts. I am able to run the struts-documentation Application.
But while running the struts example application using tag Libraries i am
getting an error in the index.jap page telling that

/index.jsp(3): Error in using tag library uri='/WEB-INF/struts-html.tld'
prefix='html': The Tag class 'org.apache.struts.taglib.html.ButtonTag' has
no setter method corresponding to TLD declared attribute 'styleid', (JSP 1.1
spec, 5.4.1)
probably occurred due to an error in /index.jsp line 3:
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html % 

Can anyone help by telling me do i need to make any classpath add ons or
configuration changes !!!

Thanks in advance




RE: Creating html:hidden ... dynamically

2001-04-30 Thread Lewis Henderson

You could use html:hidden property=hidden[1] value=value1/

Look at the struts-documentation for indexed properties...

Your getter/setter methods use an int parameter... 

String getHidden(int index){}
and
void setHidden(int index, String value){}

Any help?


Lewis
-Original Message-
From: Anil Guntgatti [mailto:[EMAIL PROTECTED]]
Sent: 30 April 2001 16:13
To: [EMAIL PROTECTED]
Subject: Creating html:hidden ...  dynamically


Hi,

We plan to store bean data has hidden form objects , so that it could be
passed to the subsequent pages, without having to make the scope of the
beans to be session. We do not know how many attributes the bean objects
can have, and plan to store it in an array of hidden form objects like
this.

input type=hidden name=hidden1 value=value1
input type=hidden name=hidden2 value=value2
...
input type=hidden name=hiddenn value=valuen

As per the struts framework, we need to define getter and setter for each
and every html form objects in the java form object. How do we go about
doing this.
Any help would be appreciated.

Anil.
Mail to: [EMAIL PROTECTED]






Re: Iterate certain number of times?

2001-04-30 Thread dhay



Levi,

Thanks for your thoughts.  However, I believe I am doing things correctly as
follows:  this page displays a formatted version of a logfile on the server.
This logfile can be up to 50 MB in size, and a filtering mechanism is provided
so the user can browse the whole file, or certain categories of log entries.
Obviously, with a file of this size, it is not feasible to load it all into
memory at one time, and use a pager tag to display it.  Instead, I do the
necessary filtering, and create a list of file pointers to the log entries the
use wishes to see (things are further complicated as the variably length log
entries have to be reversed to display in chronologically descending order,
instead of ascending).  When the user requests the next page, the next chunk of
log entries are retrieved from the file through the action and displayed.

Everything is working nicely, and I want to put the finishing touches on it to
simply display links to each page, rather than just next and previous.  In
my initial action I calculate how many pages I have etc. and simply want to do a
for loop to create the links.  As Niall pointed out, I could load these page
numbers into a Collection and then use the iterate tag, but this seems to be be
overkill.

Is there really not a Struts tag to do a for loop?!!!  If not, I belive that
it is a major lack.  Are there any plans to introduce one, maybe when the logic
tags are improved?

Thanks.  Any other ideas gratefully received!

Dave





Levi Cook [EMAIL PROTECTED] on 04/27/2001 05:38:22 PM

Please respond to [EMAIL PROTECTED]

To:   [EMAIL PROTECTED]
cc:(bcc: David Hay/Lex/Lexmark)
Subject:  Re: Iterate certain number of times?



Of course I have no idea what your system actually looks like, but I would
question its retrieving data all the way up to the view layer and then not
displaying it.

If possible I would reconsider the design of the controllers responsible
for constructing the Collection you are interested in iterating over.

Consider the following method signatures in a hypothetical controller for
searching a product catalog:

public Collection findProducts(ProductInfo searchCriteria)
vs.
public Collection findProducts(int startIndex, int count, ProductInfo
searchCriteria)
vs.
public Iterator findProducts(int startIndex, int count, ProductInfo
searchCriteria)

I would expect the first to return a collection of every product in my
entire system. I believ this is probably what your system is doing and I
wouldn't consider it especially useful in a controller responsible for
supporting a view.

The second approach introduces a bit more flexibility by allowing the view
the decide how many products its interested in displaying.

The third approach is probably what I would prefer, I think it just
clarifies the intent of the method for view builders.. Might be a little
stronger form of encapsulation too.

Just my thoughts anyway, hope its useful,
Levi Cook

- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, April 27, 2001 3:46 PM
Subject: RE: Iterate certain number of times?




 Thanks, but I don't need all that functionality.  I have already set up
the
 paging in my actions, but want to generate the links myself simply looping
 through.

 Is there not a way to loop through some HTML a set number of times in
struts
 (rather than over a collection)?!

 Dave




 Karl Basel [EMAIL PROTECTED] on
04/27/2001
 04:21:17 PM

 Please respond to [EMAIL PROTECTED]

 To:   [EMAIL PROTECTED]
 cc:(bcc: David Hay/Lex/Lexmark)
 Subject:  RE: Iterate certain number of times?



 Hi,

 There's a good pager taglib at jsptags.com. I've used it in a struts app
and
 does the job quite well when embedded in the iterate tags.

 logic:iterate
pg:item
  Item Details
/pg:item
 /logic:iterate

 Hope it helps,
 karl

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: 27 April 2001 09:29
 To: [EMAIL PROTECTED]
 Subject: Iterate certain number of times?




 Hi.

 Am wanting to iterate a certain number of times, based on a value in my
form
 bean, to create a set of page links for the number of pages the user can
 view
 (similar to at the bottom of most search engine results).

 How do I do this with Struts?  Obviously I am not iterating over a
 collection.
 But surely it is possible - what am I missing?

 Many thanks,

 Dave


















Where to forward when validate returns false in wizard style forms?

2001-04-30 Thread Seth Ladd

Hello,

I may not understand properly the way struts deals with things when
validate=true in the action mapping, so please bear with me.

I have a wizard style input form(s) all using the same Action.  Most of the
time, the Action will only forward to the next page.  Only at the last page
will the Action perform its work.

I want to take advantage of struts' automatic validation of FormBeans.  I
believe, if I set validate=true, then if validate returns false, struts
will automatically forward back to the input page (as specified by the input
attribute of the action-mapping element).  It seems that this will not work
properly for a wizard style approach.  This is because the input page
changes for every step in the wizard process.

Has anyone else dealt with this problem?  Do I have to manually perform the
validation myself inside the Action?  Would it be better to just have an
Action for every step in the wizard process?

Thanks for any tips or pointers,
Seth


Seth Ladd | Software Engineer, Product Development
Brivo Systems, Inc.
[EMAIL PROTECTED]

Confidential and Proprietary, Brivo Systems, Inc.





Re:

2001-04-30 Thread Rick Horowitz

Seth,

I just received an empty message from you. Did you mean to send something 
to me?

At 08:36 AM 4/30/01 +, you wrote:


Rick Horowitz


_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




RE: Creating html:hidden ... dynamically

2001-04-30 Thread Jason Chaffee
Title: RE: Creating html:hidden ...  dynamically





Is there a reason you don't want to store this information in a bean, It makes more sense than storing it in hidden fields. You are essentially doing your own session scope management. Why not let your container do this for you?

-Original Message-
From: Anil Guntgatti [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 8:13 AM
To: [EMAIL PROTECTED]
Subject: Creating html:hidden ...  dynamically



Hi,


We plan to store bean data has hidden form objects , so that it could be
passed to the subsequent pages, without having to make the scope of the
beans to be session. We do not know how many attributes the bean objects
can have, and plan to store it in an array of hidden form objects like
this.


input type=hidden name=hidden1 value=value1
input type=hidden name=hidden2 value=value2
...
input type=hidden name=hiddenn value=valuen


As per the struts framework, we need to define getter and setter for each
and every html form objects in the java form object. How do we go about
doing this.
Any help would be appreciated.


Anil.
Mail to: [EMAIL PROTECTED]





RE: Where to forward when validate returns false in wizard style forms?

2001-04-30 Thread Jason Chaffee
Title: RE: Where to forward when validate returns false in wizard style forms?





Yes, it would be better to have an action for each step in the process. That is what MVC/Model 2 is all about.


-Original Message-
From: Seth Ladd [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 8:33 AM
To: [EMAIL PROTECTED]
Subject: Where to forward when validate returns false in wizard style
forms?



Hello,


I may not understand properly the way struts deals with things when
validate=true in the action mapping, so please bear with me.


I have a wizard style input form(s) all using the same Action. Most of the
time, the Action will only forward to the next page. Only at the last page
will the Action perform its work.


I want to take advantage of struts' automatic validation of FormBeans. I
believe, if I set validate=true, then if validate returns false, struts
will automatically forward back to the input page (as specified by the input
attribute of the action-mapping element). It seems that this will not work
properly for a wizard style approach. This is because the input page
changes for every step in the wizard process.


Has anyone else dealt with this problem? Do I have to manually perform the
validation myself inside the Action? Would it be better to just have an
Action for every step in the wizard process?


Thanks for any tips or pointers,
Seth



Seth Ladd | Software Engineer, Product Development
Brivo Systems, Inc.
[EMAIL PROTECTED]


Confidential and Proprietary, Brivo Systems, Inc.





RE:

2001-04-30 Thread Halldór Magnússon
Title: RE: 






No, I'm sorry...my mistake!


-Original Message-

From: Rick Horowitz [mailto:[EMAIL PROTECTED]]

Sent: 30. apríl 2001 16:32

To: [EMAIL PROTECTED]

Subject: Re: 



Seth,


I just received an empty message from you. Did you mean to send something 

to me?


At 08:36 AM 4/30/01 +, you wrote:




Rick Horowitz




_


Do You Yahoo!?


Get your free @yahoo.com address at http://mail.yahoo.com







RE: Where to forward when validate returns false in wizard style forms?

2001-04-30 Thread Seth Ladd


 Yes, it would be better to have an action for each step in the process.
 That is what MVC/Model 2 is all about.

Thanks for the reply!  That's the same conclusion I came to.  What I'm
trying is having the same Action class handle each step, since for the
wizard style all but the last step only forward to the next phase.  I am
using validate=true so if the user has an error, struts will forward back
to the input page.  So my single Action class just checks forward to next
for all but the last step.

Next I'm going to learn about the token functionality.

Thanks very much,
Seth




RE: indexed property with a string

2001-04-30 Thread Iraklis Kourtidis

Hi Michiel,

this is not a stupid question. The answer unfortunately is that you can't
(as far as I know). This is causing us pain here in my company. For more
information, please follow the series of emails with the subject
(architectural issue/feature request) JavaBeans in Struts aren't flexible
enough (you can also find it at the mail archive at
http://www.mail-archive.com/struts-user@jakarta.apache.org

As far as the why not? question goes: my (educated) guess is that all that
Javabean stuff works through introspection, so when you specify property
foo,there has to be a function called 'getFoo'.

hope this helps,
Iraklis



-Original Message-
From: Michiel Meeuwissen [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 27, 2001 5:40 AM
To: [EMAIL PROTECTED]
Subject: indexed property with a string


Perhaps a stupid question, but I'm rather new to taglibs and beans:

I think I can do:
bean:write name=answernode property=value[2] /
where I have an 'indexed' property value. It is indexed with a int,
so it calls a method 'getValue(int)'.

Can I also have a property which is indexed with a string, which would
call 'getValue(String)' ?

 Michiel

--
Michiel Meeuwissen - NOS internet
Mediacentrum kamer 203 - tel. +31 (0)35 6773065
http://www.mmbase.org
http://www.purl.org/NET/mihxil/





RE: Iterate certain number of times?

2001-04-30 Thread Donnie_Hall



Hey that's pretty cool.  I got it working in about 10 minutes.  One question
though.  I had to move my iterate bean from Request to Session scope.  Is there
any way to keep it at the request level?

Thanks,
Donnie Hall



|+--
||  kbasel@freemail.|
||  absa.co.za  |
||  |
||  04/27/2001 03:21|
||  PM  |
||  Please respond  |
||  to struts-user  |
||  |
|+--
  |
  ||
  |   To: [EMAIL PROTECTED]   |
  |   cc: (bcc: Donnie Hall/Enron Communications)  |
  |   Subject: RE: Iterate certain number of times?|
  |



Hi,

There's a good pager taglib at jsptags.com. I've used it in a struts app and
does the job quite well when embedded in the iterate tags.

logic:iterate
   pg:item
   Item Details
   /pg:item
/logic:iterate

Hope it helps,
karl

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 27 April 2001 09:29
To: [EMAIL PROTECTED]
Subject: Iterate certain number of times?




Hi.

Am wanting to iterate a certain number of times, based on a value in my form
bean, to create a set of page links for the number of pages the user can
view
(similar to at the bottom of most search engine results).

How do I do this with Struts?  Obviously I am not iterating over a
collection.
But surely it is possible - what am I missing?

Many thanks,

Dave










Re: New User [ERROR IN BaseHandlerTag FormTag]

2001-04-30 Thread Jean-Noel Ribette

I'm affraid this error comes from an error in the cvs.

The attribute styleId was introduced in the class BaseHandlerTag of the deprecated 
org.apache.struts.taglib package and
not org.apache.struts.taglib.html (same for FormTag) on the 18th
(http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01153.html)


Can any commiter correct this ?

Thanks,

Jean-Noel

PS: just remove the styleId attribute from the tld file to get it work.

- Original Message -
From: Sanjeev Mishra [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 30, 2001 5:22 PM
Subject: New User


 Hi! All :

 I am new to struts. I am able to run the struts-documentation Application.
 But while running the struts example application using tag Libraries i am
 getting an error in the index.jap page telling that

 /index.jsp(3): Error in using tag library uri='/WEB-INF/struts-html.tld'
 prefix='html': The Tag class 'org.apache.struts.taglib.html.ButtonTag' has
 no setter method corresponding to TLD declared attribute 'styleid', (JSP 1.1
 spec, 5.4.1)
 probably occurred due to an error in /index.jsp line 3:
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

 Can anyone help by telling me do i need to make any classpath add ons or
 configuration changes !!!

 Thanks in advance






Returning from a form apge

2001-04-30 Thread James Howe

In our web application, we have two pages from which a user can access a 
third page.  From the third page (which is form to fill out and save), the 
user either saves or cancels their action, and the user is returned to the 
page from which they originally started.  However, the third page has no 
knowledge about where it came from so it doesn't no who to forward to when 
its action is complete.

I'm not sure how best to handle this situation.  One option would be to use 
a parameter on the link to the third page with a value indicating the page 
to return to.  However, I'm using an html:link tag which is passing other 
object related parameters on to the third screen (the form uses this 
information to populate itself).  What I would like to do is get the 
parameters from the object and then append another parameter which 
indicates the page to return to but I can't do that and use the link 
tag.  I'm toying with the idea of building a custom link tag which also 
takes a return attribute.  This tag would put the return information in 
the parameter list that gets generated.  Before I do that, however, I'm 
wondering what other ways people have used to address this sort of problem? 
(I assume that I'm not the only person to have encoutered this situation)

Any tips or suggestions would be appreciated.

Thanks.




Form tag question

2001-04-30 Thread Ross

Hi all

I'm working my way through struts-example and the documentation and I
am confused about the process a form tag takes to create an ActionForm
bean if one doesn't exist. There seems to be conflicting documentation.

The walking tour of the example says.

First, the logon.jsp makes use of the custom-tag form. This tag can
scan the application's properties for a form bean related to the
path /logon.jsp (from the link on the welcome page).

Which sounds the same as the html tag libray guide which says:

The name of the bean and its class can be specified as a property to
the form tag, but may also be omitted. If omitted, the ActionMappings
database (loaded from the struts-config.xml file) is consulted. If the
current page is specified as the input property for an action, the
name
of the action is used. The type property for the bean is also then
taken from the configuration, via a Form Bean definition.

But the html tag library reference says this for the name attribute of
the form tag:

Name of the request scope or session scope bean (as defined by the
scope attribute) whose properties will be used to populate the input
field values. If no such bean is found, a new bean will be created and
added to the appropriate scope, using the Java class name specified by
the type attribute.

If this attribute is not specified, it will be calculated by using the
value of the action attribute to look up the corresponding
ActionMapping element, from which we will select the specified form
bean name.

So in struts-example/login.jsp, does it find a correct action mapping
because there is a mapping with path=/logon which is the same as the
form tag action attribute or does it find it because input=/logon.jsp
which is the jsp url?

If the ActionForm bean is created in a form tag rather than in an
action bean earlier, do the request parameters not get updated to the
bean? I notice that if I go directly to login.jsp and append
?username=ross to the url, then this does not appear in the textbox.

Slightly off topic but do I understand correctly that the reason why
the login link in struts-example/index.jsp goes directly to login.jsp
rather than login.do is because in the case of a login form we don't
want to display anything initially in the boxes. That is the main thing
that's different between login and other forms in the example. Usually
we would go to an action instead of a jsp directly?

Thanks
Ross


__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



RE: New User [ERROR IN BaseHandlerTag FormTag]

2001-04-30 Thread Sanjeev Mishra

Thanks ! Jean,

But i got it working through a different XML Parser.
Yes!! That styleId attribute is a new edition

Sanjeev

-Original Message-
From: Jean-Noel Ribette [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 11:08 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: New User [ERROR IN BaseHandlerTag  FormTag]


I'm affraid this error comes from an error in the cvs.

The attribute styleId was introduced in the class BaseHandlerTag of the
deprecated org.apache.struts.taglib package and
not org.apache.struts.taglib.html (same for FormTag) on the 18th
(http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg01153.html)


Can any commiter correct this ?

Thanks,

Jean-Noel

PS: just remove the styleId attribute from the tld file to get it work.

- Original Message -
From: Sanjeev Mishra [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, April 30, 2001 5:22 PM
Subject: New User


 Hi! All :

 I am new to struts. I am able to run the struts-documentation Application.
 But while running the struts example application using tag Libraries i am
 getting an error in the index.jap page telling that

 /index.jsp(3): Error in using tag library uri='/WEB-INF/struts-html.tld'
 prefix='html': The Tag class 'org.apache.struts.taglib.html.ButtonTag' has
 no setter method corresponding to TLD declared attribute 'styleid', (JSP
1.1
 spec, 5.4.1)
 probably occurred due to an error in /index.jsp line 3:
 %@ taglib uri=/WEB-INF/struts-html.tld prefix=html %

 Can anyone help by telling me do i need to make any classpath add ons or
 configuration changes !!!

 Thanks in advance





RE: Returning from a form apge

2001-04-30 Thread Jason Chaffee
Title: RE: Returning from a form apge





If you are using the MVC design pattern then you will have an action associated with the save. What I have done is keep a hidden field for the referring page, which keeps track of the mapping key. This way I am able to forward to the jsp that originally started the action.

-Original Message-
From: James Howe [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 30, 2001 11:44 AM
To: [EMAIL PROTECTED]
Subject: Returning from a form apge



In our web application, we have two pages from which a user can access a 
third page. From the third page (which is form to fill out and save), the 
user either saves or cancels their action, and the user is returned to the 
page from which they originally started. However, the third page has no 
knowledge about where it came from so it doesn't no who to forward to when 
its action is complete.


I'm not sure how best to handle this situation. One option would be to use 
a parameter on the link to the third page with a value indicating the page 
to return to. However, I'm using an html:link tag which is passing other 
object related parameters on to the third screen (the form uses this 
information to populate itself). What I would like to do is get the 
parameters from the object and then append another parameter which 
indicates the page to return to but I can't do that and use the link 
tag. I'm toying with the idea of building a custom link tag which also 
takes a return attribute. This tag would put the return information in 
the parameter list that gets generated. Before I do that, however, I'm 
wondering what other ways people have used to address this sort of problem? 
(I assume that I'm not the only person to have encoutered this situation)


Any tips or suggestions would be appreciated.


Thanks.





How to embed bean:message within a template

2001-04-30 Thread Jeff Trent



Newbie here. Just wondering how to accomplish 
this using templates. 

 template:put name='title' 
content='bean:message key="app.title"/' direct='true' 
/
Can't seem get the bean to evaluate the message 
text... Suggestions? I tried direct on  off but no 
luck.

Thanks,
Jeff