dynamic widgets

2004-03-25 Thread Dean A. Hoover
Scenario: An HTML form is contructed using
JSP where most of the widgets are statically created
(except for labels). However, there is a group of
check boxes which are created based on information
contained in a database. There may be one checkbox
or many. How would you express this in the form-bean
in struts-config.xml. I am using DynaValidatorForm
but will actually be doing validation for this group
of checkboxes in the Action.
Any ideas?
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: pre-populating DynaValidatorForm

2004-03-23 Thread Dean A. Hoover
I am using struts 1.1, and I am directly instantiating a 
DynaValidatorForm in
my Action class. I am hesitant to embrace struts 1.2 at this time, 
especially if
the difference between 1.1 and 1.2 is as large as betwee 1.0 and 1.1. Is 
there
some other way to accomplish it?

Dean Hoover

Hubert Rabago wrote:

What version of Struts are you using?  How are you instantiating your
Dyna*Form?  Struts 1.1 didn't really have direct support for instantiating
DyanForms from an Action object.  Struts 1.2.0/nightly build does.  Is it
possible that you're using 1.1 and instantiating the form incorrectly?  

 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


pre-populating DynaValidatorForm

2004-03-23 Thread Dean A. Hoover
I am using DynaValidatorAction and
it works just fine, when starting "clean".
However, when I attempt to pre-populate
the object, the data never makes it to the
form. Anyone know why? What follows
is some snippets of files that should show
what I am doing.
=== struts-config.xml




 
   
   
 
...
   
...
 
   
   
   
...
   
...
 
 
...
   
   
 
 
 
   
   
   
 
 
   
...
 
...
 
   
 

=== validation.xml

 
...
   
   
 
   
   
   
 maxlength
 24
   
 
...
   
 

=== ChangeContactInfoSetup.java
package fi.els.action;
...
public class ChangeContactInfoSetup extends Action
{
   public ActionForward execute
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response
   ) throws Exception
   {
   User user = (User)request.getSession().getAttribute("user");
   Connection connection = null;

   try
   {
   DynaValidatorForm vForm = new DynaValidatorForm();
...
   connection = dataSource.getConnection();
   Client client = Client.load(connection, user.getId());
   ContactInfo contactInfo = client.getContactInfo();
   vForm.set("contactInfoWidgetsSubFormFirstName",
(contactInfo.getFirstName() != null) ?
contactInfo.getFirstName() : "");
...
   request.getSession().setAttribute("changeContactInfo", vForm);
   return mapping.findForward("success");
   }
...
   }
}


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


base URL in Action

2004-03-20 Thread Dean A. Hoover
How can I get the base URL of
the request (http://domainname)
inside my Action class???
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


how to log

2004-03-18 Thread Dean A. Hoover
I am creating an application with a
business layer that will be used by
a struts presentation layer and a standalone
application. I want to use log4j to log
debug messages from the struts layer
and the business layer. How do I set that
up? All I see in the log right now is:
log4j: Could not find root logger information. Is this OK?
log4j: Parsing for [fi.els] with value=[DEBUG, l1].
log4j: Level token is [DEBUG].
log4j: Category fi.els set to DEBUG
log4j: Parsing appender named "l1".
log4j: Parsing layout options for "l1".
log4j: Setting property [conversionPattern] to [%d{-MM-dd HH:mm:ss} 
%-5p %F:%L - %m%n].
log4j: End of parsing for "l1".
log4j: Setting property [file] to [/tmp/els].
log4j: setFile called: /tmp/els, true
log4j: setFile ended
log4j: Parsed "l1" options.
log4j: Handling log4j.additivity.fi.els=[null]
log4j: Finished configuring.
log4j:WARN No appenders could be found for logger 
(org.apache.catalina.session.ManagerBase).
log4j:WARN Please initialize the log4j system properly.

Is there a simple but *complete* example of using logging
in struts in a situation like this somewhere?
Thanks.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


non-ascii characters

2004-03-16 Thread Dean A. Hoover
I have a database with ISO 3166 country
names and codes that I use to populate an
html:select. There is one country in the list
that contains a non-ascii character and I want
to make sure it shows up properly. That
country is listed in HTML as
ÅLAND ISLANDS
I have two questions regarding this non-ascii:
1) How should I encode it in my (mysql)
database? Right now I put it in with the
character reference as written above.
2) Assuming I leave it the way it is in
the database as stated in 1) above, how
do I get the html tag machinery to not
attempt to escape the ampersand? This
is the code I am using:




