way to use with label value beans

2002-01-23 Thread Rob Parker

This may be a little complicated to explain. Here is a some background info.
I have a page that shows a list of clients (in an html table, not a form)
for a user and a form that lets the user either edit information for and
existing client (by selecting that client from the list) or add a new
client. A lot of the values for the client are populated via 
select lists using java.util.Collection classes containing LabelValue beans
that I pass in with the request. When I store the user's input in my
database, I store the "value" portion of the LabelValue bean. For example,
the value portion of the LabelValue bean for client status of "New" is "1",
which I store in the database as the integer 1.

The issue that I am having is when I pull the client information back from
the database to make the list of clients for the user to select from, I pull
back the integer 1 instead of the String "New" for client status. Is there
any easy way to pull the corresponding label for 1 from the Collection that
I pass in with the request so that I can display the label instead of the
Value - sort of like a  that selects a label from a Collection
on LabelValue beans for a specific value? It would be much nicer to do that
than to add fields to my form to hold the text representation of the
currently selected option. Hope this makes sense. Thanks,

Rob


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Model Persistence Survey

2002-01-23 Thread @Basebeans.com

Subject: Re: Model Persistence Survey
From: Vic Cekvenich <[EMAIL PROTECTED]>
 ===
Easy enough to do delegates.

Keith Chew wrote:

> Hi
> 
> Just some thoughts. You could use the delegate pattern instead of
> inheritence. This will help decouple your FormBeans from your DaoBeans.
> 
> Keith
> 
> 
> 
> -Original Message-
> From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
> Sent: Thursday, 24 January 2002 9:10 a.m.
> To: [EMAIL PROTECTED]
> Subject: Re: Model Persistence Survey
> 
> 
> Subject: Re: Model Persistence Survey
> From: Vic Cekvenich <[EMAIL PROTECTED]>
>  ===
> 
> 
> Here is a sample DAO Extended Form Bean code :
> 
> public class NameZoomFrm extends daoFormBean {
> 
> private String fstName;
> private String lstName;
> 
> 
> public String getFstName() {   //get it from _crs RowSet
>  CachedRowSet cr = getCrs();
> try{   this.fstName = cr.getString("first_name");  } // try
>  catch (Exception e)   {System.out.println(e);} // catch
>  return (this.fstName);  }// get
> public String getLstName() {  //get it from _crs RowSet
>  CachedRowSet cr = getCrs();
> try{  this.lstName = cr.getString("last_name");} // try
>  catch (Exception e)   {System.out.println(e);} // catch
>  return (this.lstName);
>  }// get
>   public void setFstName(String aFstName) {   //get it from _crs RowSet
> CachedRowSet cr = getCrs();
> try{ cr.updateString("first_name",aFstName);
> this.fstName = aFstName;
> } // try
> catch (Exception e)   {System.out.println(e);} // catch
> setCrs(cr);
> } //setFst
> public void setLstName(String aLstName) {   //get it from _crs RowSet
> CachedRowSet cr = getCrs();
> try{ cr.updateString("last_name",aLstName);
> this.lstName=aLstName;
>  } // try
> catch (Exception e)   {System.out.println(e);} // catch
> setCrs(cr);
> } //setFst
> 
> 
> public int retrieve(BigDecimal aBD) {
> try{
>  CachedRowSet cr = getCrs();
>  cr = new CachedRowSet(); // easier then resultset
>  // you must test this sql string manualy for a SQL IDE
>  cr.setCommand("select * from contact where id = ?");
>  // driver issues fix:
>  cr.setTableName("contact");
>   // to limit the number of rows coming back, we only need a page at
> a time
>   cr.setBigDecimal(1,aBD);
>exec(cr);
> } // try
> catch (Exception e)
> { System.out.println(e);
>e.printStackTrace();} // catch
> return 0;
> }// retrieve
> 
> public void blank()
> {  try { CachedRowSet cr = getCrs();
>  cr.updateNull("first_name");
>  cr.updateNull("last_name");
>  cr.updateNull("id");
> }  catch (Exception e)   { procE(this,e);} // catch
> }// blank
> }//class
> 
> 
> Here is the DAO implementation ... using RowSet, but could use JDO, such
> as Castor.
> 
> import com.wintecinc.struts.action.ValidatorForm;
> public class daoFormBean extends ValidatorForm  {
> 
> 
>  private Connection con=null;
>  private Connection upCon=null;
>  private DataSource ds;
>  private CachedRowSet _crs;
>  private String sqlString;
>  private BigDecimal PK;
> 
> 
>  public Connection getCon() {return con;}
>  public CachedRowSet getCrs() {return this._crs;}
>  public void setCrs(CachedRowSet aCRS) {this._crs=aCRS;}
> 
> 
> 
>  public Hashtable getIterateMap() { //is there a better way?
> like use crs.getCollection?
>  CachedRowSet cr = getCrs();
>  int rc=cr.size();
>  Hashtable iterateMap = new Hashtable();
>  // count out the number of rows with dummy map
>  for (int i=1; i <= rc; i++) { iterateMap.put(new
> Integer(i),new Integer(i));}
>  return iterateMap;}
> 
> 
>  public BigDecimal getPK() {  //get it from _crs RowSet
>  try{  this.PK = _crs.getBigDecimal("id");} // try
>  catch (Exception e)   {System.out.println(e);} // catch
>  return (this.PK);
>  }// get
> 
>  public void dbCon() {  // connect to db
>  try{  ds = PoolMan.findDataSource("jndiSample");
>  //we should in production give it a password in code
> not in file pool.xml
>  con=ds.getConnection();}
>  catch (Exception e)  {
>  debug(this, "We did not connect");
>  procE(this,e);} // catch
>  }// con
> 
>  public void dbDisCon() {
>  try{if (con!=null) con.close();
>  ds=null;
>  }
>  catch (Exception e) {System.out.println(e);  }//catch
>  } //disCon
> 
>  public int getRowNext() {  // get the next row
>  try{
>  CachedRowSet cr = getCrs();
>  cr.next();
>  }
>  catch (Exception e

Re: Using CSS with struts jsp's

2002-01-23 Thread Ted Husted

You can use the  tag, and then use relative referneces to
stylesheets and other assets. 

Though, I'm thinking we could really use a tag for specifying
stylesheets, since the relative references can get to be a pain. The
idea being you could specify a context relative path, and the tag would
render it correctly. 

html:link is already taken, so I guess the next candidate would be
html:rel

But for today, right-now,  and a relative path works just
fine :)

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/



[EMAIL PROTECTED] wrote:
> 
> Hi,
> I am trying to use CSS with my JSP pages but CSS does not seem to be
> reachable.  It works when I bring up the jsp's by themselves but when
> invoked through an action, the page does not display with correct fonts.
> 
> The jsp code I am using is:
> ___
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
> <%@ taglib uri="http://jakarta.apache.org/struts/tags-form-1.0"; prefix
> ="form" %>
> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-1.0"; prefix
> ="bean" %>
> 
> 
> 
>  
>  
>  
>   
>  
> 
> __
> 
> Thanks for any pointers.
> - Nitish
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Using CSS with struts jsp's

2002-01-23 Thread matthewr

try using absolute paths... i.e.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 24 January 2002 13:48
To: Struts Users Mailing List
Subject: Using CSS with struts jsp's




Hi,
I am trying to use CSS with my JSP pages but CSS does not seem to be
reachable.  It works when I bring up the jsp's by themselves but when
invoked through an action, the page does not display with correct fonts.

The jsp code I am using is:
___
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-form-1.0"; prefix
="form" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-1.0"; prefix
="bean" %>



 
 
 
  
 

__

Thanks for any pointers.
- Nitish




--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Using CSS with struts jsp's

2002-01-23 Thread Nitish . Naharas



Hi,
I am trying to use CSS with my JSP pages but CSS does not seem to be
reachable.  It works when I bring up the jsp's by themselves but when
invoked through an action, the page does not display with correct fonts.

The jsp code I am using is:
___
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-form-1.0"; prefix
="form" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-1.0"; prefix
="bean" %>



 
 
 
  
 

__

Thanks for any pointers.
- Nitish




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: CHARACTER ENCODING !

2002-01-23 Thread timothy

Hi Dennis Lee,

after you use native2ascii.exe, the encoding become UTF8

so "<%@ page contentType="text/html; charset=UTF8" %> will work


if you want to use big5   you need to convert it before (let say in the
getXXX of javaBean  then it will work


>From Timothy
Strategus Partners Ltd



- Original Message -
From: "Lee, Dennis" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, January 24, 2002 10:48 AM
Subject: RE: CHARACTER ENCODING !


> Hi,
>
> I have exactly the same problem.
> I try to convert the chinese in the properties file to unicode using
> native2ascii but it doesn't work.
> "<%@ page contentType="text/html; charset=big5" %>" + native2ascii  =
> "?", all chinese characters becomes '??'.
>
> Anybody can give some more help ?
>
> Best Regards,
> Dennis Lee
>
> -Original Message-
> From: Christopher Cheng [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 10:11 AM
> To: Struts Users Mailing List
> Cc: wojtek
> Subject: RE: CHARACTER ENCODING !
>
>
> Same here. I am building a site using English, Traditional and Simplified
> Chinese. It is fine if I do not set the encoding to "big5" or whatever in
> JSP header, but I have to manually change the encoding in IE. What is
> strange is that if I put some chinese characters directly in the JSP,
those
> characters are displayed properly, but those from the property files are
> disrupted.
>
> Anybody can help?
>
> -Original Message-
> From: wojtek [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 1:01 AM
> To: Struts Users Mailing List
> Subject: CHARACTER ENCODING !
>
>
> Hi,
>
> I am using struts form some form validation (obvious isn't it?) and I came
> across the following error:
>
>
> National Polish characters returned from the forms are badly encoded !
>
> I am using struts on win2k, jdk 1.3, the jsp page charset is set to
> ISO-8859-2
>
> Can anyone help ?
>
> regards
>
> Wojtek
>
>
>
>
> --
> Myslisz o otworzeniu wlasnego sklepu internetowego?
> A moze o wynajeciu stoiska w wirtualnym pasazu?
> W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> **
> This message and any files transmitted with it are confidential and
> may be privileged and/or subject to the provisions of privacy legislation.
> They are intended solely for the use of the individual or entity to whom
they
> are addressed. If the reader of this message is not the intended
recipient,
> please notify the sender immediately and then delete this message.
> You are notified that reliance on, disclosure of, distribution or copying
> of this message is prohibited.
>
> Bank of Bermuda
> **
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: CHARACTER ENCODING !

2002-01-23 Thread Lee, Dennis

Hi,

I have exactly the same problem.  
I try to convert the chinese in the properties file to unicode using
native2ascii but it doesn't work.
"<%@ page contentType="text/html; charset=big5" %>" + native2ascii  =
"?", all chinese characters becomes '??'.

Anybody can give some more help ?

Best Regards,
Dennis Lee

-Original Message-
From: Christopher Cheng [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 10:11 AM
To: Struts Users Mailing List
Cc: wojtek
Subject: RE: CHARACTER ENCODING !


Same here. I am building a site using English, Traditional and Simplified
Chinese. It is fine if I do not set the encoding to "big5" or whatever in
JSP header, but I have to manually change the encoding in IE. What is
strange is that if I put some chinese characters directly in the JSP, those
characters are displayed properly, but those from the property files are
disrupted. 

Anybody can help?

-Original Message-
From: wojtek [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 1:01 AM
To: Struts Users Mailing List
Subject: CHARACTER ENCODING !


Hi,

I am using struts form some form validation (obvious isn't it?) and I came
across the following error:


National Polish characters returned from the forms are badly encoded !

I am using struts on win2k, jdk 1.3, the jsp page charset is set to
ISO-8859-2

Can anyone help ?

regards

Wojtek



 
-- 
Myslisz o otworzeniu wlasnego sklepu internetowego?
A moze o wynajeciu stoiska w wirtualnym pasazu?
W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
 

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:

For additional commands, e-mail:



**
This message and any files transmitted with it are confidential and
may be privileged and/or subject to the provisions of privacy legislation.
They are intended solely for the use of the individual or entity to whom they
are addressed. If the reader of this message is not the intended recipient, 
please notify the sender immediately and then delete this message.
You are notified that reliance on, disclosure of, distribution or copying
of this message is prohibited.

Bank of Bermuda
**


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




External Forward

2002-01-23 Thread matthewr

Hi all,
new to the list, so I apologise in advance if this has been asked
already.
 
I have created a page with a form, that posts to a servlet, does its
thing and
then forwards the request on to another website.
 
the problem is, when I set the properties back into the request scope,
the server
I am forwarding to doesnt see the request. (Note: this is from java to
Cold Fusion)
 
How can I forward the request with it?
 
So, I want to proces the request, add some of my things to it and then
forward
that on again to another site?
 
request.setAttribute("key","value");
return (new ActionForward("http://the.url.com";, true));
 
this doesnt work
 
Cheers..
 
Matt
 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: How to do an outcall but return to the session?

2002-01-23 Thread Mark Woon

Reid Pinchback wrote:

> I figured that was probably what would happen in the case of cookies.
> Is there an easy way to deal with the re-written url/disabled cookies case?
> I want to be sure the right thing happens whether or not cookies are
> enabled.

You can just  always pass the external resource a return URL with that already
has the session id in it.

--
~~Mark Woon~~~
If you're not part of the solution, you're part of the precipitate.





RE: How to do an outcall but return to the session?

2002-01-23 Thread Reid Pinchback


I figured that was probably what would happen in the case of cookies.
Is there an easy way to deal with the re-written url/disabled cookies case?
I want to be sure the right thing happens whether or not cookies are
enabled.

 Thanks!

  Alex Paransky <[EMAIL PROTECTED]> wrote: 
Assuming your client is using cookies this should work automatically. If
your client has his/her cookies disabled you must make sure to submit a
"re-written" url as the target for "returnTo" processing in your other
system.



-
Do You Yahoo!?
Yahoo! Auctions Great stuff seeing new owners! Bid now!


Re[2]: CHARACTER ENCODING !

2002-01-23 Thread Daigo Moriwaki

Hi, wojetk

2002/01/24 Thu  AM 05:53
"wojtek" <[EMAIL PROTECTED]> wrote:

> I am also  setting request.setCharacterEncoding("ISO-8859-2")  in
> every possible place !

Where did you put it?
You should put it before request parameters are copied into actoinForm
properties.

You can make a subclass of ActionServlet and put 'setCaracterEncoding'
in it like following:

// - sample subclass of ActionServlet -
public class MyActionServlet extends ActionServlet {

public MyActionServlet() {
super();
}

protected void process(HttpServletRequest request,
HttpServletResponse response)
throws java.io.IOException,
javax.servlet.ServletException {

request.setCharacterEncoding("ISO-8859-2");
super.process( request, response );

}

}
// - end -

The web.xml must be changed so that this subclass will be used:
org.apache.struts.action.ActionServlet -->
YOUR_PACKAGE.MyActionServlet


Thanks,
John Daigo Moriwaki

 2002/01/24 Thu  AM 10:54
-- 
Daigo Moriwaki <[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: resources location

2002-01-23 Thread Jeff Oberlander

It needs to be somewhere in the classpath.  Each app server uses their own
implementation of the classloader, so it will be dependent on the classpath
of your app based on the server.  web-inf/classes is in the classpath, but
the directory above that typically isn't.

-Original Message-
From: Witt, Mike (OH35) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 5:00 PM
To: Struts Users Mailing List
Subject: RE: resources location


I'm not sure what you might be doing wrong, but why not put it in your 
build script (like ant's build.xml) to copy the file from the source 
location to within the hierachy?

Mike

-Original Message-
From: Bill Page [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 7:57 PM
To: [EMAIL PROTECTED]
Subject: resources location


I've gotten struts installed, integrated, and working in the application
we're building for a few days now.  However I want to move the resources
property file somewhere else.  It is currently sitting in "com.mycomp.pkg:
and the application parameter in web.xml specifies that.  I can move it up
this hierarchy and put it under classes, take off the structure from the
parameter in web.xml and everything is fine.

What I need to is to move it out of this hierachy altogether.  I want to get
it to a place where someone can update it who I don't want to allow access
to anything under WEB-INF.  I've tried to use "/" as the root under my
application noting that the config parameter uses that.  I've tried a
relative from path the classes directory.  Nothing seems to work except
anywhere under WEB-INF/classes.

Is this possible?

What might I be doing wrong?

tia

bill page
[EMAIL PROTECTED]
Digital Garden Software, Inc.
856 US Hwy 206 Bldg B Ste 15
Hillsborough, NJ 08844
908.904.0664



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: resources location

2002-01-23 Thread Witt, Mike (OH35)

I'm not sure what you might be doing wrong, but why not put it in your 
build script (like ant's build.xml) to copy the file from the source 
location to within the hierachy?

Mike

-Original Message-
From: Bill Page [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 7:57 PM
To: [EMAIL PROTECTED]
Subject: resources location


I've gotten struts installed, integrated, and working in the application
we're building for a few days now.  However I want to move the resources
property file somewhere else.  It is currently sitting in "com.mycomp.pkg:
and the application parameter in web.xml specifies that.  I can move it up
this hierarchy and put it under classes, take off the structure from the
parameter in web.xml and everything is fine.

What I need to is to move it out of this hierachy altogether.  I want to get
it to a place where someone can update it who I don't want to allow access
to anything under WEB-INF.  I've tried to use "/" as the root under my
application noting that the config parameter uses that.  I've tried a
relative from path the classes directory.  Nothing seems to work except
anywhere under WEB-INF/classes.

Is this possible?

What might I be doing wrong?

tia

bill page
[EMAIL PROTECTED]
Digital Garden Software, Inc.
856 US Hwy 206 Bldg B Ste 15
Hillsborough, NJ 08844
908.904.0664



--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




resources location

2002-01-23 Thread Bill Page

I've gotten struts installed, integrated, and working in the application
we're building for a few days now.  However I want to move the resources
property file somewhere else.  It is currently sitting in "com.mycomp.pkg:
and the application parameter in web.xml specifies that.  I can move it up
this hierarchy and put it under classes, take off the structure from the
parameter in web.xml and everything is fine.

What I need to is to move it out of this hierachy altogether.  I want to get
it to a place where someone can update it who I don't want to allow access
to anything under WEB-INF.  I've tried to use "/" as the root under my
application noting that the config parameter uses that.  I've tried a
relative from path the classes directory.  Nothing seems to work except
anywhere under WEB-INF/classes.

Is this possible?

What might I be doing wrong?

tia

bill page
[EMAIL PROTECTED]
Digital Garden Software, Inc.
856 US Hwy 206 Bldg B Ste 15
Hillsborough, NJ 08844
908.904.0664



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Using struts-template as taglib

2002-01-23 Thread Robin Meade

David Geary discusses his Template taglib successor, Regions,
in this JavaWorld article:

http://www.javaworld.com/javaworld/jw-12-2001/jw-1228-jsptemplate_p.html

An alternative approach to layout is to use the
Servlet 2.3 filter mechanism.

The SiteMesh taglib
(http://www.opensymphony.com/sitemesh/decorators.html)
and the Maverick MVC framework
(http://mav.sourceforge.net) use filters for
implementing layout.

Robin Meade

 > Yes, you should be able to use the template taglib outside of Struts, or
 > Tiles.
 >
 > Tiles is in the contrib folder of hte nightly build, and also available
 > here:
 >
 > http://www.lifl.fr/~dumoulin/tiles/
 >
 > As mentioned, Cedric and I are getting ready to propose Tiles to
 > Taglibs. The template taglib should really live there too, but David
 > doesn't come around much anymore :(
 >
 > Cedric, do you think we could join the codebases in some way. People
 > mention the simplicity of the template taglib. Could we propose
 > something to taglibs that carried both packages?
 >
 > I know David has talked about a successor to templates, but that doesn't
 > seem to be materializing. And if it did, he could just join us in
 > Taglibs.
 >
 > -- Ted Husted, Husted dot Com, Fairport NY USA.
 > -- Building Java web applications with Struts.
 > -- Tel +1 585 737-3463.
 > -- Web http://www.husted.com/struts/
 >


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Fw: Servlet.service() for servlet action threw exception java.lang.ClassCastException: com.nexgen.signup.SignupForm

2002-01-23 Thread Ted Husted

Is SignupForm subclassed from ActionForm?

Are you sure the action was told to instantiate a SignupForm?

alexus wrote:
> 
> - Original Message -
> From: "Ted Husted" <[EMAIL PROTECTED]>
> To: "Jakarta General List" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 6:52 PM
> Subject: Re: Servlet.service() for servlet action threw exception
> java.lang.ClassCastException: com.nexgen.signup.SignupForm
> 
> > The best place to post a question like this is the Struts USER list.
> >
> > But it looks like your SignupForm does not subclass ActionForm.
> >
> > Please direct any reply to the Struts USER list.
> >
> > alexus wrote:
> > >
> > > could someone help me?
> > >
> > > 2002-01-23 19:25:03 StandardWrapperValve[action]: Servlet.service() for
> > > servlet action threw exception
> > > java.lang.ClassCastException: com.nexgen.signup.SignupForm
> > > at
> > >
> org.apache.struts.action.ActionServlet.processActionForm(ActionServlet.java:
> > > 1673)
> > > at
> > > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1562)
> > > at
> > > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > > at
> > >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > > FilterChain.java:247)
> > > at
> > >
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > > ain.java:193)
> > >
> > > at
> > >
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > > va:243)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > at
> > >
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > > va:201)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
> > > 46)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 64)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > >
> > > at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > at
> > >
> org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> > > at
> > >
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > > )
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> > > java:170)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 64)
> > > at
> > >
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> > > )
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 64)
> > > at
> > >
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> > >
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 64)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > at
> > >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > > :163)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > > 66)
> > > at
> > >
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > > at
> > > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > > at
> > >
> org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> > > 1011)
> > > at
> > >
> org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
> > > )
> > >
> > > at java.lang.Thread.run(Thread.java:536)
> > >
> > > 2002-01-23 19:27:11 StandardWrapperValve[action]: Servlet.service() for
> > > servlet action threw exception
> > > java.lang.ClassCastException: com.nexgen.signup.SignupForm
> > > at
> > >
> org.apache.struts.action.ActionServlet.processActionForm(ActionServlet.java:
> > > 1673)
> > > at
> > > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1562)
> > > at
> > > org.apache.struts.action.ActionServ

Fw: Servlet.service() for servlet action threw exception java.lang.ClassCastException: com.nexgen.signup.SignupForm

2002-01-23 Thread alexus


- Original Message -
From: "Ted Husted" <[EMAIL PROTECTED]>
To: "Jakarta General List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 6:52 PM
Subject: Re: Servlet.service() for servlet action threw exception
java.lang.ClassCastException: com.nexgen.signup.SignupForm