Thanks in advance for help.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Using optionsCollection - LabelValueBean

2004-03-15 Thread Dean A. Hoover
I'm also a newbie, but here is an example of what I found by getting
some help from the people on the list plus experimentation. Here is
a helper class I wrote:
package fi.els.form;

import java.util.*;
import org.apache.struts.util.LabelValueBean;
public class CreditCardOptions
{
public static Collection getCardOptions()
{
Vector creditCardOptions = new Vector();
creditCardOptions.add(new LabelValueBean("MasterCard", "mc"));
creditCardOptions.add(new LabelValueBean("Visa", "visa"));
creditCardOptions.add(new LabelValueBean("American Express", "amex"));
creditCardOptions.add(new LabelValueBean("Discover", "discover"));
return creditCardOptions;
}
public static Collection getMonthOptions()
{
Vector monthOptions = new Vector();
monthOptions.add(new LabelValueBean("01", "01"));
monthOptions.add(new LabelValueBean("02", "02"));
monthOptions.add(new LabelValueBean("03", "03"));
monthOptions.add(new LabelValueBean("04", "04"));
monthOptions.add(new LabelValueBean("05", "05"));
monthOptions.add(new LabelValueBean("06", "06"));
monthOptions.add(new LabelValueBean("07", "07"));
monthOptions.add(new LabelValueBean("08", "08"));
monthOptions.add(new LabelValueBean("09", "09"));
monthOptions.add(new LabelValueBean("10", "10"));
monthOptions.add(new LabelValueBean("11", "11"));
monthOptions.add(new LabelValueBean("12", "12"));
return monthOptions;
}
public static Collection getYearOptions()
{
Vector yearOptions = new Vector();
Calendar calendar = Calendar.getInstance();
int y = calendar.get(Calendar.YEAR);
for (int i = 0; i < 12; ++i)
{
Integer year = new Integer(y + i);
String ys = year.toString();
yearOptions.add(new LabelValueBean(ys, ys));
}
return yearOptions;
}
}
Here, I am using it. Since the choices are static, I put it in the
session. I suppose I could have put it in application context.
Anyway, here is a JSP snippet that uses it:
<%
// Create the credit card options (if not already in the session) for
// the credit card select widgets.
if (request.getSession().getAttribute("creditCardOptions") == null)
request.getSession().setAttribute("creditCardOptions",
fi.els.form.CreditCardOptions.getCardOptions());
if 
(request.getSession().getAttribute("creditCardExpirationMonthOptions") 
== null)
request.getSession().setAttribute("creditCardExpirationMonthOptions", 
fi.els.form.CreditCardOptions.getMonthOptions());

if (request.getSession().getAttribute("creditCardExpirationYearOptions") 
== null)
request.getSession().setAttribute("creditCardExpirationYearOptions", 
fi.els.form.CreditCardOptions.getYearOptions());
%>

:



property="value" labelProperty="label"/>










Hope this helps. I know how frustrating this stuff can be...
Dean Hoover
ddd ddd wrote:

Hi Timo

I am new bie and learning to populate the drop box by all different ways . no body has replied for alomst a 4-5 days pl. help me... 

population of data by different ways which are as below 
1.By Collections of strings 
2.By collections beans 
3.Hard coding 
I am unable to achieve even first way tried a lot but failed can any body suggest me where I am wrong. Also pl. suggest me how the  “collection of beans” will be coded . any body has simple java nd jsp code please  Post me 

Manay many thanks 

Regrds 
StrutsGuy
[EMAIL PROTECTED]

Below is Jps  ,stutsconfig  and java files and errors of browser . 

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



 


LOGIN PAGE 

 




LOGIN ID

PASSWORD
 










import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm; 
import org.apache.commons.beanutils.BeanUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import javax.servlet.jsp.PageContext;

// use The seSSion stuf
public class StudentAction extends Action
{
public ActionForward execute( ActionMapping map,ActionForm form, HttpServletRequest req , HttpServletResponse  res) throws Exception
{
 String action = req.getParameter("action");
if (action == null)
{ 
 StudentDatabase  stBase = new StudentDatabase ();
 StudentForm sf= new StudentForm();
 String[] str = stBase.getAllNames();
 String strng ="blah" ;
 sf.setPasswd(strng);
  req.setAttribute("sf", sf);
 ActionErrors er= new ActionErrors();
 er.add(ActionErrors.GLOBAL_ERROR , new ActionError("errorRakesh"));
 if(!er.empty()) 
   {
saveErrors(req,er);
return(map.findForward("RakyError"));
   }
   else
   return(map.findForward("RakyCancel")); 
}
   else
{  
return(map.findForward("RakyCancel"));  
}

}// end of class
}

import org.apache.struts.action.ActionForm;
import org.apach

Proposal: modify LookupDispatchAction

2004-03-14 Thread Dean A. Hoover
I have been trying to figure out how to handle
a cancel button using LookupDispatchAction.
Specifically, I want to not do form validation
if the cancel button is pressed. I found out from
discussion on this list that the cancel button
ends up with a different name attribute than
other submit buttons on the form. This causes
a problem with LookupDispatchAction since
the parameter is not sent in the request. As an
experiment, I copied LookupDispatchAction
into my source tree, changed the name to
LookupOrCancelDispatchAction and made
a simple change to it. Before any other processing
takes place in the execute method, the following
code is processed:
   if (request.getParameter("org.apache.struts.taglib.html.CANCEL") 
!= null)
   return dispatchMethod(mapping, form, request, response, 
"cancel");

In my action that extends LookupOrCancelDispatchAction,
I do exactly what I did with LookupDispatchAction except
I don't bother defining a cancel method mapping and I do write a
cancel method. This works just great. I just think that this
behavior should be supported in the framework. It makes me
feel uneasy to copy a framework class and modify it in order
to accomplish what I think is probably frequently need
behavior. Any thoughts?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:cancel doesn't perform as advertised

2004-03-14 Thread Dean A. Hoover
Adam,

OK, I get that part now... I mistakenly changed

to

which turns into

instead of what you showed me:


That breaks another part now... I created a subclass of 
LookupDispatchAction to handle the various
button presses. If the user clicks on the Cancel button I just want to 
take my "cancel" forward.
What do I need to do to my Action to accomplish that?

Dean Hoover

Adam Hardy wrote:

Server-side validation is skipped by struts when it sees the 
"org.apache.struts.taglib.html.CANCEL" request param.



On 03/14/2004 12:20 PM Dean A. Hoover wrote:

What about the non-Javascript validation?... that's what I want to 
avoid.
The whole Javascript validation thing is optional anyway and doesn't
seem like the best way to implement it (because its optional).

Dean

Adam Hardy wrote:

The javascript will be output by the html:form tag and it stops 
javascript validation.

The cancel button should look like this:



The JSP should look like this:

Cancel or whatever

Adam

On 03/14/2004 12:56 AM Dean A. Hoover wrote:

I have an html:form with a
html:submit and an html:cancel.
According to the documentation for
html:cancel:
"Pressing of this submit button causes
the action servlet to bypass calling the
associated form bean validate() method."
I tried it and it did validation anyway.
Then I looked at the generated HTML
and I see:



The only difference I see is the onclick attribute.
How is that supposed to do anything, given that
that there isn't any javascript in the file. What am
I missing here?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: html:cancel doesn't perform as advertised

2004-03-14 Thread Dean A. Hoover
What about the non-Javascript validation?... that's what I want to avoid.
The whole Javascript validation thing is optional anyway and doesn't
seem like the best way to implement it (because its optional).
Dean

Adam Hardy wrote:

The javascript will be output by the html:form tag and it stops 
javascript validation.

The cancel button should look like this:



The JSP should look like this:

Cancel or whatever

Adam

On 03/14/2004 12:56 AM Dean A. Hoover wrote:

I have an html:form with a
html:submit and an html:cancel.
According to the documentation for
html:cancel:
"Pressing of this submit button causes
the action servlet to bypass calling the
associated form bean validate() method."
I tried it and it did validation anyway.
Then I looked at the generated HTML
and I see:



The only difference I see is the onclick attribute.
How is that supposed to do anything, given that
that there isn't any javascript in the file. What am
I missing here?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


html:cancel doesn't perform as advertised

2004-03-13 Thread Dean A. Hoover
I have an html:form with a
html:submit and an html:cancel.
According to the documentation for
html:cancel:
"Pressing of this submit button causes
the action servlet to bypass calling the
associated form bean validate() method."
I tried it and it did validation anyway.
Then I looked at the generated HTML
and I see:


The only difference I see is the onclick attribute.
How is that supposed to do anything, given that
that there isn't any javascript in the file. What am
I missing here?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: how to use bean:define for this

2004-03-13 Thread Dean A. Hoover
Geeta Ramani wrote:

Dean:

Oh, Ok, I think i see what your issue is now (shouldn't have hit that earlier
"send" so fast..!)  Ok, in the action before you forward to the jsp, populate
your countries variable.  Then set your session variable (in your Action
class), say, session.setAttribute("countries", countries); (though i still
wonder about making this a session var.. anyway..).
that's what I am trying to avoid... I am already doing it in an Action. 
I want the
collection to be instantiating in JSP where it is used. The reason I am 
putting it in
session is that the data comes out of a database but is quite static. 
Are you suggesting
application scope or page? As I said in my previous message, I already 
have a class
with a static method that will return a populated collection.

Dean

In your jsp then you can simply say:

You should then be able to access the "allCountries" Collection further down
in your jsp..
Hope this helps,
Geeta
 

that creates what it needs to. Now what I need to figure out is
the best way to instantiate the "countries" variable in the session.
I think it might be by using the bean:define tag, but I am not
sure. Has anyone done this before?
Thanks.
Dean
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


how to use bean:define for this

2004-03-13 Thread Dean A. Hoover
I am still on a steep learning curve for struts/tiles and
to a degree, trying to remember certain things about
JSP. Anyway, struts has this construct I want to use
for building an HTML select tagset from a java collection.
Here's the jsp snippet:



The reference to "countries" is a java.util.Collection that is
put into the session. I have a class I wrote "CountryOptions"
that contains one static method:
public static Collection getOptions()

that creates what it needs to. Now what I need to figure out is
the best way to instantiate the "countries" variable in the session.
I think it might be by using the bean:define tag, but I am not
sure. Has anyone done this before?
Thanks.
Dean
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: wizard best practices?

2004-03-12 Thread Dean A. Hoover
Tim,

Yes, I included all relavent files, including struts-config.xml in my
original message sent this morning. I hesitate to keep appending to
that message as it was quite large.
Dean

Slattery, Tim - BLS wrote:

Whoops. Wait a minute. The statement in your code:
return mapping.findForward(mapping.getInput());
   

 

does not work for me... I end up getting an empty page 
generated (). Then I looked at the 
API for ActionMapping and saw a
getInputForward() method. I tried that instead and still
get the empty page. Do you know why it would do
that?
   