> The best place to post a question like this is the Struts USER list.
>
> But it looks like your SignupForm does not subclass ActionForm.
>
> Please direct any reply to the Struts USER list.
>
> alexus wrote:
> >
> > could someone help me?
> >
> > 2002-01-23 19:25:03 StandardWrapperValve[action]: Servlet.service() for
> > servlet action threw exception
> > java.lang.ClassCastException: com.nexgen.signup.SignupForm
> > at
> >
org.apache.struts.action.ActionServlet.processActionForm(ActionServlet.java:
> > 1673)
> > at
> > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1562)
> > at
> > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > at
> >
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:247)
> > at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.java:193)
> >
> > at
> >
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
> > va:243)
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
> > va:201)
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:2
> > 46)
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> >
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2344)
> > at
> >
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164
> > )
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
> > java:170)
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > at
> >
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170
> > )
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > at
> >
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:462)
> >
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 64)
> > at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
> > :163)
> > at
> >
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:5
> > 66)
> > at
> >
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
> > at
> > org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
> > at
> >
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:
> > 1011)
> > at
> >
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1106
> > )
> >
> > at java.lang.Thread.run(Thread.java:536)
> >
> > 2002-01-23 19:27:11 StandardWrapperValve[action]: Servlet.service() for
> > servlet action threw exception
> > java.lang.ClassCastException: com.nexgen.signup.SignupForm
> > at
> >
org.apache.struts.action.ActionServlet.processActionForm(ActionServlet.java:
> > 1673)
> > at
> > org.apache.struts.action.ActionServlet.process(ActionServlet.java:1562)
> > at
> > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:509)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >
> > at
> >
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
> > FilterChain.java:247)
> > at
> >
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
> > ain.ja

Re: persistance for wizard type forms

2002-01-23 Thread Mark Woon

Ted Husted wrote:

> Because when you go from one page to another in a wizard, the properties
> from the prior page can be reset.

Ah.  Whoops.  Didn't read the subject line, and didn't get the context.

-Mark


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: persistance for wizard type forms

2002-01-23 Thread Ted Husted

Because when you go from one page to another in a wizard, the properties
from the prior page can be reset. 

Select boxes and radio buttons would have one value or the other
submitted, and so resetting them is usually not important. 

Checkboxes if not set are not submitted at all. Sometimes when they are
toggled, the toggle is lost because a new checkbox parameter does not
come along to change true to false. Which is where the reset comes in :)

All this really only comes into play when ActionForms are stored in
session scope and persist between requests. Otherwise, a new form is
instantiated for the new request.

One approach to a wizard is to group the properties into pages, and pass
the page number as a hidden property. The reset and validation methods
can then use the page number to decide which set of properties to
validate. 

Mark Woon wrote:
> 
> Ted Husted wrote:
> 
> > Be sure your reset() method is not blindly resetting the properties. The
> > default reset() does nothing, but people often have it reset everything.
> > The only important thing to reset() is the checkboxes, since the
> > browsers do not resubmit these if they are unchecked.
> 
> It's also important to reset() select boxes.  I'd assume that radio buttons would
> fall into this category too.
> 
> Still, I don't see why it would be a problem to blindly reset everything though...
> 
> -Mark
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: persistance for wizard type forms

2002-01-23 Thread Mark Woon

Ted Husted wrote:

> Be sure your reset() method is not blindly resetting the properties. The
> default reset() does nothing, but people often have it reset everything.
> The only important thing to reset() is the checkboxes, since the
> browsers do not resubmit these if they are unchecked.

It's also important to reset() select boxes.  I'd assume that radio buttons would
fall into this category too.

Still, I don't see why it would be a problem to blindly reset everything though...

-Mark



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to do an outcall but return to the session?

2002-01-23 Thread David Larson

Assuming that your dependent upon data that you've put in the session...

The problem I see you having here is that the request to the external
service could take longer than the session timeout on your application
server.  Unless you can guarantee that the turn-around time is going to be
some time increment significantly lower than the timeout, you're going to
have to create a mechanism to persist the session information and rebuild
the session information if a timeout does occur.  Otherwise, upon timeout of
the session, all session level information is lost.

- Dave