Do you have an "input=" attribute for this page in your struts-config.xml
file?
--
Tim Slattery
[EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: wizard best practices?

2004-03-12 Thread Dean A. Hoover
Matthias,

Sorry, I must be over tired... First off, how does one
decide between using DynaValidatorForm and
DynaValidatorActionForm? Second, I'm not
understanding what the "path" relates to. For
example, where is "/umfrage1" defined outside
of what you included in your message. Maybe
if I saw that, I would make the connection you
are explaining. BTW, thanks for responding,
I've been beating my head against the wall
trying to figure out how to properly build
a wizard.
Dean

Matthias Wessendorf wrote:

Dean!

got it to work?

i use this use-case for "multiform"-pages...
like "big" poll.
class: "DynaValidatorActionForm"
and the "path" in validator-xml.file 

however, here is validation XML and the definition for
the ValidatorActionForm:
Cheers!
Matthias Weßendorf
struts-cfg.xml_:












		



validation.xml:

  
  
   
   
   depends="required">
   
   
   
   depends="required">
   
   
   
   depends="required">
   
   
   

   
   
   depends="required,integer">
   
   
   
   depends="required">
   
   
   
   depends="required">
   
   
   
   
   
   depends="required">
   
   
   
   depends="required">
   
   
   
   depends="required">
   
   
  
   
...

--
Matthias Weßendorf
Aechterhoek 18
D-48282 Emsdetten
Telefon: 0 25 72 - 9 17 02 75
Handy: 01 79 - 1 11 89 79
Email: mailto:[EMAIL PROTECTED]
URL: http://www.wessendorf.net
ICQ: 47016183 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: wizard best practices?

2004-03-12 Thread Dean A. Hoover
Whoops. Wait a minute. The statement in your code:
return mapping.findForward(mapping.getInput());
does not work for me... I end up getting an empty page
generated (). Then I
looked at the API for ActionMapping and saw a
getInputForward() method. I tried that instead and still
get the empty page. Do you know why it would do
that?
Dean A. Hoover wrote:

Thanks!!!

Niall Pemberton wrote:

You just added "page" as an attribute to your DynaValidatorActionForm 
- so
you get it the same way as you would get any other property out of your
form.

public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response) {
DynaBean dynaForm = (DynaBean)form;

ActionMessages errors = new ActionMessages ();

Integer page = (Integer)dynaForm.get("page");

if (page.intValue() == 2 && !("aaa".equals(dynaForm.get("y" {
errors.add("y", new ActionMessage("errors.y"));
}
if (errors.isEmpty()) {
return mapping.findForward("success");
} else {
request.setAttribute(Globals.ERROR_KEY, errors);
return mapping.findForward(mapping.getInput());
}
}



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: wizard best practices?

2004-03-12 Thread Dean A. Hoover
Thanks!!!

Niall Pemberton wrote:

You just added "page" as an attribute to your DynaValidatorActionForm - so
you get it the same way as you would get any other property out of your
form.
public ActionForward execute(ActionMapping mapping,
   ActionForm form,
   HttpServletRequest request,
   HttpServletResponse response) {
   DynaBean dynaForm = (DynaBean)form;

   ActionMessages errors = new ActionMessages ();

   Integer page = (Integer)dynaForm.get("page");

   if (page.intValue() == 2 && !("aaa".equals(dynaForm.get("y" {
  errors.add("y", new ActionMessage("errors.y"));
   }
   if (errors.isEmpty()) {
   return mapping.findForward("success");
   } else {
  request.setAttribute(Globals.ERROR_KEY, errors);
  return mapping.findForward(mapping.getInput());
   }
}

Niall
- Original Message - 
From: "Dean A. Hoover" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, March 12, 2004 4:05 PM
Subject: Re: wizard best practices?

 

Niall Pemberton wrote:

   

Did you add a "page" property to your DynaValidatorAction form definition
 

in
 

the struts-config.xml?

Niall



 

OK. Just added that... BTW it must be defined as Integer as in:
 
Thanks alot, that solves part of my problem. How do I solve the
other problem? I want to be able to perform secondary validation
based on business logic in the MyWizardAction class as given
in my previous message. Let's just say for argument sake, that
on page 2 it is determined that y cannot be "aaa". What modification
needs to be done to MyWizardAction.java and struts-config.xml
to accomplish this?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: wizard best practices?

2004-03-12 Thread Dean A. Hoover
Niall Pemberton wrote:

Did you add a "page" property to your DynaValidatorAction form definition in
the struts-config.xml?
Niall

 

OK. Just added that... BTW it must be defined as Integer as in:
 
Thanks alot, that solves part of my problem. How do I solve the
other problem? I want to be able to perform secondary validation
based on business logic in the MyWizardAction class as given
in my previous message. Let's just say for argument sake, that
on page 2 it is determined that y cannot be "aaa". What modification
needs to be done to MyWizardAction.java and struts-config.xml
to accomplish this?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


wizard best practices?

2004-03-12 Thread Dean A. Hoover
I've been reading books, the internet, this list, and
experimenting, attempting to build a model for
best practice for a wizard utilizing struts 1.1 and
DynaValidatorAction. I've got a simple model
working but validation does not work. In other
words, the validator framework does not seem to
be doing its thing. I've recently used DynaValidatorAction
on single forms with great success. The other thing
I am wondering about, assuming the Validator
will validate, is once the code runs the
Action, I'd like to be able to do secondary
validation based on business logic. This means
I would need to get the page number, and I am
not sure I understand how this works. I have a hidden
field on each form in the wizard for page. This
presumably works in conjuction with the field
page attribute in the validation config file. If someone
can explain how I can complete this thing, I would
be grateful. Also, maybe this example could be added
to the struts website as I have to believe I am not the
only one struggling with this.
Many thanks.
Dean Hoover
Here are the files:

=== struts-config.xml ===




 
   
 
 
 
 
   
 

 

   
 
 
   
   
 
 
 
   
   
 
 
 
   
 

 

 
   
 

=== validation.xml ===

 
   
 
 
 
 
 
 
   
 

=== mywizard1.jsp ===
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>


Page 1



x = 





=== mywizard2.jsp ===
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>


Page 2



y = 






=== mywizard3.jsp ===
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>


Page 3



z = 






=== mywizarddone.jsp ===
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>


x = 
y = 
z = 


=== mywizardcanel.jsp ===
CANCEL
=== MyWizardAction.java ===
import java.util.*;

public class MyWizardAction extends LookupDispatchAction
{
   protected Map getKeyMethodMap()
   {
   Map map = new HashMap();
   map.put("button.next", "next");
   map.put("button.previous", "previous");
   map.put("button.finish", "finish");
   map.put("button.cancel", "cancel");
   return map;
   }
   public ActionForward next
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response
   )
   {
   // passed the validator stuff, what if we wanted to do some
   // business layer validation at this stage, based on 'page'?
   return mapping.findForward("next");
   }
   public ActionForward previous
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response
   )
   {
   return mapping.findForward("previous");
   }
   public ActionForward finish
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response
   )
   {
   return mapping.findForward("finish");
   }
   public ActionForward cancel
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request,
 HttpServletResponse response
   )
   {
   return mapping.findForward("cancel");
   }
}
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: FAQ: How can I create a wizard workflow?

2004-03-11 Thread Dean A. Hoover
In other words:



anyone know?

Dean A. Hoover wrote:

In http://jakarta.apache.org/struts/faqs/newbie.html#wizard
the example references several jsp files. For example,
mywizard1.jsp. My question is, in the form in that jsp,
what is the action?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


FAQ: How can I create a wizard workflow?

2004-03-11 Thread Dean A. Hoover
In http://jakarta.apache.org/struts/faqs/newbie.html#wizard
the example references several jsp files. For example,
mywizard1.jsp. My question is, in the form in that jsp,
what is the action?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Struts in Action: 12.10.1 Multipage validations

2004-03-11 Thread Dean A. Hoover
This section of the book sounds interesting, but
it would be nice if there were an example somewhere.
Can someone point me to one?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


struts-workflow-extension and DynaValidatorForm

2004-03-11 Thread Dean A. Hoover
I am interested in using the workflow extension but do
not want to give up using DynaValidatorForm. Is it
possible?
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


using LookupDispatchAction

2004-03-10 Thread Dean A. Hoover
Anybody jump in and say if there's a better way to
do this...
I am attempting to create a simple multistep application
for gathering registration information. Each page will be
validated using the Validator framework. I stumbled across
the LookupDispatchAction and thought it might be useful
for what I am trying to do. I am getting an exception:
javax.servlet.ServletException: DispatchMapping[/RegisterLogonInfo] does not define a 
handler property

org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:191)

org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Here's the relevant parts of struts-config.xml:
[snip]
   
 
 
 
   
[snip]
   
   />
   
 
 
   
The WizardAction class follows:

package fi.els.action;

import javax.servlet.ServletException;
import org.apache.struts.action.*;
import org.apache.struts.actions.*;
import javax.servlet.http.*;
import java.util.*;
public class WizardAction extends LookupDispatchAction
{
   public ActionForward next
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request
   )
   {
   return mapping.findForward("next");
   }
   public ActionForward previous
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request
   )
   {
   return mapping.findForward("previous");
   }
   public ActionForward finish
   (
 ActionMapping mapping,
 ActionForm form,
 HttpServletRequest request
   )
   {
   return mapping.findForward("finish");
   }
   protected Map getKeyMethodMap()
   {
   Map keyMethodMap = new HashMap();
   keyMethodMap.put("button.previous", "previous");
   keyMethodMap.put("button.next", "next");
   keyMethodMap.put("button.finish", "finish");
   return keyMethodMap;
   }
}
Any idea what I'm doing wrong? Is there a better way to do this?
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


subform definition in struts-config.xml and validation.xml

2004-03-08 Thread Dean A. Hoover
I have found cases in an application I am developing
where I can use tiles to define subforms that I can use
in several places. For example, I have a registration form
that collects contact information. Once registered, a user
can change their contact information. I defined a tiles
"subform" to collect the contact information, which is
really useful. But in defining the form-bean (struts-config.xml)
and formset/form (validation.xml) for the two different forms
I need to cut and paste the information in both files.
How can I define chunks of xml representing the subform
components for the two configuration files and include them
twice so that I don't have to cut and paste.
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Suggestion needed on good Struts book

2004-03-08 Thread Dean A. Hoover
I've got:

Struts in Action
Programming Jakarta Struts
Professional Strut Applications
I like Struts in Action the best, but the pain is that I am a new
Struts developer and want to develop to Struts 1.1 (or maybe
even 1.2) but the books are written to Struts 1.0. Struts in
Action spends 90% of the book talking about how to do this
and that in Struts 1.0 and then port it to Struts 1.1, which is
more involved than you might think.
My educational process has gone something like this: read
all the books and try the examples. Join this mailing list. Troll
the internet. Experiment like crazy. Hopefully, there are some
new books coming out soon which are not historical.
Dean Hoover

Paul-J Woodward wrote:

Struts in Action - Manning

Excellent book.

Paul

Global Equity Derivatives Technology
Deutsche Bank [/]



Janarthan Sathiamurthy <[EMAIL PROTECTED]>
08/03/2004 08:23
Please respond to "Struts Users Mailing List"
   To: Struts Users Mailing List <[EMAIL PROTECTED]>
   cc: 
   Subject:Re: Suggestion needed on good Struts book

Programming Jakarta Struts  - OReilly

[EMAIL PROTECTED] wrote:Hi,

I am a newbie to Struts.
I have been looking for books on Struts and found these on Amazon
Programming Jakarta Struts - OReilly
Struts in Action - Manning
Struts Framework - Morgan Kaufmann
Struts Survival Guide - ObjectSource
Professional Jakarta Struts - Wrox
Struts Kick Start - Sams
Can anybody suggest which is good?

Thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
Do you Yahoo!?
Yahoo! Search - Find what you're looking for faster.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


tiles:insert attribute vs. name

2004-03-06 Thread Dean A. Hoover
I've read the documentation (although
currently sleep deprived) and I cannot
understand the difference between using
name and attribute in the tiles:insert tag.
Can someone shed some light on this?
Thanks.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


i18n in tiles-defs.xml?

2004-03-05 Thread Dean A. Hoover
Suppose I have a string defined
in a definition, such as:

 

How would I go about replacing "Hello" with
a reference to a string instead of the string itself?
Can this be done just using tiles-defs.xml, or is
it a two step process? For example:

 

and then in the .jsp file:



Please let me know.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


log4j set up and usage?

2004-03-04 Thread Dean A. Hoover
Where can I find an example of setting up
and using log4j under commons-logging
for struts 1.1? I have used log4j before and
want to continue using it.
Dean Hoove

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


log4j example?

2004-03-02 Thread Dean A. Hoover
Where can I find an example of setting up
and using log4j under commons-logging
for struts 1.1? I have used log4j before and
want to continue using it.
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: hiding jsp files under WEB-INF

2004-03-01 Thread Dean A. Hoover
Mainguy, Mike wrote:

Also, are sure sure welcome is not supposed to be Welcome? (case sensitive?)

The way I understand it, "welcome" is globally forwarded to 
"/Welcome.do", as
per the struts-config.xml.

<>

-Original Message-
From: Dean A. Hoover [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 01, 2004 11:59 AM
To: [EMAIL PROTECTED]
Subject: hiding jsp files under WEB-INF

I realized that the subject I filed this
under (getting started) may not get
attention. So I'm sending it out under
this subject. Did some google searching
but still don't see what the problem is.
=
I am experimenting with some code
from "Struts in Action" but I am moving
source code around abit. Specifically,
I am moving all of the .jsp files into
the WEB-INF directory except
index.jsp. This is so that a user cannot
hit a given .jsp directly. Anyway, I
am getting an exception right from the
get go and don't know what I am doing
wrong. Here's the relevant pieces:
== index.jsp ===
<%@ taglib uri="/tags/struts-logic" prefix="logic" %> 
== Welcome.jsp ===


itional.dtd">
<% taglib uri="/tags/struts-bean" prefix="bean" %>
<% taglib uri="/tags/struts-html" prefix="html" %>
<% taglib uri="/tags/struts-logic" prefix="logic" %>


  Welcome World!
  


  
Welcome !
  
  
Welcome World!
  
  
  
Sign in

  Sign out

  



=== struts-config.xml ===




  

  

  


  
  
  
  

  
  


  


Here's the exception:

*exception*

javax.servlet.ServletException: Exception forwarding for name welcome: 
javax.servlet.ServletException

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextI
mpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImp
l.java:800)
   org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
*root cause*

javax.servlet.jsp.JspException: Exception forwarding for name welcome: 
javax.servlet.ServletException
   org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:173)
   org.apache.jsp.index_jsp._jspx_meth_logic_forward_0(index_jsp.java:82)
   org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:3
11)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
What am I doing wrong?
Dean Hoover


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
This message and its contents (to include attachments) are the property of Kmart 
Corporation (Kmart) and may contain confidential and proprietary information. You are 
hereby notified that any disclosure, copying, or distribution of this message, or the 
taking of any action based on information contained herein is strictly prohibited. 
Unauthorized use of information contained herein may subject you to civil and criminal 
prosecution and penalties. If you are not the intended recipient, you should delete 
this message immediately.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


hiding jsp files under WEB-INF

2004-03-01 Thread Dean A. Hoover
I realized that the subject I filed this
under (getting started) may not get
attention. So I'm sending it out under
this subject. Did some google searching
but still don't see what the problem is.
=
I am experimenting with some code
from "Struts in Action" but I am moving
source code around abit. Specifically,
I am moving all of the .jsp files into
the WEB-INF directory except
index.jsp. This is so that a user cannot
hit a given .jsp directly. Anyway, I
am getting an exception right from the
get go and don't know what I am doing
wrong. Here's the relevant pieces:
== index.jsp ===
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

== Welcome.jsp ===


itional.dtd">
<% taglib uri="/tags/struts-bean" prefix="bean" %>
<% taglib uri="/tags/struts-html" prefix="html" %>
<% taglib uri="/tags/struts-logic" prefix="logic" %>


  Welcome World!
  


  
Welcome !
  
  
Welcome World!
  
  
  
Sign in

  Sign out

  



=== struts-config.xml ===




  
  

  

  


  
  
  
  

  
  


  


Here's the exception:

*exception*

javax.servlet.ServletException: Exception forwarding for name welcome: 
javax.servlet.ServletException
   org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
   org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
   org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

*root cause*

javax.servlet.jsp.JspException: Exception forwarding for name welcome: 
javax.servlet.ServletException
   org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:173)
   org.apache.jsp.index_jsp._jspx_meth_logic_forward_0(index_jsp.java:82)
   org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
   org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
   org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
   org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

What am I doing wrong?
Dean Hoover


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


getting started

2004-03-01 Thread Dean A. Hoover
I am experimenting with some code
from "Struts in Action" but I am moving
source code around abit. Specifically,
I am moving all of the .jsp files into
the WEB-INF directory except
index.jsp. This is so that a user cannot
hit a given .jsp directly. Anyway, I
am getting an exception right from the
get go and don't know what I am doing
wrong. Here's the relevant pieces:
== index.jsp ===
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>

== Welcome.jsp ===


itional.dtd">
<% taglib uri="/tags/struts-bean" prefix="bean" %>
<% taglib uri="/tags/struts-html" prefix="html" %>
<% taglib uri="/tags/struts-logic" prefix="logic" %>

 
   Welcome World!
   
 
 
   
 Welcome !
   
   
 Welcome World!
   
   
   
 Sign in
 
   Sign out
 
   
 


=== struts-config.xml ===



 
   
   
 
   
 
   

 
   
   
   
   
 
   
   
 
 
   
 

Here's the exception:

*exception*

javax.servlet.ServletException: Exception forwarding for name welcome: 
javax.servlet.ServletException

org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.index_jsp._jspService(index_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
*root cause*

javax.servlet.jsp.JspException: Exception forwarding for name welcome: 
javax.servlet.ServletException
org.apache.struts.taglib.logic.ForwardTag.doEndTag(ForwardTag.java:173)
org.apache.jsp.index_jsp._jspx_meth_logic_forward_0(index_jsp.java:82)
org.apache.jsp.index_jsp._jspService(index_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
What am I doing wrong?
Dean Hoover


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


struts-form vs struts html

2004-03-01 Thread Dean A. Hoover
Newbie here trying to make sense out of usage of
these two tag libraries. I am using struts 1.1. Should
I just use struts-html instead of struts-form? I haven't
looked really close but there appears to be overlap.
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


example of using log4j in struts 1.1?

2004-02-29 Thread Dean A. Hoover
I am interested in using log4j as a logger
for a struts 1.1 application. Is there an
example, cookbook, or other documentation
someone can point me to for this?
Thanks.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


servlet.getDebug

2004-02-27 Thread Dean A. Hoover
I am a newbie reading "Struts in action" and
am attempting to build the logon example in
chapter 3. I am using Struts 1.1 and unfortunately
the book is written primarily to Struts 1.0,
which was the stable version at time of
writing. Anyway, I get this when I build a
couple of the java files:
warning: getDebug() in org.apache.struts.action.ActionServlet has been 
deprecated
   [javac] if (servlet.getDebug() >= Constants.DEBUG)

Is there some recommended replacement for
that construct?
Thanks.
Dean Hoover
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


using

2004-02-24 Thread Dean A. Hoover
Newbie here wanting to generate xhtml. I am looking at
http://www.w3.org/TR/xhtml1#normative
I believe I need to output something like the following
to be conforming. I can handle the xml and DOCTYPE tags
just fine, but how do I generate the stuff in the "html"
tag (which is apparently required) using ?

http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
Dean Hoover

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]