-Original Message-
From: Alex Paransky [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 4:21 PM
To: Struts Users Mailing List
Cc: [EMAIL PROTECTED]
Subject: RE: How to do an outcall but return to the session?


Assuming your client is using cookies this should work automatically.  If
your client has his/her cookies disabled you must make sure to submit a
"re-written" url as the target for "returnTo" processing in your other
system.

-AP_

-Original Message-
From: Reid Pinchback [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 12:05 PM
To: [EMAIL PROTECTED]
Subject: How to do an outcall but return to the session?



Hi all,

I need to integrate an external web-based service with a
Struts-based app.  The chain of events are:

1. client invokes URL on my app within their current session.

2. My action class gets hit.  Sometimes it would immediately
forward to a JSP, but sometimes it must first bounce the user
to the external service before doing the forwarding.

3. When I forward the user to the external service it is by
doing a redirect, and I tell the external service where to send
the user back to by tacking on an appropriately-formatted
query parameter containing the return URL.  When the
user submits whatever is required by that service, the
service sends them to that URL (i.e. back where they
came from).

4. When the user gets back, they need to be in the same
http session they were in before being bounced to the
external service.  Lots of stuff is bound to their session,
and it would be a bad thing to have lost that context data.

How do I do this in Struts?  In particular, if I'm in an Action class
and constructing an ActionForward object to toss the user to
the external service, how do I make sure the session is preserved?
Does that happen automatically via cookie magic, or do I need
to extract a session id from somewhere and tack it on to the
URL for the return?  If the latter, how specifically do I do that?

Thanks!

  Reid





-
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Model Persistence Survey

2002-01-23 Thread Pete Carapetyan

I would also like to know about anyone else's experiences with JDO.

Martin Farrell wrote:

> Hi
>
> I spent a lot of time looking into persistence frameworks and frameworks
> following my decision to use struts. i eventually chose to use expresso
> because it offered a persistence layer independent of the underlying
> database, and provided me a suite of admin utilities that would save me time
> in having to create these utilities myself.
>
> My other reason for choosing expresso is that the framework integrates into
> struts, and also has an integration path if i need/want to grow my
> application along the j2ee path.
>
> i would be interested in learning more about peoples experience with jdo  -
> i liked the approach, but feel i dont have enough time to build the
> supporting admin utilities for my app
>
> Martin
>
> -Original Message-
> From: Christopher Barham [mailto:[EMAIL PROTECTED]]
> Sent: 23 January 2002 09:51
> To: Struts Users Mailing List
> Subject: Re: Model Persistence Survey
>
> Hi,
> I really think that Java Data Objects has a big future... see JSR012:
> http://www.jcp.org/aboutJava/communityprocess/first/jsr012/index.html
> Currently we are evaluating Forte Transparent Persistence, which is a
> physical incarnation of Java Data Objects - see
> http://java.sun.com/products/jdbc/related.html and
> http://access1.sun.com/jdo/
> The Forte stuff (Transparent Persistence) is detailed here:
> http://www.sun.com/forte/ffj/resources/articles/jdo.html
>
> So far it is working very well - Although I have some qualms about byte
> code enhancement as the mechanism to get the TP activity into your classes.
> If nothing else, it gives you an 'unknown area' to worry about in your code
> - For every simple code bug so far we have immediately assumed it is to do
> with the 'magic' of TP messing something up - however, in every case, (so
> far), it has been a simple non-TP coding error that was the root cause - it
> just took longer to track down :-)
>
> For quick and easy database adhoc code, I have also taken to using TableGen
> now and then to ease generation of the JDBC aware base classes  - it gives
> connection pooling and so on  It's fairly old, but works nicely with a
> minimum of fuss.  The only slight problem was that with Oracle you need to
> explicitly close the Statement in the disconnect method of the generated
> class DatabaseAccess - it took a bit of head scratching to work out where
> the dreaded "too many open cursors" error was coming from :-(
> http://freespace.virgin.net/joe.carter/TableGen/
>
> Regards
>
> Chris
>
>
>
> Struts
>
> NewsgroupTo:
> [EMAIL PROTECTED]
> (@Basebeans.ccc:
>
> om)  Survey
>
>
> 22/01/02
>
> 23:55
>
> Please
>
> respond to
>
> "Struts Users
>
> Mailing List"
>
>
>
>
>
> Subject: Re: Model Persistence Survey
> From: Vic Cekvenich <[EMAIL PROTECTED]>
>  ===
> Oh, yeah, Castor gets votes.
>
> Vic Cekvenich wrote:
>
> > I do not like surveys. But I would like to get a feel for "How are
> > people implementing the model persistence". Sort of a popularity
> > contest. Also if you did not like it, how would you do it next time.
> > So if you would please respond.
> >
> > How do you implement model persistence to a SQL DB.
> >
> > EJB (even for non-midleware needed webapps)
> >
> > Expreso features
> >
> > JDBC ResultSet w/ own base class
> >
> > i Village /Tourge
> >
> > JDBC RowSet
> > (
> http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/a90211/rows
> et.htm
> )
> >
> >
> > Other?
> > Is there another way?
> >
> >
> > Right now I like RowSet, but what is popular out there?
> >
> >
> >
> > Currious, TIA
> > Vic
> >
> > ps: maybe one day those "hooks" grow on Sturts, so Struts takes a stance
> > on a good aproach for model persistance
> >
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> ** For great Emap magazine subscription & gift offers visit 
>http://www.emapmagazines.co.uk **
>
> 
> The information in this email is intended only for the addressee(s) named above.
> Access to this email by anyone else is unauthorised.
> If you are not the intended recipient of this message any disclosure, copying,
> distribution or any action taken in reliance on it is prohibited and may be unlawful.
>
> Emap plc and or its subsidiaries do not warrant that any attachments are free from
> viruses or other defects and accept no liability for any losses resulting from
> infected email transmissions.
>
> Please note that any views expressed in this email 

RE: persistance for wizard type forms

2002-01-23 Thread Peter . Zybrick

whoops - cut too much out, forgot the ctor

public OrderEntryForm( ) {
doReset = true;
defaults();
}


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 5:06 PM
To: [EMAIL PROTECTED]
Subject: RE: persistance for wizard type forms


i think thats the default behavior for an ActionForm.reset()  In your class
that extends the ActionForm, add a reset().  You can leave it empty at
first, and your ActionForm bean in the session shouldn't get cleared.  We
use this capability to set initial defaults and to optionally clear values
based on a button (i.e. New Order vs. Similar Order button) - take a look at
the chunk of code below, its a sample from our user interface framework (i
stripped out the non-relevant stuff). 

Pete Zybrick

public class OrderEntryForm extends ActionForm implements IOrderEntry {
private boolean doReset;

public void setDoReset(boolean doReset) {
this.doReset = doReset;
}
public boolean getDoReset() {
return doReset;
}
/**
 * @see ActionForm#reset(ActionMapping, HttpServletRequest)
 */
public void reset(ActionMapping mapping, HttpServletRequest request)
{
String fromPathName = mapping.getPath();
String submitTarget = request.getParameter("submitTarget");

// Process: OrderEntry
if (fromPathName.equals("/OrderEntry")) {
if ((submitTarget.equals("submit"))
|| (submitTarget.equals("cancel"))
|| (submitTarget.equals("enquiry")))
doReset = false;

// Process: OrderEntryResultsConfirmed
} else
if
(fromPathName.equals("/OrderEntryResultsConfirmed")) {
if ((submitTarget.equals("similarOrder"))
|| (submitTarget.equals("print"))
|| (submitTarget.equals("cancel")))
doReset = false;

// Process: OrderEntryResultsRejected
} 
}

if (doReset)
defaults();
doReset = true;
}

public void defaults() {

// set the default values in your form here


}



-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 4:47 PM
To: Struts Users Mailing List
Subject: persistance for wizard type forms


I'm developing  wizard-type forms using struts. The data I entered
previously doesn't show up when I go back to the previous form even though I
use the same 'ActionForm' for all the wizard forms and I set the scope in
the action mapping to 'session'. What am I missing ?


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Question about forms and validation.

2002-01-23 Thread S. Chong


>Is there a way to get it to display the form as the user edited it?


Mike,

I'm also relatively new to Struts, and as such am not particularly sure that 
I should be posting with an answer, but here goes anyhoo...

I've encountered a similar problem to yours, and my solution was a three 
step approach.

First, create private String vars(propStr) in the actionForm class.

Second, modify the getProperty method to pass the string input into 
(propStr) before performing any validation.  If the validation passes,  pass 
the validated data into (propStr).

Third, modify the setProperty method to return (propStr).

If there's a cleaner way to do this, I'd really be interested in finding out 
how to do it, as I feel that this method is kinda clunky.

Thanks and good luck,
-Sherman


_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Includes and processing time

2002-01-23 Thread Arron Bates

The type of include you're using here is a dynamic include. Meaning that 
the page to be included isn't simply added, it's compiled into its own 
servlet, and the page's context is passed to the included servlet. For 
the tags to work in the included servlet, they need all the taglib 
imports like your original JSP would.

Or you can try the other form of include, which simply takes the file 
and puts it in the larger file when the JSP is compiled (this is the 
behavior it seems you are expecting)...
<%@ include file="my_page.jsp" %>


Arron.

Bryan P. Glennon wrote:

>Hi -
>This is really more of a JSP question, but since it involves struts
>tags I figured I'd give it a shot here. I have a page which contains a
>form built using the html:form taglib. Based on the users selection from
>that form, I go off and do some processing and redirect the user back to
>the same page. During the processing, an attribute gets set to indicate
>which detail information to include. I try to include this detail page
>(which is also an html:form form) by doing a jsp:include.  Basically,
>the page looks like this:
>
>   
>   Navigation form
>   
>
>   Static stuff here
>
>   
>
>   My problem is that the tags in the included page never get
>processed. So, is there anyway I can make this work?
>
>Sorry again for the OT post.
>
>Cheers,
>Bryan
>
>--
>Bryan Glennon (mailto:[EMAIL PROTECTED])
>BPG Consulting, Inc. (http://www.bpgc.com)
>Tech Question? (mailto:[EMAIL PROTECTED])
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: property 'property' not set in NestedSubmitTag

2002-01-23 Thread Arron Bates

Believe it or not, this is as expected...

The nested extension is not to simply maintain the functionality of the 
original, but to provide it in the nested context. If you don't want the 
features of the nested context (the default submit tag), then use the 
original html:submit

When you use a nested tag, one thing is expected. The "property" 
property to be set and intended to be used in the nested context.
Also, where tags use a "name" attribute to identify a bean, this will be 
done automatically, supplied or not.

Just keep in mind, that if you don't need to nest a property, you should 
look at using the original tags in its place.
That's why all the tags weren't extended. Only those who could benefit 
from it.


Arron.


Christian Simonutti wrote:

>On Wed Jan 23, 2002 at 03:2322PM +0100, Tom Klaasen (TeleRelay) wrote:
>
>>Does attached patch work for you?
>>
>
>yes, works with reduced tag () as expected.
>
>thanx,
>simon
>
>[snip]
>
>--
>To unsubscribe, e-mail:   
>For additional commands, e-mail: 
>
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: persistance for wizard type forms

2002-01-23 Thread Ted Husted

Be sure your reset() method is not blindly resetting the properties. The
default reset() does nothing, but people often have it reset everything.
The only important thing to reset() is the checkboxes, since the
browsers do not resubmit these if they are unchecked. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/


Sriram Nookala wrote:
> 
> I'm developing  wizard-type forms using struts. The data I entered
> previously doesn't show up when I go back to the previous form even though I
> use the same 'ActionForm' for all the wizard forms and I set the scope in
> the action mapping to 'session'. What am I missing ?
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to do an outcall but return to the session?

2002-01-23 Thread Alex Paransky

Assuming your client is using cookies this should work automatically.  If
your client has his/her cookies disabled you must make sure to submit a
"re-written" url as the target for "returnTo" processing in your other
system.

-AP_

-Original Message-
From: Reid Pinchback [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 12:05 PM
To: [EMAIL PROTECTED]
Subject: How to do an outcall but return to the session?



Hi all,

I need to integrate an external web-based service with a
Struts-based app.  The chain of events are:

1. client invokes URL on my app within their current session.

2. My action class gets hit.  Sometimes it would immediately
forward to a JSP, but sometimes it must first bounce the user
to the external service before doing the forwarding.

3. When I forward the user to the external service it is by
doing a redirect, and I tell the external service where to send
the user back to by tacking on an appropriately-formatted
query parameter containing the return URL.  When the
user submits whatever is required by that service, the
service sends them to that URL (i.e. back where they
came from).

4. When the user gets back, they need to be in the same
http session they were in before being bounced to the
external service.  Lots of stuff is bound to their session,
and it would be a bad thing to have lost that context data.

How do I do this in Struts?  In particular, if I'm in an Action class
and constructing an ActionForward object to toss the user to
the external service, how do I make sure the session is preserved?
Does that happen automatically via cookie magic, or do I need
to extract a session id from somewhere and tack it on to the
URL for the return?  If the latter, how specifically do I do that?

Thanks!

  Reid





-
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: persistance for wizard type forms

2002-01-23 Thread Alex Paransky

Make sure to put your form in the "session" scope.

-AP_

-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 1:47 PM
To: Struts Users Mailing List
Subject: persistance for wizard type forms


I'm developing  wizard-type forms using struts. The data I entered
previously doesn't show up when I go back to the previous form even though I
use the same 'ActionForm' for all the wizard forms and I set the scope in
the action mapping to 'session'. What am I missing ?


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Anomalies with (possibly AIX JVM issue?)

2002-01-23 Thread Alex Paransky

Some time back, we ran in to a problem between different servers.  The
problem, was that for some reason, the definition of the constants SKIP_BODY
and such mapped to different integers.  While running your code on one
platform, try to print out the values of the common tag constants such as
SKIP_BODY, SKIP_PAGE, EVAL_BODY_INCLUDE and others.  Make sure they are the
same under both platforms.

-AP_

-Original Message-
From: DONNIE HALE [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 1:49 PM
To: [EMAIL PROTECTED]
Subject: Anomalies with  (possibly AIX JVM issue?)


Folks,

I have an application deployed via a .ear file to WebLogic 6.1sp1 on NT and
on AIX. The following code works fine on NT:

   
 
   
 
 
 
 
 
   

  

On AIX, however, the  tag returns false, skipping the body. Note
that this is deploying the exact same .ear file (FTP'd from one system to
the other). It happens with Struts 1.0 and 1.0.1.

If I put the following code in the .jsp file just before the above code, the
dump to stdout makes it clear that I can access the bean and the property
method on the bean:

<%
Object obj = session.getAttribute("hostessDollarInfo");

if (obj != null)
{
System.out.println("Retrieved object of type: " +
obj.getClass().getName());
if (obj instanceof tlc.sam.om.jsp.policy.HostessDollarBean)
{
tlc.sam.om.jsp.policy.HostessDollarBean hdi =
(tlc.sam.om.jsp.policy.HostessDollarBean) obj;
tlc.sam.om.policy.domain.HostessDollarBonusTable[] tables =
hdi.getTables();
System.out.println(tables.length);
}
}
else
{
System.out.println("HostessDollarBean attribute couldn't be
retrieved!");
}
%>

If we remove the , we get a runtime error in the  to
the effect that the "tables" property doesn't exist. I've rummaged around
the code called by , and the only thing I can come up with is
that there's some JVM difference w/ the IBM JDK for AIX. I'm not ruling out
WebLogic, but in the code path b/w where the  tag starts
executing and the property utils methods are called, I don't see anyplace
where WebLogic could intervene.

Has anyone experience this problem, or does anyone have any insight? We're
about at our wit's end here in trying to use the iterate tag for this case.
As far as I know, it's working everywhere else we try it.

Thanks!

Donnie



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: persistance for wizard type forms

2002-01-23 Thread Peter . Zybrick

i think thats the default behavior for an ActionForm.reset()  In your class
that extends the ActionForm, add a reset().  You can leave it empty at
first, and your ActionForm bean in the session shouldn't get cleared.  We
use this capability to set initial defaults and to optionally clear values
based on a button (i.e. New Order vs. Similar Order button) - take a look at
the chunk of code below, its a sample from our user interface framework (i
stripped out the non-relevant stuff). 

Pete Zybrick

public class OrderEntryForm extends ActionForm implements IOrderEntry {
private boolean doReset;

public void setDoReset(boolean doReset) {
this.doReset = doReset;
}
public boolean getDoReset() {
return doReset;
}
/**
 * @see ActionForm#reset(ActionMapping, HttpServletRequest)
 */
public void reset(ActionMapping mapping, HttpServletRequest request)
{
String fromPathName = mapping.getPath();
String submitTarget = request.getParameter("submitTarget");

// Process: OrderEntry
if (fromPathName.equals("/OrderEntry")) {
if ((submitTarget.equals("submit"))
|| (submitTarget.equals("cancel"))
|| (submitTarget.equals("enquiry")))
doReset = false;

// Process: OrderEntryResultsConfirmed
} else
if
(fromPathName.equals("/OrderEntryResultsConfirmed")) {
if ((submitTarget.equals("similarOrder"))
|| (submitTarget.equals("print"))
|| (submitTarget.equals("cancel")))
doReset = false;

// Process: OrderEntryResultsRejected
} 
}

if (doReset)
defaults();
doReset = true;
}

public void defaults() {

// set the default values in your form here


}



-Original Message-
From: Sriram Nookala [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 4:47 PM
To: Struts Users Mailing List
Subject: persistance for wizard type forms


I'm developing  wizard-type forms using struts. The data I entered
previously doesn't show up when I go back to the previous form even though I
use the same 'ActionForm' for all the wizard forms and I set the scope in
the action mapping to 'session'. What am I missing ?


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to get List/Collection from request attribute with form validation.

2002-01-23 Thread Nekkalapudi, Viplava

If we have a proper ActionForm with the same field as our ,
validation error retrieves the user entered values.

But if we have a List/Collection of data saved as a property of the
ActionForm 
OR as request attribute,
How to retrieve this data, when there is a validation error. 
For Example:
I have a list retrieved from database and saved as request attribute 
(I don't want to use more data in session) 
to display as multiple radio buttons on one JSP as part of . 
I validate the ActionForm when the user tries to go to next page.
When I get validation error, the collection  gets is NULL. 


-Original Message-
From: David Gaulin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 4:09 AM
To: Struts Users Mailing List
Subject: Re: Question about forms and validation.


Mike,

If you have the proper ActionForm class which represent the proper field in
you form and you use the struts html custom tag, your data should come back.
That is one of the best feature of Struts.

Hope this helps

David

- Original Message -
From: "Witt, Mike (OH35)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 2:56 PM
Subject: Question about forms and validation.


> Hi,
>
> I have a question about the validate method on the ActionForm.  From my
> understanding,
> if a validation error is found, you set up a collection of ActionErrors
and
> return this.  This
> causes struts to forward back to your input form, correct?
>
> In my situation, I populate a form for editing.  When the submit is
clicked,
> I validate the entry.
> When a validation error occurs, it always displays the original form data.
> Is there a way to
> get it to display the form as the user edited it?  Many times a large
> quantity of good data is
> lost because of one bad field.
>
> Thanks for your help,
>
> Mike Witt
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Anomalies with (possibly AIX JVM issue?)

2002-01-23 Thread DONNIE HALE

Folks,

I have an application deployed via a .ear file to WebLogic 6.1sp1 on NT and on AIX. 
The following code works fine on NT:

   
 
   
 
 
 
 
 
   

  

On AIX, however, the  tag returns false, skipping the body. Note that this 
is deploying the exact same .ear file (FTP'd from one system to the other). It happens 
with Struts 1.0 and 1.0.1.

If I put the following code in the .jsp file just before the above code, the dump to 
stdout makes it clear that I can access the bean and the property method on the bean:

<%
Object obj = session.getAttribute("hostessDollarInfo");

if (obj != null)
{
System.out.println("Retrieved object of type: " + obj.getClass().getName());
if (obj instanceof tlc.sam.om.jsp.policy.HostessDollarBean)
{
tlc.sam.om.jsp.policy.HostessDollarBean hdi =
(tlc.sam.om.jsp.policy.HostessDollarBean) obj;
tlc.sam.om.policy.domain.HostessDollarBonusTable[] tables = 
hdi.getTables();
System.out.println(tables.length);
}
}
else
{
System.out.println("HostessDollarBean attribute couldn't be retrieved!");
}
%>

If we remove the , we get a runtime error in the  to the 
effect that the "tables" property doesn't exist. I've rummaged around the code called 
by , and the only thing I can come up with is that there's some JVM 
difference w/ the IBM JDK for AIX. I'm not ruling out WebLogic, but in the code path 
b/w where the  tag starts executing and the property utils methods are 
called, I don't see anyplace where WebLogic could intervene.

Has anyone experience this problem, or does anyone have any insight? We're about at 
our wit's end here in trying to use the iterate tag for this case. As far as I know, 
it's working everywhere else we try it.

Thanks!

Donnie



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




persistance for wizard type forms

2002-01-23 Thread Sriram Nookala

I'm developing  wizard-type forms using struts. The data I entered
previously doesn't show up when I go back to the previous form even though I
use the same 'ActionForm' for all the wizard forms and I set the scope in
the action mapping to 'session'. What am I missing ?


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Includes and processing time

2002-01-23 Thread Bryan P. Glennon

Hi -
This is really more of a JSP question, but since it involves struts
tags I figured I'd give it a shot here. I have a page which contains a
form built using the html:form taglib. Based on the users selection from
that form, I go off and do some processing and redirect the user back to
the same page. During the processing, an attribute gets set to indicate
which detail information to include. I try to include this detail page
(which is also an html:form form) by doing a jsp:include.  Basically,
the page looks like this:


Navigation form


Static stuff here



My problem is that the tags in the included page never get
processed. So, is there anyway I can make this work?

Sorry again for the OT post.

Cheers,
Bryan

--
Bryan Glennon (mailto:[EMAIL PROTECTED])
BPG Consulting, Inc. (http://www.bpgc.com)
Tech Question? (mailto:[EMAIL PROTECTED])

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Fwd: Href issue

2002-01-23 Thread Sidhartha Jain


Hi
I am having an issue with  tag of struts. I think I don't know how to use 
it.
Actually I have a java script fucntion which looks like this
function launchEdit(field, accField, relation, newType)
{
 currentField = document.editForm.field;
 currentAccField = document.editForm.accField;
 isRelation = relation;
var url = 
'LoadObject.do?parent=true&action=Edit&type='+newType+'&accNum='+accField.value;
window.open(url,'CreateNew','height=500,width=550,resizable=1,scrollbars=1');
}
And it needs to be called by passing the parameters that would also be dynamic for me 
(which will change everytime we call it.)

Can Someone throw some light on this issue as to how we achieve this functionality .
I would be highly thankful to you.

Thanks in Advance
Sidhartha


 

--- Begin Message ---


Hi
I am having an issue with  tag of struts. I think I don't know how to use 
it.
Actually I have a java script fucntion which looks like this
function launchEdit(field, accField, relation, newType)
{
  currentField = document.editForm.field;
  currentAccField = document.editForm.accField;
  isRelation = relation;
var url = 
'LoadObject.do?parent=true&action=Edit&type='+newType+'&accNum='+accField.value;
window.open(url,'CreateNew','height=500,width=550,resizable=1,scrollbars=1');
}
And it needs to be called by passing the parameters that would also be dynamic for me 
(which will change everytime we call it.)

Can Someone throw some light on this issue as to how we achieve this functionality .
I would be highly thankful to you.

Thanks in Advance
Sidhartha
 



--- End Message ---

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Question about forms and validation.

2002-01-23 Thread Witt, Mike (OH35)

David, Thanks for you help ...

I'm doing all that you suggest.  As a matter of fact, when I submit the form
to 
update the database, all the fields in the form are automaticallly set like
I 
would expect.

My form is intially filled in with good data from the database.  Then I make
a 
change which will trip up the validation.  The validate() method does indeed

return errors, but when the form is redisplayed, the good data is shown
which 
originally came from the database.  I would like to see the bad data because

there may have been quite a bit of data entry with only a small error to be 
corrected.

Thanks again, Mike

-Original Message-
From: David Gaulin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 24, 2002 5:09 AM
To: Struts Users Mailing List
Subject: Re: Question about forms and validation.


Mike,

If you have the proper ActionForm class which represent the proper field in
you form and you use the struts html custom tag, your data should come back.
That is one of the best feature of Struts.

Hope this helps

David

- Original Message -
From: "Witt, Mike (OH35)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 2:56 PM
Subject: Question about forms and validation.


> Hi,
>
> I have a question about the validate method on the ActionForm.  From my
> understanding,
> if a validation error is found, you set up a collection of ActionErrors
and
> return this.  This
> causes struts to forward back to your input form, correct?
>
> In my situation, I populate a form for editing.  When the submit is
clicked,
> I validate the entry.
> When a validation error occurs, it always displays the original form data.
> Is there a way to
> get it to display the form as the user edited it?  Many times a large
> quantity of good data is
> lost because of one bad field.
>
> Thanks for your help,
>
> Mike Witt
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: CHARACTER ENCODING !

2002-01-23 Thread wojtek

Here it goes,

thanks for help.

Wojtek



head.jsp
Description: Binary data


index.jsp
Description: Binary data

 
-- 
Myslisz o otworzeniu wlasnego sklepu internetowego?
A moze o wynajeciu stoiska w wirtualnym pasazu?
W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
 



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: Model Persistence Survey

2002-01-23 Thread Keith Chew

Hi

Just some thoughts. You could use the delegate pattern instead of
inheritence. This will help decouple your FormBeans from your DaoBeans.

Keith



-Original Message-
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]]
Sent: Thursday, 24 January 2002 9:10 a.m.
To: [EMAIL PROTECTED]
Subject: Re: Model Persistence Survey


Subject: Re: Model Persistence Survey
From: Vic Cekvenich <[EMAIL PROTECTED]>
 ===


Here is a sample DAO Extended Form Bean code :

public class NameZoomFrm extends daoFormBean {

private String fstName;
private String lstName;


public String getFstName() {   //get it from _crs RowSet
 CachedRowSet cr = getCrs();
try{   this.fstName = cr.getString("first_name");  } // try
 catch (Exception e)   {System.out.println(e);} // catch
 return (this.fstName);  }// get
public String getLstName() {  //get it from _crs RowSet
 CachedRowSet cr = getCrs();
try{  this.lstName = cr.getString("last_name");} // try
 catch (Exception e)   {System.out.println(e);} // catch
 return (this.lstName);
 }// get
  public void setFstName(String aFstName) {   //get it from _crs RowSet
CachedRowSet cr = getCrs();
try{ cr.updateString("first_name",aFstName);
this.fstName = aFstName;
} // try
catch (Exception e)   {System.out.println(e);} // catch
setCrs(cr);
} //setFst
public void setLstName(String aLstName) {   //get it from _crs RowSet
CachedRowSet cr = getCrs();
try{ cr.updateString("last_name",aLstName);
this.lstName=aLstName;
 } // try
catch (Exception e)   {System.out.println(e);} // catch
setCrs(cr);
} //setFst


public int retrieve(BigDecimal aBD) {
try{
 CachedRowSet cr = getCrs();
 cr = new CachedRowSet(); // easier then resultset
 // you must test this sql string manualy for a SQL IDE
 cr.setCommand("select * from contact where id = ?");
 // driver issues fix:
 cr.setTableName("contact");
  // to limit the number of rows coming back, we only need a page at
a time
  cr.setBigDecimal(1,aBD);
   exec(cr);
} // try
catch (Exception e)
{ System.out.println(e);
   e.printStackTrace();} // catch
return 0;
}// retrieve

public void blank()
{  try { CachedRowSet cr = getCrs();
 cr.updateNull("first_name");
 cr.updateNull("last_name");
 cr.updateNull("id");
}  catch (Exception e)   { procE(this,e);} // catch
}// blank
}//class


Here is the DAO implementation ... using RowSet, but could use JDO, such
as Castor.

import com.wintecinc.struts.action.ValidatorForm;
public class daoFormBean extends ValidatorForm  {


 private Connection con=null;
 private Connection upCon=null;
 private DataSource ds;
 private CachedRowSet _crs;
 private String sqlString;
 private BigDecimal PK;


 public Connection getCon() {return con;}
 public CachedRowSet getCrs() {return this._crs;}
 public void setCrs(CachedRowSet aCRS) {this._crs=aCRS;}



 public Hashtable getIterateMap() { //is there a better way?
like use crs.getCollection?
 CachedRowSet cr = getCrs();
 int rc=cr.size();
 Hashtable iterateMap = new Hashtable();
 // count out the number of rows with dummy map
 for (int i=1; i <= rc; i++) { iterateMap.put(new
Integer(i),new Integer(i));}
 return iterateMap;}


 public BigDecimal getPK() {  //get it from _crs RowSet
 try{  this.PK = _crs.getBigDecimal("id");} // try
 catch (Exception e)   {System.out.println(e);} // catch
 return (this.PK);
 }// get

 public void dbCon() {  // connect to db
 try{  ds = PoolMan.findDataSource("jndiSample");
 //we should in production give it a password in code
not in file pool.xml
 con=ds.getConnection();}
 catch (Exception e)  {
 debug(this, "We did not connect");
 procE(this,e);} // catch
 }// con

 public void dbDisCon() {
 try{if (con!=null) con.close();
 ds=null;
 }
 catch (Exception e) {System.out.println(e);  }//catch
 } //disCon

 public int getRowNext() {  // get the next row
 try{
 CachedRowSet cr = getCrs();
 cr.next();
 }
 catch (Exception e)  { debug(this,"what row");
 System.out.println(e);  e.printStackTrace();} // catch
 return 0; } // rowNext()

 public long update(){
 try{
 // update should be using a different con pool
to same db
 dbCon();
 _crs.updateRow();
 _crs.acceptChanges(getCon());

RE: CHARACTER ENCODING !

2002-01-23 Thread Peter . Zybrick

ouch... utf-8 works on WebLogic and WebSphere, i've got tomcat running at
home, let me try it tonight and see what i get.  please send me a sample of
your jsp - [EMAIL PROTECTED]

pete

-Original Message-
From: wojtek [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 4:06 PM
To: Struts Users Mailing List
Subject: Re: CHARACTER ENCODING !


Ok Peter great, but I am using tomcat which gives this errror message when
setting encoding to utf-8

A Servlet Exception Has Occurred
org.apache.jasper.compiler.ParseException: Cannot read file: ze file
at org.apache.jasper.compiler.JspReader.pushFile2(Unknown Source)
at org.apache.jasper.compiler.JspReader.(Unknown Source)
at org.apache.jasper.compiler.Parser.(Unknown Source)
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 9:55 PM
Subject: RE: CHARACTER ENCODING !


> i've tested this with german/french/spanish, should work for polish, here
is
> the first few lines from a jsp:
>
> 
> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
> <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
> <%@page import="com.bmw.uif.*" contentType="text/html; charset=utf-8"%>
> 
>
> 
> 
>
>
> Pete Zybrick
>
> -Original Message-
> From: wojtek [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 3:53 PM
> To: Struts Users Mailing List
> Subject: Re: CHARACTER ENCODING !
>
>
> Hi,
>
> My JSP looks like that:
>
> <%@ page contentType="text/html; charset=iso-8859-2" %>
>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>
> 
>
>
>
> I am also  setting request.setCharacterEncoding("ISO-8859-2")  in
> every possible place !
>
>
>
> Still the output from the forms is  instead of Polish chars .
>
>
>
> Anyone have got the idea what's wrong !
>
>
>
> regards
>
>
>
> Wojtek
>
>
>
> - Original Message -
> From: "Martin Fekete" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 10:51 AM
> Subject: Re: CHARACTER ENCODING !
>
>
> > in JSP you should use page directive <%@ page contentType="text/html;
> > charset=your encoding here" %>
> >
> > and property files must be converted to acii (f.e. using
> > %JAVA_HOME%/bin/native2ascii.exe)
> >
> > Feky
> >
> > - Original Message -
> > From: "Christopher Cheng" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Cc: "wojtek" <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 23, 2002 3:10 AM
> > Subject: RE: CHARACTER ENCODING !
> >
> >
> > Same here. I am building a site using English, Traditional and
Simplified
> > Chinese. It is fine if I do not set the encoding to "big5" or whatever
in
> > JSP header, but I have to manually change the encoding in IE. What is
> > strange is that if I put some chinese characters directly in the JSP,
> those
> > characters are displayed properly, but those from the property files are
> > disrupted.
> >
> > Anybody can help?
> >
> > -Original Message-
> > From: wojtek [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 23, 2002 1:01 AM
> > To: Struts Users Mailing List
> > Subject: CHARACTER ENCODING !
> >
> >
> > Hi,
> >
> > I am using struts form some form validation (obvious isn't it?) and I
came
> > across the following error:
> >
> >
> > National Polish characters returned from the forms are badly encoded !
> >
> > I am using struts on win2k, jdk 1.3, the jsp page charset is set to
> > ISO-8859-2
> >
> > Can anyone help ?
> >
> > regards
> >
> > Wojtek
> >
> >
> >
> >
> > --
> > Myslisz o otworzeniu wlasnego sklepu internetowego?
> > A moze o wynajeciu stoiska w wirtualnym pasazu?
> > W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> > Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> >
> > --
> > Myslisz o otworzeniu wlasnego sklepu internetowego?
> > A moze o wynajeciu stoiska w wirtualnym pasazu?
> > W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> > Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
> >
>
>
> --
> Meczy Cie poszukiwanie korzystnej oferty?
> Jesli TAK - podaj nam czego potrzebujesz i wybierz najlepsza propozycje
> Wyszukiwanie i zbieranie ofert zostaw nam.
> Bezplatne Oferty Kupna w Centrum e-biznesu http://ofertykupna.getin.pl
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-ma

Re: Question about forms and validation.

2002-01-23 Thread David Gaulin

Mike,

If you have the proper ActionForm class which represent the proper field in
you form and you use the struts html custom tag, your data should come back.
That is one of the best feature of Struts.

Hope this helps

David

- Original Message -
From: "Witt, Mike (OH35)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 2:56 PM
Subject: Question about forms and validation.


> Hi,
>
> I have a question about the validate method on the ActionForm.  From my
> understanding,
> if a validation error is found, you set up a collection of ActionErrors
and
> return this.  This
> causes struts to forward back to your input form, correct?
>
> In my situation, I populate a form for editing.  When the submit is
clicked,
> I validate the entry.
> When a validation error occurs, it always displays the original form data.
> Is there a way to
> get it to display the form as the user edited it?  Many times a large
> quantity of good data is
> lost because of one bad field.
>
> Thanks for your help,
>
> Mike Witt
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: CHARACTER ENCODING !

2002-01-23 Thread wojtek

Ok Peter great, but I am using tomcat which gives this errror message when
setting encoding to utf-8

A Servlet Exception Has Occurred
org.apache.jasper.compiler.ParseException: Cannot read file: ze file
at org.apache.jasper.compiler.JspReader.pushFile2(Unknown Source)
at org.apache.jasper.compiler.JspReader.(Unknown Source)
at org.apache.jasper.compiler.Parser.(Unknown Source)
- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 9:55 PM
Subject: RE: CHARACTER ENCODING !


> i've tested this with german/french/spanish, should work for polish, here
is
> the first few lines from a jsp:
>
> 
> <%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
> <%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
> <%@page import="com.bmw.uif.*" contentType="text/html; charset=utf-8"%>
> 
>
> 
> 
>
>
> Pete Zybrick
>
> -Original Message-
> From: wojtek [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 3:53 PM
> To: Struts Users Mailing List
> Subject: Re: CHARACTER ENCODING !
>
>
> Hi,
>
> My JSP looks like that:
>
> <%@ page contentType="text/html; charset=iso-8859-2" %>
>
> <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
>
> <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
>
> <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
>
> 
>
>
>
> I am also  setting request.setCharacterEncoding("ISO-8859-2")  in
> every possible place !
>
>
>
> Still the output from the forms is  instead of Polish chars .
>
>
>
> Anyone have got the idea what's wrong !
>
>
>
> regards
>
>
>
> Wojtek
>
>
>
> - Original Message -
> From: "Martin Fekete" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 10:51 AM
> Subject: Re: CHARACTER ENCODING !
>
>
> > in JSP you should use page directive <%@ page contentType="text/html;
> > charset=your encoding here" %>
> >
> > and property files must be converted to acii (f.e. using
> > %JAVA_HOME%/bin/native2ascii.exe)
> >
> > Feky
> >
> > - Original Message -
> > From: "Christopher Cheng" <[EMAIL PROTECTED]>
> > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > Cc: "wojtek" <[EMAIL PROTECTED]>
> > Sent: Wednesday, January 23, 2002 3:10 AM
> > Subject: RE: CHARACTER ENCODING !
> >
> >
> > Same here. I am building a site using English, Traditional and
Simplified
> > Chinese. It is fine if I do not set the encoding to "big5" or whatever
in
> > JSP header, but I have to manually change the encoding in IE. What is
> > strange is that if I put some chinese characters directly in the JSP,
> those
> > characters are displayed properly, but those from the property files are
> > disrupted.
> >
> > Anybody can help?
> >
> > -Original Message-
> > From: wojtek [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 23, 2002 1:01 AM
> > To: Struts Users Mailing List
> > Subject: CHARACTER ENCODING !
> >
> >
> > Hi,
> >
> > I am using struts form some form validation (obvious isn't it?) and I
came
> > across the following error:
> >
> >
> > National Polish characters returned from the forms are badly encoded !
> >
> > I am using struts on win2k, jdk 1.3, the jsp page charset is set to
> > ISO-8859-2
> >
> > Can anyone help ?
> >
> > regards
> >
> > Wojtek
> >
> >
> >
> >
> > --
> > Myslisz o otworzeniu wlasnego sklepu internetowego?
> > A moze o wynajeciu stoiska w wirtualnym pasazu?
> > W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> > Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> >
> > --
> > Myslisz o otworzeniu wlasnego sklepu internetowego?
> > A moze o wynajeciu stoiska w wirtualnym pasazu?
> > W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> > Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
> >
>
>
> --
> Meczy Cie poszukiwanie korzystnej oferty?
> Jesli TAK - podaj nam czego potrzebujesz i wybierz najlepsza propozycje
> Wyszukiwanie i zbieranie ofert zostaw nam.
> Bezplatne Oferty Kupna w Centrum e-biznesu http://ofertykupna.getin.pl
>
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
> --
> Serwis Aukcji Biznesowych: http://www.aukcje.getin.pl
> Maszyny i urzadzenia przemyslowe, budowlane i biurowe
> Wyprzedaze nadwyzek produkcyjnych i koncowek asortymentu
> Koszt otwarcia aukcji or

Question about forms and validation.

2002-01-23 Thread Witt, Mike (OH35)

Hi,

I have a question about the validate method on the ActionForm.  From my
understanding, 
if a validation error is found, you set up a collection of ActionErrors and
return this.  This 
causes struts to forward back to your input form, correct?  

In my situation, I populate a form for editing.  When the submit is clicked,
I validate the entry.  
When a validation error occurs, it always displays the original form data.
Is there a way to 
get it to display the form as the user edited it?  Many times a large
quantity of good data is 
lost because of one bad field.  

Thanks for your help,

Mike Witt


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: CHARACTER ENCODING !

2002-01-23 Thread Peter . Zybrick

i've tested this with german/french/spanish, should work for polish, here is
the first few lines from a jsp:


<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@page import="com.bmw.uif.*" contentType="text/html; charset=utf-8"%>






Pete Zybrick

-Original Message-
From: wojtek [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 23, 2002 3:53 PM
To: Struts Users Mailing List
Subject: Re: CHARACTER ENCODING !


Hi,

My JSP looks like that:

<%@ page contentType="text/html; charset=iso-8859-2" %>

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

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

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





I am also  setting request.setCharacterEncoding("ISO-8859-2")  in
every possible place !



Still the output from the forms is  instead of Polish chars .



Anyone have got the idea what's wrong !



regards



Wojtek



- Original Message -
From: "Martin Fekete" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 10:51 AM
Subject: Re: CHARACTER ENCODING !


> in JSP you should use page directive <%@ page contentType="text/html;
> charset=your encoding here" %>
>
> and property files must be converted to acii (f.e. using
> %JAVA_HOME%/bin/native2ascii.exe)
>
> Feky
>
> - Original Message -
> From: "Christopher Cheng" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Cc: "wojtek" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 3:10 AM
> Subject: RE: CHARACTER ENCODING !
>
>
> Same here. I am building a site using English, Traditional and Simplified
> Chinese. It is fine if I do not set the encoding to "big5" or whatever in
> JSP header, but I have to manually change the encoding in IE. What is
> strange is that if I put some chinese characters directly in the JSP,
those
> characters are displayed properly, but those from the property files are
> disrupted.
>
> Anybody can help?
>
> -Original Message-
> From: wojtek [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 1:01 AM
> To: Struts Users Mailing List
> Subject: CHARACTER ENCODING !
>
>
> Hi,
>
> I am using struts form some form validation (obvious isn't it?) and I came
> across the following error:
>
>
> National Polish characters returned from the forms are badly encoded !
>
> I am using struts on win2k, jdk 1.3, the jsp page charset is set to
> ISO-8859-2
>
> Can anyone help ?
>
> regards
>
> Wojtek
>
>
>
>
> --
> Myslisz o otworzeniu wlasnego sklepu internetowego?
> A moze o wynajeciu stoiska w wirtualnym pasazu?
> W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
> --
> Myslisz o otworzeniu wlasnego sklepu internetowego?
> A moze o wynajeciu stoiska w wirtualnym pasazu?
> W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
>

 
-- 
Meczy Cie poszukiwanie korzystnej oferty?
Jesli TAK - podaj nam czego potrzebujesz i wybierz najlepsza propozycje
Wyszukiwanie i zbieranie ofert zostaw nam. 
Bezplatne Oferty Kupna w Centrum e-biznesu http://ofertykupna.getin.pl

 

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: CHARACTER ENCODING !

2002-01-23 Thread wojtek

Hi,

My JSP looks like that:

<%@ page contentType="text/html; charset=iso-8859-2" %>

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

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

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





I am also  setting request.setCharacterEncoding("ISO-8859-2")  in
every possible place !



Still the output from the forms is  instead of Polish chars .



Anyone have got the idea what's wrong !



regards



Wojtek



- Original Message -
From: "Martin Fekete" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 10:51 AM
Subject: Re: CHARACTER ENCODING !


> in JSP you should use page directive <%@ page contentType="text/html;
> charset=your encoding here" %>
>
> and property files must be converted to acii (f.e. using
> %JAVA_HOME%/bin/native2ascii.exe)
>
> Feky
>
> - Original Message -
> From: "Christopher Cheng" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> Cc: "wojtek" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 23, 2002 3:10 AM
> Subject: RE: CHARACTER ENCODING !
>
>
> Same here. I am building a site using English, Traditional and Simplified
> Chinese. It is fine if I do not set the encoding to "big5" or whatever in
> JSP header, but I have to manually change the encoding in IE. What is
> strange is that if I put some chinese characters directly in the JSP,
those
> characters are displayed properly, but those from the property files are
> disrupted.
>
> Anybody can help?
>
> -Original Message-
> From: wojtek [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 23, 2002 1:01 AM
> To: Struts Users Mailing List
> Subject: CHARACTER ENCODING !
>
>
> Hi,
>
> I am using struts form some form validation (obvious isn't it?) and I came
> across the following error:
>
>
> National Polish characters returned from the forms are badly encoded !
>
> I am using struts on win2k, jdk 1.3, the jsp page charset is set to
> ISO-8859-2
>
> Can anyone help ?
>
> regards
>
> Wojtek
>
>
>
>
> --
> Myslisz o otworzeniu wlasnego sklepu internetowego?
> A moze o wynajeciu stoiska w wirtualnym pasazu?
> W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>
> --
> Myslisz o otworzeniu wlasnego sklepu internetowego?
> A moze o wynajeciu stoiska w wirtualnym pasazu?
> W Centrum e-biznesu mozesz miec jedno i drugie. Juz od 290 zl za rok.
> Wybierz: e-witryne lub e-sklep. http://handel.getin.pl/
>

 
-- 
Meczy Cie poszukiwanie korzystnej oferty?
Jesli TAK - podaj nam czego potrzebujesz i wybierz najlepsza propozycje
Wyszukiwanie i zbieranie ofert zostaw nam. 
Bezplatne Oferty Kupna w Centrum e-biznesu http://ofertykupna.getin.pl

 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Model Persistence Survey

2002-01-23 Thread Robert

We have a persistence framework used in conjunction with our business
object foundation called eQ!. It follows the DAO pattern, and is similar
to how JDO works, where you tell the object to save it self, but that
work is delegated to a PersistenceManager. This PM can use any kind of
persister plugged in. Obviously, SQL persisters are the most common, but
we have also just created a persister that goes to EJBs, so the client
tier can tell the object to save itself, and it will actually happen on
the EJB tier. 

Along with this we have built adapters for Struts that allow the use of
only one ActionForm and Action class (via a scripting mechanism). We
will be providing a download of this foundation (with the struts
adapters and others) very soon.

For more info, www.browsersoft.com/eQ or email me:
[EMAIL PROTECTED]

Robert McIntosh

-Original Message-
From: Struts Newsgroup [mailto:@[EMAIL PROTECTED]] 
Sent: Tuesday, January 22, 2002 5:25 PM
To: [EMAIL PROTECTED]
Subject: Model Persistence Survey

Subject: Model Persistence Survey
From: Vic Cekvenich <[EMAIL PROTECTED]>
 ===
I do not like surveys. But I would like to get a feel for "How are 
people implementing the model persistence". Sort of a popularity 
contest. Also if you did not like it, how would you do it next time.
So if you would please respond.

How do you implement model persistence to a SQL DB.

EJB (even for non-midleware needed webapps)

Expreso features

JDBC ResultSet w/ own base class

i Village /Tourge

JDBC RowSet 
(http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/a90211
/rowset.htm)

Other?
Is there another way?


Right now I like RowSet, but what is popular out there?



Currious, TIA
Vic

ps: maybe one day those "hooks" grow on Sturts, so Struts takes a stance

on a good aproach for model persistance


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Should all validation be done in the Action class instead of the ActionForm class?

2002-01-23 Thread Dick Starr

I'm new to web apps / struts and wanting know if there is any performance
reason to do initial validation in the ActionForm class (via
validate="true"). It seems to me that all validation should be done in the
Action class since then all the validation is in one section of code and
since the Action class gets called anyway. Also, I heard that there are
tools to automatically generate the ActionForm classes, which might be
another argument to not stick any additional code in them (in case you want
to re-generate them). Just wondering ...

Thanks,

Dick Starr


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: using struts and javascripts together

2002-01-23 Thread Ted Husted

Yes. The thing to remember is that by the time the JavaScript fires, the
Struts tags have been rendered as plain, ordinary HTML, so everything
works just as it would on any Web page. By the time it gets to the
browser, there are no "Struts tags", only the regular HTML tags the
browser expects.

"Chalissary, David" wrote:
> 
> hi
> 
> anyone has used javascript alongwith struts
> 
> david
> 
> -Original Message-
> From: Chalissary, David
> Sent: 23 January 2002 13:32
> To: Struts Users Mailing List
> Subject: RE: using struts and javascripts together
> 
> Hi,
> 
> I would like to know if I can use the struts tag in a
> javascript function call for example:
> 
> function submitform(aValue, aCode){
> process the java script here
> }
> 
> 
> 
>  onclick="submitForm('auditStatusDetail',' -- use the ccCode here --
> ');"/>
> 
> substitute the ccCode  in the single inverted codes : -- use the ccCode
> here --
> 
> regds,
> 
> David
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> For additional commands, e-mail: 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Java Web Development with Struts.
-- Tel +1 585 737-3463.
-- Web http://www.husted.com/struts/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: using struts and javascripts together

2002-01-23 Thread Chalissary, David

hi

anyone has used javascript alongwith struts

david

-Original Message-
From: Chalissary, David 
Sent: 23 January 2002 13:32
To: Struts Users Mailing List
Subject: RE: using struts and javascripts together


Hi,

I would like to know if I can use the struts tag in a 
javascript function call for example:

function submitform(aValue, aCode){
process the java script here
}






substitute the ccCode  in the single inverted codes : -- use the ccCode
here --

regds,

David

--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Model Persistence Survey

2002-01-23 Thread @Basebeans.com

Subject: Re: Model Persistence Survey
From: Vic Cekvenich <[EMAIL PROTECTED]>
 ===


Here is a sample DAO Extended Form Bean code :

public class NameZoomFrm extends daoFormBean {

private String fstName;
private String lstName;


public String getFstName() {   //get it from _crs RowSet
 CachedRowSet cr = getCrs();
try{   this.fstName = cr.getString("first_name");  } // try
 catch (Exception e)   {System.out.println(e);} // catch
 return (this.fstName);  }// get
public String getLstName() {  //get it from _crs RowSet
 CachedRowSet cr = getCrs();
try{  this.lstName = cr.getString("last_name");} // try
 catch (Exception e)   {System.out.println(e);} // catch
 return (this.lstName);
 }// get
  public void setFstName(String aFstName) {   //get it from _crs RowSet
CachedRowSet cr = getCrs();
try{ cr.updateString("first_name",aFstName);
this.fstName = aFstName;
} // try
catch (Exception e)   {System.out.println(e);} // catch
setCrs(cr);
} //setFst
public void setLstName(String aLstName) {   //get it from _crs RowSet
CachedRowSet cr = getCrs();
try{ cr.updateString("last_name",aLstName);
this.lstName=aLstName;
 } // try
catch (Exception e)   {System.out.println(e);} // catch
setCrs(cr);
} //setFst


public int retrieve(BigDecimal aBD) {
try{
 CachedRowSet cr = getCrs();
 cr = new CachedRowSet(); // easier then resultset
 // you must test this sql string manualy for a SQL IDE
 cr.setCommand("select * from contact where id = ?");
 // driver issues fix:
 cr.setTableName("contact");
  // to limit the number of rows coming back, we only need a page at 
a time
  cr.setBigDecimal(1,aBD);
   exec(cr);
} // try
catch (Exception e)
{ System.out.println(e);
   e.printStackTrace();} // catch
return 0;
}// retrieve

public void blank()
{  try { CachedRowSet cr = getCrs();
 cr.updateNull("first_name");
 cr.updateNull("last_name");
 cr.updateNull("id");
}  catch (Exception e)   { procE(this,e);} // catch
}// blank
}//class


Here is the DAO implementation ... using RowSet, but could use JDO, such 
as Castor.

import com.wintecinc.struts.action.ValidatorForm;
public class daoFormBean extends ValidatorForm  {


 private Connection con=null;
 private Connection upCon=null;
 private DataSource ds;
 private CachedRowSet _crs;
 private String sqlString;
 private BigDecimal PK;


 public Connection getCon() {return con;}
 public CachedRowSet getCrs() {return this._crs;}
 public void setCrs(CachedRowSet aCRS) {this._crs=aCRS;}



 public Hashtable getIterateMap() { //is there a better way? 
like use crs.getCollection?
 CachedRowSet cr = getCrs();
 int rc=cr.size();
 Hashtable iterateMap = new Hashtable();
 // count out the number of rows with dummy map
 for (int i=1; i <= rc; i++) { iterateMap.put(new 
Integer(i),new Integer(i));}
 return iterateMap;}


 public BigDecimal getPK() {  //get it from _crs RowSet
 try{  this.PK = _crs.getBigDecimal("id");} // try
 catch (Exception e)   {System.out.println(e);} // catch
 return (this.PK);
 }// get

 public void dbCon() {  // connect to db
 try{  ds = PoolMan.findDataSource("jndiSample");
 //we should in production give it a password in code 
not in file pool.xml
 con=ds.getConnection();}
 catch (Exception e)  {
 debug(this, "We did not connect");
 procE(this,e);} // catch
 }// con

 public void dbDisCon() {
 try{if (con!=null) con.close();
 ds=null;
 }
 catch (Exception e) {System.out.println(e);  }//catch
 } //disCon

 public int getRowNext() {  // get the next row
 try{
 CachedRowSet cr = getCrs();
 cr.next();
 }
 catch (Exception e)  { debug(this,"what row");
 System.out.println(e);  e.printStackTrace();} // catch
 return 0; } // rowNext()

 public long update(){
 try{
 // update should be using a different con pool 
to same db
 dbCon();
 _crs.updateRow();
 _crs.acceptChanges(getCon());
 dbDisCon();
 } catch (Exception e)  { procE(this,e);} // catch
 return 0; } // update() should return new PK

 public void setDelete() { // mark this row deleted
 CachedRowSet cr = getCrs();
 try{
  

Re: jsp templates: using expression in content files

2002-01-23 Thread Michael Mehrle

Have you tried Tiles? I'm working with it right now, and am on the cusp of
inserting dynamic tags... just an idea.

- Original Message -
From: "James Erb" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 12:11 PM
Subject: jsp templates: using expression in content files


> We're stumped folks.  I'm using struts templates as a way make UI
> development more efficient--but we have the following issue.
>
> Imagine a page like the following:
>
> <%@ page language="java"  %>
> <%@ taglib uri="/WEB-INF/struts-template.tld" prefix="template" %>
>
>
>
>
> <%! String name = "bob"; %>
>
>
> 
>
> 
> 
> Untitled
> 
>
> 
>
>
> 
>
> 
>
> 
>
>
> 
> 
>
> The problem is in the content file "gotten" by the template
> --layout.jsp--contains the expression
>
> <%= name %>
>
> We consistently get "symbol not found" compilation errors. Can it really
be
> that templates are good for the inclusion of only static content? We'd
like
> to use templates to include JSP content that contains expressions.
>
> Also, we've tried  etc.
>
> Please help..
>
>
> James Erb
> Director of Web Development
> Hotwire
> [EMAIL PROTECTED]
> 415/343-8411
> www.hotwire.com
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>
>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




jsp templates: using expression in content files

2002-01-23 Thread James Erb

We're stumped folks.  I'm using struts templates as a way make UI
development more efficient--but we have the following issue.

Imagine a page like the following: 

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




<%! String name = "bob"; %>






Untitled















We consistently get "symbol not found" compilation errors. Can it really be
that templates are good for the inclusion of only static content? We'd like
to use templates to include JSP content that contains expressions.

Also, we've tried  etc.

Please help..


James Erb
Director of Web Development
Hotwire
[EMAIL PROTECTED]
415/343-8411
www.hotwire.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




How to do an outcall but return to the session?

2002-01-23 Thread Reid Pinchback


Hi all,

I need to integrate an external web-based service with a 
Struts-based app.  The chain of events are:

1. client invokes URL on my app within their current session.

2. My action class gets hit.  Sometimes it would immediately
forward to a JSP, but sometimes it must first bounce the user 
to the external service before doing the forwarding.

3. When I forward the user to the external service it is by
doing a redirect, and I tell the external service where to send
the user back to by tacking on an appropriately-formatted 
query parameter containing the return URL.  When the
user submits whatever is required by that service, the
service sends them to that URL (i.e. back where they 
came from).

4. When the user gets back, they need to be in the same
http session they were in before being bounced to the
external service.  Lots of stuff is bound to their session,
and it would be a bad thing to have lost that context data.

How do I do this in Struts?  In particular, if I'm in an Action class
and constructing an ActionForward object to toss the user to
the external service, how do I make sure the session is preserved?
Does that happen automatically via cookie magic, or do I need
to extract a session id from somewhere and tack it on to the
URL for the return?  If the latter, how specifically do I do that?

Thanks!

  Reid

 



-
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.


RE: Model Persistence Survey

2002-01-23 Thread Keith Chew

Hi

FYI, Data Access Objects (DAOs) is not a persistence mechansim, it's a
design pattern used to encapsulate the mechanism.  The mechanism itself can
be JDBC (in the example you have given), Castor JDO, Sun JDO, or any other
O/R mapping tools' API.

Keith

-Original Message-
From: Francisco Hernandez [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 24 January 2002 8:23 a.m.
To: Struts Users Mailing List
Subject: Re: Model Persistence Survey


DAOs are another way to do it, but using a framework is much better imo

http://java.sun.com/blueprints/code/jps13/src/com/sun/j2ee/blueprints/catalo
g/dao/CatalogDAOImpl.java.html


- Original Message -
From: "Christopher Barham" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 1:51 AM
Subject: Re: Model Persistence Survey


>
> Hi,
> I really think that Java Data Objects has a big future... see JSR012:
> http://www.jcp.org/aboutJava/communityprocess/first/jsr012/index.html
> Currently we are evaluating Forte Transparent Persistence, which is a
> physical incarnation of Java Data Objects - see
> http://java.sun.com/products/jdbc/related.html and
> http://access1.sun.com/jdo/
> The Forte stuff (Transparent Persistence) is detailed here:
> http://www.sun.com/forte/ffj/resources/articles/jdo.html
>
> So far it is working very well - Although I have some qualms about byte
> code enhancement as the mechanism to get the TP activity into your
classes.
> If nothing else, it gives you an 'unknown area' to worry about in your
code
> - For every simple code bug so far we have immediately assumed it is to do
> with the 'magic' of TP messing something up - however, in every case, (so
> far), it has been a simple non-TP coding error that was the root cause -
it
> just took longer to track down :-)
>
> For quick and easy database adhoc code, I have also taken to using
TableGen
> now and then to ease generation of the JDBC aware base classes  - it gives
> connection pooling and so on  It's fairly old, but works nicely with a
> minimum of fuss.  The only slight problem was that with Oracle you need to
> explicitly close the Statement in the disconnect method of the generated
> class DatabaseAccess - it took a bit of head scratching to work out where
> the dreaded "too many open cursors" error was coming from :-(
> http://freespace.virgin.net/joe.carter/TableGen/
>
> Regards
>
> Chris
>
>
>
>
>
>
>
> Struts
> NewsgroupTo:
[EMAIL PROTECTED]
> (@Basebeans.ccc:
> om) 
> 22/01/02
> 23:55
> Please
> respond to
> "Struts Users
> Mailing List"
>
>
>
>
>
>
> Subject: Re: Model Persistence Survey
> From: Vic Cekvenich <[EMAIL PROTECTED]>
>  ===
> Oh, yeah, Castor gets votes.
>
> Vic Cekvenich wrote:
>
> > I do not like surveys. But I would like to get a feel for "How are
> > people implementing the model persistence". Sort of a popularity
> > contest. Also if you did not like it, how would you do it next time.
> > So if you would please respond.
> >
> > How do you implement model persistence to a SQL DB.
> >
> > EJB (even for non-midleware needed webapps)
> >
> > Expreso features
> >
> > JDBC ResultSet w/ own base class
> >
> > i Village /Tourge
> >
> > JDBC RowSet
> > (
>
http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/a90211/rows
et.htm
> )
> >
> >
> > Other?
> > Is there another way?
> >
> >
> > Right now I like RowSet, but what is popular out there?
> >
> >
> >
> > Currious, TIA
> > Vic
> >
> > ps: maybe one day those "hooks" grow on Sturts, so Struts takes a stance
> > on a good aproach for model persistance
> >
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
>
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to specify scope of bean for html:options tag.

2002-01-23 Thread Alex Colic

Thanks for the help.

Luckily the search method is the way I need it.

Alex

-Original Message-
From: Arnaud Buisine [mailto:[EMAIL PROTECTED]]
Sent: January 23, 2002 10:56 AM
To: Struts Users Mailing List
Subject: RE: How to specify scope of bean for html:options tag.


Tell me if I'm wrong, but it seems to me that the findAttribute(String)
method from class javax.servlet.jsp.PageContext is used by Struts tags.

This method "searches for the named attribute in page, request, session (if
valid), and application scope(s) in order and returns the value associated
or null" (cf. J2EE API Documentation).

Hope it helps.


> -Message d'origine-
> De : Stephen Owens [mailto:[EMAIL PROTECTED]]
> Envoyé : mercredi 23 janvier 2002 16:44
> À : Struts Users Mailing List
> Objet : RE: How to specify scope of bean for html:options tag.
>
>
> Alex,
>
> I believe there is a defined search order used to find the beans, and I
> think by default it would do what you want. So you may have to do
> exactly nothing to have this work the way you want.
>
> regards,
>
> Stephen Owens
> Corner Software
>
> > -Original Message-
> > From: Alex Colic [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 23, 2002 10:44 AM
> > To: Struts
> > Subject: How to specify scope of bean for html:options tag.
> >
> >
> > Hi,
> >
> > I have two beans in request and session scope under the same
> > name. I have to
> > create a drop down using the html:options tag. If the bean
> > under the request
> > scope is found then I want to use that one for the options
> > tag, if it is not
> > then I want to use the one under the session tag. I can't
> > seem to find a way
> > to differentiate the two bean via the options tag.
> >
> > Any help is appreciated.
> >
> > Alex
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Using a tag to compare two beans

2002-01-23 Thread Afshartous, Nick


Hi,

I'm trying to perform an equal test on two String values
accessed via two beans.  So I'd like to do something like:

  
   Yes, the two are equal
  

but it seems that only literal String values may be specified by
the 'value' attribute.  Does anyone have any suggestions on this ?
Thanks.  
__

 Nick 

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to specify scope of bean for html:options tag.

2002-01-23 Thread Alex Colic

Thanks for the help.

Luckily the search method is the way I need it.

Alex

-Original Message-
From: Arnaud Buisine [mailto:[EMAIL PROTECTED]]
Sent: January 23, 2002 10:56 AM
To: Struts Users Mailing List
Subject: RE: How to specify scope of bean for html:options tag.


Tell me if I'm wrong, but it seems to me that the findAttribute(String)
method from class javax.servlet.jsp.PageContext is used by Struts tags.

This method "searches for the named attribute in page, request, session (if
valid), and application scope(s) in order and returns the value associated
or null" (cf. J2EE API Documentation).

Hope it helps.


> -Message d'origine-
> De : Stephen Owens [mailto:[EMAIL PROTECTED]]
> Envoyé : mercredi 23 janvier 2002 16:44
> À : Struts Users Mailing List
> Objet : RE: How to specify scope of bean for html:options tag.
>
>
> Alex,
>
> I believe there is a defined search order used to find the beans, and I
> think by default it would do what you want. So you may have to do
> exactly nothing to have this work the way you want.
>
> regards,
>
> Stephen Owens
> Corner Software
>
> > -Original Message-
> > From: Alex Colic [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, January 23, 2002 10:44 AM
> > To: Struts
> > Subject: How to specify scope of bean for html:options tag.
> >
> >
> > Hi,
> >
> > I have two beans in request and session scope under the same
> > name. I have to
> > create a drop down using the html:options tag. If the bean
> > under the request
> > scope is found then I want to use that one for the options
> > tag, if it is not
> > then I want to use the one under the session tag. I can't
> > seem to find a way
> > to differentiate the two bean via the options tag.
> >
> > Any help is appreciated.
> >
> > Alex
> >
> >
> > --
> > To unsubscribe, e-mail:
> > 
> > For additional commands, e-mail:
> > 
> >
> >
>
> --
> To unsubscribe, e-mail:

For additional commands, e-mail:





--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Model Persistence Survey

2002-01-23 Thread Francisco Hernandez

DAOs are another way to do it, but using a framework is much better imo

http://java.sun.com/blueprints/code/jps13/src/com/sun/j2ee/blueprints/catalo
g/dao/CatalogDAOImpl.java.html


- Original Message -
From: "Christopher Barham" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, January 23, 2002 1:51 AM
Subject: Re: Model Persistence Survey


>
> Hi,
> I really think that Java Data Objects has a big future... see JSR012:
> http://www.jcp.org/aboutJava/communityprocess/first/jsr012/index.html
> Currently we are evaluating Forte Transparent Persistence, which is a
> physical incarnation of Java Data Objects - see
> http://java.sun.com/products/jdbc/related.html and
> http://access1.sun.com/jdo/
> The Forte stuff (Transparent Persistence) is detailed here:
> http://www.sun.com/forte/ffj/resources/articles/jdo.html
>
> So far it is working very well - Although I have some qualms about byte
> code enhancement as the mechanism to get the TP activity into your
classes.
> If nothing else, it gives you an 'unknown area' to worry about in your
code
> - For every simple code bug so far we have immediately assumed it is to do
> with the 'magic' of TP messing something up - however, in every case, (so
> far), it has been a simple non-TP coding error that was the root cause -
it
> just took longer to track down :-)
>
> For quick and easy database adhoc code, I have also taken to using
TableGen
> now and then to ease generation of the JDBC aware base classes  - it gives
> connection pooling and so on  It's fairly old, but works nicely with a
> minimum of fuss.  The only slight problem was that with Oracle you need to
> explicitly close the Statement in the disconnect method of the generated
> class DatabaseAccess - it took a bit of head scratching to work out where
> the dreaded "too many open cursors" error was coming from :-(
> http://freespace.virgin.net/joe.carter/TableGen/
>
> Regards
>
> Chris
>
>
>
>
>
>
>
> Struts
> NewsgroupTo:
[EMAIL PROTECTED]
> (@Basebeans.ccc:
> om) 
> 22/01/02
> 23:55
> Please
> respond to
> "Struts Users
> Mailing List"
>
>
>
>
>
>
> Subject: Re: Model Persistence Survey
> From: Vic Cekvenich <[EMAIL PROTECTED]>
>  ===
> Oh, yeah, Castor gets votes.
>
> Vic Cekvenich wrote:
>
> > I do not like surveys. But I would like to get a feel for "How are
> > people implementing the model persistence". Sort of a popularity
> > contest. Also if you did not like it, how would you do it next time.
> > So if you would please respond.
> >
> > How do you implement model persistence to a SQL DB.
> >
> > EJB (even for non-midleware needed webapps)
> >
> > Expreso features
> >
> > JDBC ResultSet w/ own base class
> >
> > i Village /Tourge
> >
> > JDBC RowSet
> > (
>
http://download-west.oracle.com/otndoc/oracle9i/901_doc/java.901/a90211/rows
et.htm
> )
> >
> >
> > Other?
> > Is there another way?
> >
> >
> > Right now I like RowSet, but what is popular out there?
> >
> >
> >
> > Currious, TIA
> > Vic
> >
> > ps: maybe one day those "hooks" grow on Sturts, so Struts takes a stance
> > on a good aproach for model persistance
> >
>
>
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
>
>
>
>
>
> --
> To unsubscribe, e-mail:

> For additional commands, e-mail:

>


--
To unsubscribe, e-mail:   
For additional commands, e-mail: