Re: Properties in ActionForms

2001-01-11 Thread Ted Husted

I wonder if any of you have implemented an automatic way of populating
the properties in the ActionForm? 

Doing more with "auto beans" is being discussed for the 1.1 timefreame.
Meanwhile, the latest builds support the next best thing: You can
define generic data beans for your business logic data, and then make
these instance variables on your action forms. The HTML form tags now
support a nested syntax like this:
  
  html:text property="mailingAddress.street"/
  
and the appropriate processing will be applied to get the street
address (for initial display) and set the street address (when the form
is processed).

Of course, you still have to define the accessor and mutators for your
generic data beans, but it's a step in the right direction!

*** REPLY SEPARATOR  ***

On 1/11/2001 at 9:39 AM Roger Kjensrud wrote:

Hello,

I wonder if any of you have implemented an automatic way of populating
the
properties in the ActionForm? It's kind of tedious to write all these
setter
and getter methods

I found an
article(http://www.javaworld.com/javaworld/jw-12-2000/jw-1201-struts.htm
l)
describing one way of doing this, and I would be interested in hearing
some
feedback on doing it that way.

Thanks,
Roger Kjensrud






Re: Any way to dynamically change flow-of-control?

2001-01-11 Thread Ted Husted

"Felciano, Ramon" wrote:
 - Confirm pages ("Are you sure that ?" with "Continue" and
"Cancel"
 buttons)
 - Pick lists ("We couldn't find the product ID you entered; please
select
 from the following list")
 - Alert pages for (possibly unexpected) server-side events that
occured
 since the last client-server traffic passed through.

Just a wild idea here: 

An action is not required to forward to a path or action, but has
everything it needs to answer the request itself (and return a null
action forwarding).

So how about if the action wrote pages like this dynamically, the
old-fashioned servlet way, perhaps using a standard "message box" type
library? 

The responses in the dynamic page could then be set to forward to
whatever actions or paths were appropriate to the circumstances,
without having to write a physical JSP for every conceivable
combination.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/





Re: Sorry that was ErrorTag.java

2001-01-11 Thread Ted Husted

The build for 11-JAN failed due to an error in one of the XML files
(mea culpa). 

*** REPLY SEPARATOR  ***

On 1/11/2001 at 2:03 PM [EMAIL PROTECTED] wrote:

The date stamp on the file is 01/02/01 and is from the Windows source.
I also got the build from jakarta-struts-src-20010111.zip 

It looks like from the previous binary build that this file no longer
exists.
Was this documented somewhere?

Also, the binary from jakarta-struts-20010111.zip  looks pretty small
267k
!

Lou Farho
Sr. Engineer
Level (3) Communications, Inc.
720-888-7751






Re: Documentation in nightly source distribution.

2001-01-11 Thread Ted Husted

Running 

build dist

or 

./build.sh dist

from the folder where you unpacked it should do it, if all the
prerequesites are installed.

See  http://jakarta.apache.org/struts/installation.html#Building 

*** REPLY SEPARATOR  ***

On 1/11/2001 at 2:41 PM Walter Holladay wrote:

There is a src/doc dir which contains the documentation in xml format.
Is
there an easy way to generate html from these xml files?






Pull MVC

2001-01-12 Thread Ted Husted

So, for discussion purposes, enter 
http://java.apache.org/turbine/pullmodel.html 

Specifically:

So, beginning with Scarab, we are going to try another model which I
will describe as the "Pull MVC Model". What this entails is the ability
to create an object that is able to "pull" the required information out
at execution time within the template. Thus, it becomes the job of the
template designer to understand the API of objects available to him/her
to take advantage of. 

Instead of the developer telling the designer what Context names to
use for each and every screen, there is instead a set of a few objects
available for the template designer to pick and choose from. These
objects will provide methods to access the underlying information
either from the database or from the previously submitted form
information. 

Let's now think of the "API" as a business logic bean on your Action
Form. Or a small number of coherent business logic beans that might be
reasonably present on a given ActionForm. 

Then to access a given property, using the 10-JAN+ nested-property
syntax, a HTML form designer might refer to apiModule1.thisProperty or
apiModule2.thatProperty

Now some of these "API beans" might be unique to a user
(userPreferences.name), and others might be application-wide
(actionMapping.login), and some might be relative to a given page-view,
but to the page designer, they would all have a common "address space",
that can be easily documented and understood. 

Of course, many of the API-bean methods could also be encapsulated in
custom tags, to make things even easier on the page designer. But it
might be helpful to have everything in a central place first, and
optimize/customize from there. 

If developed in concert with a "conventional" application, it might
also be possible for the API-beans to use a common interface and
nomenclature, and share a great deal of code, with a traditional UI.
(Since, of course, the business-logic API beans themselves should not
depend on the Struts framework.)

And, finally, to quote our Turbine friends, once again:

 I hope that this makes sense to everyone. I'm sure that some of you
are probably saying "well, duh!." However, this is really not the model
that has been encouraged so far within Turbine nor within other
products such as XMLC (which actually operates *only* on the Push
model), so I believe that it is somewhat uncharted territory for some
people. The only products that I can think of right now that encourage
this is JSP taglibs and Tea, however, I still feel as though they have
missed the boat on this in one way or another. 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/





Re: User Guide Code Formatting

2001-01-12 Thread Ted Husted


In the Tag Developer's Guide, I ending up formatting "paragraphs" as a
single line, and then inserting br's 

*** REPLY SEPARATOR  ***

On 1/12/2001 at 8:43 AM Hines, Bill wrote:

Just FYI, I know this is low priority, but some of the code sections in
the
1.0 user guide are pushed way off to the right and hence do not print
properly (chopped off). An example is in section 4.5.3 Configure the
Struts
Tag Library

Bill Hines 
Computer Systems Specialist 
Sun Certified Java Programmer 
Hershey Foods Corp 
http://www.hersheys.com






Re: i18n

2001-01-16 Thread Ted Husted

I believe there's a gotcha where the default locale is set according to
the server's default, rather than the user's browser settings.

Here's an example of adding a drop-down box to select a language


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

and another i18n example


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


*** REPLY SEPARATOR  ***

On 1/16/2001 at 4:41 PM éric spérano wrote:

Hello everyone,

i'm a new struts user and i have a question about i18n.

i did two properties files, let's say:

com.myproject.ApplicationResources.properties(english)
com.myproject.ApplicationResources_fr.properties(french)

in my web.xml, i set the init-param "application" to
"com.myproject.ApplicationResources"

i load my servlet and the log says it has load my ResourceBundle
successfully.

but now, how can i associate a specific language to a HttpSession??

as an example, i used the logon.jsp shipped with the struts example..

i set my browser (ie 5) to select French as my "favorite" language, but

when i access the logon.jsp, it's always the english message that are
printed..
i added a print out out request.getLocale() in my jsp and it prints the

good locale, so my browser config is correct.

can someone please indicate me what is missing/wrong?


thanks a lot! and keep up the good work.



eric sperano
modesys informatique






Re: options-Tag

2001-01-16 Thread Ted Husted



The simplest thing is to use the LabelValueBean class provided by the 
example. 

In your Action, a database query(or equivalent) would create a 
collection of LabelValueBeans, and then insert the collection into the request 
context. 

First, the database query executes a query and returns the rowset as an 
instance variable named list.. 

Then you can transfer the rowset to a collection (e.g. ArrayList)
 public ArrayList fetchList() throws SQLException 
{ if (result==null) { return (null); 
} else { String 
defaultValue = "1980"; // FIXME - YEAR String 
defaultLabel = "ALL"; // FIXME ArrayList list 
= new ArrayList(); list.add(new 
LabelValueBean(defaultLabel,defaultValue)); // Defaults at top of the 
list while (result.next()) 
{ String year = 
result.getString(1); list.add(new 
LabelValueBean(year, year)); 
} return(list); }

And, 

request.setAttribute("salesYears",salesYearsList);

There is a working example of this using a DISTINCT query in "Struts with a 
Fruit Glaze", foundat http://husted.com/about/struts

I haven't tried it, but I think the part about "only property" refers to 
whether the label (in the drop down) use the same or different labels.
*** REPLY SEPARATOR 
***On 1/15/2001 at 11:28 PM Johann Dorn wrote: 
Hello,

I have some problems with the options tag, which I 
want to use in conjunction with my ActionForm.


In the example application the collectionis 
filled directly in the subscription.jsp
%-- In real life, these would be loaded from a 
database --%% java.util.ArrayList list = new 
java.util.ArrayList(); list.add(new 
org.apache.struts.example.LabelValueBean("IMAP Protocol", "imap")); 
list.add(new org.apache.struts.example.LabelValueBean("POP3 Protocol", 
"pop3")); pageContext.setAttribute("serverTypes", 
list);%





According to the Documentation the options-Tag can 
be used in a different way:
- The 
ActionForm bean cancontain the 
collection,

- Only property is specified 
- The value of this attribute is the name of a property of the ActionForm bean 
associated with our form, which will return the collection.


But I alwas get expceptions like
'javax.servlet.ServletException: Cannot create iterator for 
PersForm@dafb2f4a'


Can anyone give me an example or some hints how the options-Tag must be 
used in conjunction with the ActionForm?


Best Regards
Johann Dorn







Re: options-Tag

2001-01-17 Thread Ted Husted



On 1/15/2001 at 11:28 PM Johann Dorn wrote: 

 Can anyone give me an example or some hints how the options-Tag must 
be used in conjunction with the ActionForm?

Sorry, got distracted, and I never actually did that. 

So, starting with a working example of an ArrayList "options" bean in 
request scope, I setup a ArrayList property on the form, with the usual 
protected variable and standard getter/setter. 

[ActionForm] protected ArrayList salesYearsList = null; 
public ArrayList getSalesYearsList() { return 
(salesYearsList); } public void setSalesYearsList(ArrayList 
salesYearsList) { this.salesYearsList = 
salesYearsList; }

[Action] 
salesForm.setSalesYearsList(salesYearsList);  if 
(salesYearsList != null) request.setAttribute("salesYears",salesYearsList); // 
still works

But I couldn't come up with a set of parameters that will work, or see 
how this is supported from the source code (but then, I'm a little dim 
;-).

Anyway, starting with the working bean version,

form:select property="year"form:options 
collection="salesYears" property="value" 
labelProperty="label"//form:select
here's what I tried

form:select property="year"form:options 
property="salesYearsList"//form:select// Servlet exception, 
ClassCast exception

form:select property="year"form:options 
property="salesYearsList.value"//form:select//No getter 
method available for property salesYearsList.value for bean under name 
null

form:select property="year"form:options 
property="salesYearsList" labelName="value" 
labelProperty="label"//form:select// Cannot find bean under 
name value

form:select property="year"form:options 
property="salesYearsList" name="value" 
labelProperty="label"//form:select// Cannot find bean under 
name value

form:select property="year"form:options 
property="salesYearsList" name="value"//form:select// Cannot 
find bean under name value

form:select property="year"form:options 
property="salesYearsList" 
labelProperty="label"//form:select// No getter method 
available for property label for bean under name null




Re: Off-topic? How to embed hyperlink in db-stored text?

2001-01-17 Thread Ted Husted

On 1/17/2001 at 1:42 AM Nathan Eric Probst wrote:
 One of the challenges that I have not yet solved is how to insert a
hyperlink into a text paragraph while editing (via a web interface),
without simply writing the whole tag in a static manner.

An approach used by BBS's and Wikis to use some type of simplified,
pidgin HTML to represent "safe" constructs. 

For example  http://public.wxxi.org/ubb/ubbcode.html 

I took quick look at what the Jive BBS gang was up to, but it didn't
seem like they were using attributes (at least yet).

 http://www.coolservlets.com/jive/ 

For quick and easy dynamic links, Wikis usually have a way to quick
refer to another page in the same context, or sometimes highlight
references automatically. 

One full featured Wiki is 

 http://kehei.com/kehei/doc/WikiWikiWeb.html 



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/





Re: trade-off

2001-01-17 Thread Ted Husted

The template tags in the Struts library seem a bit pokey, but there's a
lot going on there (reads one file, then merges from another). I don't
think alot of applications actually use these tags much. 

I believe that any JSP is suppose to compile down to a single servlet
class file. The custom tags are just alternate ways to call
subroutines. 

If you check your work directory, you'll see that a number of automatic
Java files might be generated for a given JSP, but they resolve to a
single class.

Struts is also fine with distributing precompiled JSPs, which can
eliminate the cycles it takes the container to check to see if the JSP
needs to be recompiled.

*** REPLY SEPARATOR  ***

On 1/17/2001 at 9:43 AM John Hunt wrote:

Hi
What do you think is the over-head in using struts
tags in terms of performance? ( all tags in general )
And let us say we use a template for a page which has
a header, a side bar, a footer, a content. Each of
this gets commpiled into a class and thus a single
page is converted into a set of classes ( r these a
set of servlets )? Doesnt it slowdown when compared to
a single servlet just outputting the stuff???
Thanks
Hunt

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/






RE: trade-off

2001-01-17 Thread Ted Husted

They are used in the Template Example application, if you want to see a
set in action.

Another templating approach is Components Library for building JSP
views by Cedric Dumoulin at  http://gauss.ficsgrp.com/cdm/index.html
.

*** REPLY SEPARATOR  ***

On 1/17/2001 at 3:06 PM Deadman, Hal wrote:

I know the pages that use template tags are slow the first time you hit
them
because there are normally several jsps that need to get compiled.
After
that I would think it would be the same performance-wise as a jsp that
does
lots of jsp:includes. Has anyone tried to use struts-templates in
production? I am starting to use them for a bench project in order to
guage
their value so I can't really speak to their performance.






Re: WOBOT unsubscription requests....

2001-01-17 Thread Ted Husted

Noticed the same. Even tried unsubscribing and subscribing again to see
if there was a bug in the instructions, but I didn't see anything.

*** REPLY SEPARATOR  ***

On 1/17/2001 at 12:57 PM Mike Campbell wrote:

 "IH" == Irene Hernandez [EMAIL PROTECTED] writes:

IH unsuscribe


Is it just me, or has anyone else noticed an large number of
unsubscription requests lately, all misspelled in exactly the same
manner?






Re: HASHTABLE - NEED HELP URGENT

2001-01-18 Thread Ted Husted

Using the 1.0 iterate tag (never used 0.5 or enumerate myself), you
would print the elements of a Hashtable like this:

  %@ page language="java" %
  %@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %
  %@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %

%
java.util.Hashtable list = new
java.util.Hashtable();
list.put("1","First");
list.put("2","Second");
list.put("3","Third");
list.put("4","Fourth");
list.put("5","Fifth");
pageContext.setAttribute("list", list,
PageContext.PAGE_SCOPE);
   %
   htmlbodyp
   logic:iterate id="myCollectionElement" name="list"
Element Value: bean:write name="myCollectionElement"
/br /
   /logic:iterate
   /p/body/html

If you want them on the same line, take out the br.

If you wanted to print the values and key seperately, that would be
trickier, since Hashtable does not provide a property method that
exposes just the key. 

In the above example, since an actual property is not specified,
bean:write just calls toString, and prints that.

To get the key or value, you probably need to subclass Hashtable and
provide your own property that did something roughly like 

public object getKey() {
  get(object key);
  return(key);
}

Then you could do something like 

logic:iterate id="myCollectionElement" name="list"
 Key Value: bean:write  name="myCollectionElement"
property="key"
/logic:interate

Of course, to get just the value, there would have to be a property for
that too.

HTH.

-Ted.

*** REPLY SEPARATOR  ***

On 1/17/2001 at 11:17 AM [EMAIL PROTECTED] wrote:

Hi,

I am using Struts 0.5.

I have a bean called dispProductsBean which has a hashtable called
"products".

How do I get the contents of the hashtable in my jsp page using
enumerate
tag.

Here is my jsp:
%@ page language="java" %
%@ page session="true" import="java.util.*" %
%@ taglib uri="/WEB-INF/struts.tld" prefix="struts" %


%@page contentType="text/html"%

html
headtitlestruts:message key="product.title"//title/head
body

h3struts:message key="product.pageHeading"//h3

struts:form name="dispProductsBean"
type="com.ixl.hmem.dispProductsBean"

div align="center"
h3struts:message key="product.listTitle"//h3
/div
struts:property property="size" /
/struts:form


/body
/html
Please help


Sharmila Pandith
Software Engineer
iXL Inc.

phone: 212-500-5180
AIM: spandith
Yahoo: spandith
MSN: spandith

This message is intended only for the use of the Addressee and may
contain
information that is PRIVILEGED and CONFIDENTIAL. If you are not the
intended
recipient, dissemination of this communication is prohibited. If you
have
received this communication in error, please erase all copies of the
message
and its attachments and notify us immediately.






Re: Need some help please

2001-01-19 Thread Ted Husted

On 1/19/2001 at 12:52 PM [EMAIL PROTECTED] wrote:
 How do I set the value of the radio button to the value of the
struts:htmlProperty name="product" property="productID"/

Using the current builds, you would do something like this (taken from
the example application). 

Build a bean to hold the collection of radio button options. Store it
in the request context.

%-- In real life, these would be loaded from a database --%
%
  java.util.ArrayList list = new java.util.ArrayList();
  list.add(new org.apache.struts.example.LabelValueBean("IMAP
Protocol", "imap"));
  list.add(new org.apache.struts.example.LabelValueBean("POP3
Protocol", "pop3"));
  pageContext.setAttribute("serverTypes", list);
%


Reference the bean in the options tag.

  html:select property="subscription.type"
html:options collection="serverTypes" property="value"
   labelProperty="label"/
  /html:select

In your case, I think it might be

  html:select property="dispProductsBean"
html:options collection="property" property="productID"/
  /html:select


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Looking for Struts Tutorial

2001-01-22 Thread Ted Husted

As mentioned, Bluestone offers a tutorial, which is listed on the
resources page. 

There is also a "tour" of the example application, which will hopefully
be a proper tutorial one day. 

If you install the example application, there should be a "small print"
link to the tour at the bottom of the index page. 

*** REPLY SEPARATOR  ***

On 1/21/2001 at 10:53 PM Peter Kellner wrote:

I'm new to struts and want to run through a tutorial/example.
I've read the users guide, but can't find the tutorial, though
I keep seeing mentions to it.  Any pointers to the tutorial
would be appreciated.



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: JDBC Connection Pooling

2001-01-23 Thread Ted Husted

You can access the pool this way:

 GenericDataSource ds = (GenericDataSource)
servlet.findDataSource(null);

which I clipped from a working Action.perform method.

-Ted.

*** REPLY SEPARATOR  ***

On 1/23/2001 at 10:04 AM Lind Jrgen wrote:

Hi there,

I'm currently trying to use the connection pool that comes with
Struts but I have a problem with the data-sources spec in the
Struts config file. The Bean simply doesn't show up in the
servlet context (neither the default value nor my own key). When
establishing the the connection pool by hand everything works fine.
But when I try to access it in my initialization servelt (which is
a subclass of the ActionServelt) via the config spec it don't.
Any ideas what I may be missing?

Regards

Jrgen



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: logic:iterate and form controls, revisited

2001-01-24 Thread Ted Husted

On 1/24/2001 at 10:30 AM Craig R. McClanahan wrote:
 We're down to bugfixes and documentation updates, so far as I can
tell.

A major item the documentation TODO list is platform-specific
installation notes. 

If anyone who is using Struts on other platforms, like Weblogic, Resin,
and so forth, is welcome to submit an addition to the install document. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: new template tag framework

2001-01-25 Thread Ted Husted

On 1/25/2001 at 11:42 AM Craig R. McClanahan wrote:
 It certainly won't be added to 1.0 at this point.  For 1.1, I'm
certainly open to cool additions, and will be looking at this one
closely.

The coolest addition would be one that actually leveraged the Struts
framework, the way some of the custom tags do. 

The current template library is generic, and any other could be easily
used in its place. (Which is the beauty Struts. It is firmly based on
standards, so it is easy to plug-in whatever other standard library you
may need to use!)


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: problems with the logic:iterate tag

2001-01-26 Thread Ted Husted

Could you submit your example as an attachment? In my mail reader at
least, some of the control characters were converted to ASCII, and it
is difficult to read. 

*** REPLY SEPARATOR  ***

On 1/26/2001 at 10:45 AM Florian Zwerina wrote:

Hi !

I have a problem with the logic:iterate  tag

the following piece of 'code' works ok=20
(so I know I=B4m doing nothing wrong on the Controller/Model side):

jsp:useBean id=3D"item" scope=3D"page" class=3D"com.mycomp.SomeData"/

table
%=09
Iterator it =3D
((Collection)session.getAttribute("someList")).iterator();
while (it.hasNext()){
pageContext.setAttribute("item",it.next());
%
  tr
td align=3D"left"
  bean:write name=3D"item" property=3D"name"/
/td
td align=3D"left"
  bean:write name=3D"item" property=3D"manager"/
/td
td align=3D"left"
  bean:write name=3D"item" property=3D"ID"/
/td
  /tr
% }  %
/table

but what I really like to do is
(our web designer would appreciate it !):

jsp:useBean id=3D"item" scope=3D"page" class=3D"com.mycomp.SomeData"/

table
logic:iterate id=3D"item" name=3D"someList"
  tr
td align=3D"left"
  bean:write name=3D"item" property=3D"name"/
/td
td align=3D"left"
  bean:write name=3D"item" property=3D"manager"/
/td
  /tr
/logic:iterate

but with the second approach the table is always empty...

am I too stupid to use the iterate tag ?
or is something else wrong with my approach ?


pleas help !


Regards

flo



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: FormAction scope

2001-01-26 Thread Ted Husted

You may wish to consider using another bean within the FormAction to
accomplish your goal. 

Just a suggestion. Your mileage will vary.

*** REPLY SEPARATOR  ***

On 1/26/2001 at 12:59 PM Zhiyong Li wrote:

I understand that the default scope of the "FormAction" bean is
"session", which means that only one "FormAction" bean instance will be
created for each session. Is there a way to specify the scope of the
"FormAction" to be "request"? We probably can do this with Struts's
form
tag. But that is not what I want. In my case, this "FormAction" bean
may
be invoked from a href in addition to the forms. 

Thx,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Who is Craig ?

2001-01-27 Thread Ted Husted

And, speak at various conferences, including ApacheCon and JavaOne.  

Don't imagine there's streaming media of that anyplace?

-T.




Re: Fruit Glaze Example

2001-01-27 Thread Ted Husted

Working on it now. If I don't get it back up tonight, it should be
there early tomorrow.

*** REPLY SEPARATOR  ***

On 1/27/2001 at 3:40 PM Vilavanh Messien wrote:

Hi !

I'm interested in getting the Fruit Glaze Example.
Unfortunately, it is not available anymore on Ted's website.
Is there anyone who could send me the zip file of this example ? (maybe
Ted
... :-) )

Thanks in advance.

Vilavanh Messien

-Message d'origine-
De : Ted Husted [mailto:[EMAIL PROTECTED]]
Envoy : 27 janvier, 2001 15:22
 : Struts List
Objet : Re: Who is Craig ?


And, speak at various conferences, including ApacheCon and JavaOne.

Don't imagine there's streaming media of that anyplace?

-T.



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Nested Collection with Options Tag

2001-01-27 Thread Ted Husted

This works just peachy: 

bean:define id="salesYearsList" name="fruitSalesForm"
property="salesYearsList" /
html:form action="fruitSales.do"
html:select property="year"
html:options collection="salesYearsList" property="value"
labelProperty="label"/
/html:select

Where salesYearsList is an ArrayList of LabelValueBeans (from the
trusty Example application).

The documentation  (damn, someone's reading it again ;-) for options
mentions

"Only property is specified - The value of this attribute is the name
of a property of the ActionForm bean associated with our form, which
will return the collection"

Since my collection of LabelValueBeans is a property of the ActionForm
bean, I gave this a whirl, but 

html:options property="salesYearsList" labelProperty="label"/

complained 

"javax.servlet.jsp.JspException: No getter method available for
property label for bean under name null"
   
and 

html:options property="salesYearsList" /

brought 

java.lang.ClassCastException
at
org.apache.struts.taglib.html.OptionsTag.doEndTag(OptionsTag.java,
Compiled Code)
at
_jsp._husted_22dcoreservlets_22djdbc._fruitSales__jsp._jspService(_fruit
Sales__jsp.java, Compiled Code)
   
Is there a way to get html:options to use my LabelValueBeans directly?

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Fruit Glaze Example

2001-01-27 Thread Ted Husted

OK, it's back now, and better than ever! 

 http://husted.com/about/struts/ 

*** REPLY SEPARATOR  ***

On 1/27/2001 at 3:40 PM Vilavanh Messien wrote:

Hi !

I'm interested in getting the Fruit Glaze Example.
Unfortunately, it is not available anymore on Ted's website.
Is there anyone who could send me the zip file of this example ? (maybe
Ted
... :-) )

Thanks in advance.

Vilavanh Messien

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Struts installation notes

2001-01-28 Thread Ted Husted

Threads like these are usually posted on the Developer's list, but
since this definately something anyone using Struts could help with,
I'm cross-posting it here.

Following are updated installation notes that Martin Coper and Colin
Sampaleanu have contributed for installing Struts under Resin
stand-alone. Adding these types of notes for other platforms is one of
the remaining documentation challenges for the 1.0 release. 

Right now, we have notes for Tomcat 3.x, Orion, and (now) Resin. If
anyone can submit something in this format for their own platform, it
would be very much appreciated. Ideally, someone else using that
platform should volunteer to test any new notes (preferablly starting
with a clean install), and confirm that everything works "as
advertised".

We'll also be moving these notes from the install text file, and
merging it with the installation.html so that everything is together.

RESIN STAND-ALONE
-

* In the steps below, $RESIN_HOME refers to the directory in which you
  have installed Resin, and $STRUTS_HOME is the directory in which you
  unpacked the Struts binary distribution.
  
* These instructions have been tested with the default resin.conf
settings 
  in the 1.2.2 release (16-Jan-2001).

* Copy the Struts applications (*.war) from $STRUTS_HOME/webapps to
your
  $RESIN_HOME/webapps directory.

* Restart Resin if it is already running.

* You should now be able to access the Struts applications (assuming
you are
  using Resin's default port number of 8080) at, for example:

http://localhost:8080/struts-documentation

* When developing your own applications, you can create a new folder
under 
  $RESIN_HOME/doc and modify the file "$RESIN_HOME/conf/resin.conf" to 
  recognize your application, for example:

web-app id='/struts-myapp' /

  Resin will then read your application's configuration from
WEB-INF/web.xml

###


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





CachedRowSet

2001-01-29 Thread Ted Husted

Is anyone actively using the early-adopter sample implementations of a
CachedRowSet with Struts? 

 http://developer.java.sun.com/developer/earlyAccess/crs/ 

It has the ability to reconnect to the DBMS, if needed, to make
updates. The preferred method is to use a datasource via a JNDI server,
but I'm not sure how that would relate to Strut's Generic pool. The two
other alternatives ara direct connection, the old-fashioned way, or
grabbing your own ResultSet and then using it to populate a
CachedRowSet. For now, I'm just populating it from a ResultSet.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Setting initial page to be an action

2001-01-30 Thread Ted Husted

If a JSP requires something created by an action, you can test for it
first, and then forward to the action if it is missing, e.g. 

logic:notPresent name="myIndexBean"logic:redirect
href="index.do"//logic:notPresent

I usually put these after the taglib declarations, but before the HTML.

*** REPLY SEPARATOR  ***

On 1/30/2001 at 5:08 PM Winters, Jason wrote:

I'm trying to setup my application so that the initial page is an
action.
When the user enters a URL like this, http://server/myapp they should
be
sent to http://server/myapp/index.do.  At the moment, they get
forwarded to
http://server/myapp/index.jsp which crashes because stuff that was
setup in
the index action does not exist.

Any ideas on how to accomplish this would be greatly appreciated!

Jason Winters



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Struts and MySQL

2001-01-31 Thread Ted Husted

I've been using mm.mysql-2.0.2 - but checking 
http://mmmysql.sourceforge.net/ . I see 2.0.4 is the latest stable
version as of 25-JAN. (The MySQL page is stale.)

I installed Resin last week, but had been using Tomcat 3.2 - and both
still work.

I just updated my MySQL version to 3.23 (declared "stable" as of
22-JAN), but it had worked with an early version too.

-T.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Testing equality of bean properties

2001-01-31 Thread Ted Husted

 which is not possible currently since the logic:equal tag only
supports comparison between a bean property and and constant value...
Any ideas?

It might be time to resort to a scriplet. (But then, in other
languages, I've been also known to use a (gasp!) GOTO).

*** REPLY SEPARATOR  ***

On 1/31/2001 at 5:13 PM Lind Jrgen wrote:

Hi there,

is there a possibbility within a struts-enabled jsp to compare
two bean properties? I am looking for something like

logic:equal name="bean1" property="prop1" value=bean:write
name="bean2"
property="prop2"
 ...do something...
/logic:equal

which is not possible currently since the logic:equal tag only supports
comparison between a bean property and and constant value... Any ideas?

Regards,

Jrgen



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: action.xml

2001-02-01 Thread Ted Husted

On 2/1/2001 at 9:03 AM John Hunt wrote:
 Is there a to remove the bean from the session scope after the
purpose is solved. 

Yes. You can remove the same as any other bean. If a new one is needed
later, Struts will create it again. Here's a snip from the example
application: 

// Remove the obsolete form bean
if (mapping.getAttribute() != null) {
if ("request".equals(mapping.getScope()))
request.removeAttribute(mapping.getAttribute());
else
session.removeAttribute(mapping.getAttribute());
}

 If it is retained is it a browser property or is it because of form
bean. 

Sounds like the browser is cacheing it. There's a HTTP pragma to defeat
that when inapproriate. 

 If it doesn't retain and we want it to be retained, then should we
put such form beans also under session scope???

If you want to the form's data to be persistent throughout the session,
then make it a session bean. If it doesn't matter, save the resoruces
and keep it in request scope. 

-T.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Struts version

2001-02-01 Thread Ted Husted

 Whats the status of it ? I know the latest release was 0.5. When is
1.0 expected ?

The 1.0 todo list is part of the package, which you can check on the
Web site. There are a few documentation tasks, and Craig mentioned a
showstopper that needed to be fixed, but it's not listed in BugRat 
http://znutar.cortexity.com/BugRatViewer/ . 

Then, it would be some period of formal beta-testing, a final vote of
the committers, and it ships.

 Can I use it for production now ? Is it that stable ?

I'd say so. I'm developing against it now, and wouldn't hestitate to
ship. 

 Does 0.5 version supports DataStore ( for connection pooling ) ?

Only if you bring your own. There is a connection pool provided with
1.0. 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: define tag

2001-02-02 Thread Ted Husted

OK, lame-brain is back again. Here's the example I was looking for. 

--

%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %
%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %
HTML
logic:present name="guava"bean:define id="cool"
name="guava"//logic:present
BODY
P
logic:present name="cool"bean:write name="cool"
property="name"//logic:present
logic:notPresent name="cool"Ooops/logic:notPresent
/P
/BODY
/HTML

--

Also note that logic:present / notPresent can be told which scope to
check, if that's important.

*** REPLY SEPARATOR  ***

On 2/2/2001 at 11:46 AM John Hunt wrote:

Hi
If we use struts-bean:define tag and if the variable
is not found, does it raise exception. If yes how can
I catch it and handle it.
Normally if A is in Sesion scope and a property B
then we would do 
bean:define id="m" name="A" scope="session"
type="typeA" /
bean:define id="B" name="m" scope="page" type="typeB"
/

Now if for some reason we cant find A in the session
or say A is null, we cant put a series of if
conditions in the jsp. How are we supposed to handle
such scenarios
Thanks
Hunt


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: member variables

2001-02-02 Thread Ted Husted

There is a single action object per session. You do need to take care
of any concurrency issues. The use of instance variables where possible
is recommended. 

See 
http://jakarta.apache.org/struts/userGuide/building_controller.html#acti
on_classes  for more, starting with "Design issues to remember when
coding Action classes". 

*** REPLY SEPARATOR  ***

On 2/2/2001 at 3:54 PM John Hunt wrote:

What are the ramifications of having member variables
in action class ( should we take care of any
concurrency issues  )... Does every request create
a new Action object or these objects reused

Thanks
Hunt

__
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Struts installation notes - WebLogic 5.1

2001-02-04 Thread Ted Husted

** WEBLOGIC USERS ***

We're adding a installation page to the Struts documentation package.
If any can playtest Robert's notes, or has any other additional
comments, please let us know as soon as possible. 

This is an important way you can contribute to the Struts project. We
appreciate everyone's help!

*** REPLY SEPARATOR  ***

On 1/31/2001 at 10:50 AM [EMAIL PROTECTED] wrote:

I have put together the following install notes for WebLogic 5.1 based
on my
experience over the past few weeks. Any comments or suggestions? I am
particularly disturbed by the fact that I can't get WL to deploy
unzipped
web applications without including app-specific classes in the WL
classpath!
Does anyone have another approach to this? Another problem I can't
seem to
get around- Deployment of wars requires manually extracting the
resource
file(s). Perhaps there is a way to get WL to find all files in the war
(and
not just *.class)?

BTW- the builds for the past few nights have a problem with the lowsrc
property in class ImgTag (Thanks Carl for pointing out that problem
with the
case in that method).


-Bob

~~

WEBLOGIC 5.1 (service pack 8)

(1) Obtain and install the Xerces XML parser (do not use the Sun
reference
implementation). Put xerces.jar in your WebLogic system path.

(2) Obtain and unpack the Struts binary distribution (this procedure
assumes
it was extracted to C:\jakarta-struts).

(3) Add an entry to weblogic.properties for each of the Struts web
applications that you would like to configure. For example, to make
the
struts-example application available, add the following line to
weblogic.properties:

weblogic.httpd.webApp.strutsexample=c:/jakarta-struts/webapps/struts-ex
ample
.war

(4) You do not need to include struts.jar or any of the application
specific
classes in the WebLogic classpath, since this will be done
automatically
(unless deploying an unpacked web archive- see below).

(5) Start WebLogic server and point your web browser to the struts
application. For example, to connect to the example application added
in
step 3:

http://localhost:7001/strutsexample

* This example application depends on the Struts specific resource
file
ApplicationResources.properties to be present on the classpath.
However,
WebLogic only extracts *.class files from the archive so this file
will not
be found, resulting in an error the first time it is needed- something
similar to: javax.servlet.ServletException: runtime failure in custom
tag
'message'. Steps 6  7 will need to be performed for this application,
and
any other that relies on ApplicationResources.properties.

(6)  Extract ApplicationResources.properties from the *.war file, and
manually copy it to the respective package in the _tmp_war_ directory
WebLogic created for this application. Again referring to the
struts-example
application, this would be:

c:\jakarta-struts\webapps\WEB-INF\_tmp_war_strutsexample

(7) Restart WebLogic. You will now be able to run the application:

http://localhost:7001/strutsexample


* The above steps should be followed for applications deployed as
*.war
files. For unpacked web applications, configuration involves adding
both
struts.jar and /WEB-INF/classes to the WebLogic classpath. For this
reason,
I would suggest deploying applications as war files to WebLogic.
However,
the same example application can be successfully deployed in extracted
format by modifying weblogic.properties (assuming the war was
extracted to
directory webapps/struts-example):

weblogic.httpd.webApp.strutsexample=c:/jakarta-struts/webapps/struts-ex
ample
/

And starting WebLogic with the updated WebLogic classpath. For
example:

c:\jdk1.3\bin\java -ms16m -mx64m -classpath
c:\weblogic\lib\weblogic510sp8boot.jar;C:\weblogic\classes\boot;c:\xerc
es\xe
rces.jar
-Dweblogic.class.path=c:\weblogic\lib\weblogic510sp8.jar;C:\weblogic\li
cense
;C:\weblogic\classes;C:\weblogic\myserver\serverclasses;C:\weblogic\lib
\webl
ogicaux.jar;C:\jakarta-struts\lib\struts.jar;C:\jakarta-struts\webapps\
strut
s-example\WEB-INF\classes -Dweblogic.system.home=c:\weblogic
-Djava.security.manager
-Djava.security.policy=c:\weblogic\weblogic.policy
weblogic.Server



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Mapping

2001-02-05 Thread Ted Husted

On 2/5/2001 at 4:52 PM [EMAIL PROTECTED] wrote:

Is there a document which maps the Struts tags with the HTML tags? 
Also, do all the HTML tags have a corresponding Struts tags?

All HTML tags do not have a corresponding Struts tags. 

I believe all the HTML "form" tags have a corresponding tag in the HTML
library. (Until recently, this was actually called the "form" library.)

When a Struts tag can be used in place of a standard HTML tag, they
share a common name. 
 
The reason I ask this is because I perceive that the Struts ags are
beneficial only if they are linked to a form bean.

That would be true of the set of tags nested within the html:form tag.
The others, like base and link, which are useful without being linked
to a form bean. 

We are lacking a HTML Tag Library guide, which I will put on my list.
This is where the documentation you have in mind would be located.
Everything you need to know is documented by the Tag Library Reference,
but it doesn't really lay it out like a tutorial.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: what does this ERROR mean ??

2001-02-05 Thread Ted Husted

It looks like the application resource named in your struts-config.xml
is missing.

If you just specify the name, and no path, you can drop it in the
classes folder.

*** REPLY SEPARATOR  ***

On 2/4/2001 at 7:23 PM majid kamal wrote:

could you please go to :
http://www.webappcabaret.com/yna54context

and explain to me what does this error mean.
Thanks lot

-- 
majid kamal
[EMAIL PROTECTED] - email
(781) 685-1450 x2371 - voicemail/fax



__
FREE voicemail, email, and fax...all in one place.
Sign Up Now! http://www.onebox.com



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Help with Context Path Error

2001-02-06 Thread Ted Husted

Are you able to run the Struts applications provided in the
distribution?

The action mappings are provided through the struts-config.xml in the
application's WEB-INF folder.

*** REPLY SEPARATOR  ***

On 2/5/2001 at 8:21 PM Toby wrote:

Hi,
I'm new to Tomcat and Struts.  I can get the basic hello world struts
 examples to run in my environment.  But when I try something more
 sophisticated, I receive the following error message concerning the
 ActionMappings.  I believe I have a Context Path problem, but am not
 sure how to resolve it.  Can anyone help?

 Error: 500
 Location: /struts-logon/logon.jsp
 Internal Servlet Error:

 javax.servlet.ServletException: Cannot retrieve ActionMappings under
key
 "org.apache.struts.action.MAPPINGS"
  at

org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContex
tImpl.java:386)

  at

_0002flogon_0002ejsplogon_jsp_0._jspService(_0002flogon_0002ejsplogon_js
p_0.java,

 Compiled Code)
  at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)

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

org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServle
t.java:174)

  at

org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)


  at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
 Compiled Code)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at

org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,


 Compiled Code)
  at

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

org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java,

 Compiled Code)
  at

org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java
,

 Compiled Code)
  at java.lang.Thread.run(Thread.java, Compiled Code)

 Root cause:
 javax.servlet.jsp.JspTagException: Cannot retrieve ActionMappings
under

 key "org.apache.struts.action.MAPPINGS"
  at
org.apache.struts.taglib.form.FormTag.doStartTag(FormTag.java:491)
  at

_0002flogon_0002ejsplogon_jsp_0._jspService(_0002flogon_0002ejsplogon_js
p_0.java,

 Compiled Code)
  at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:126)

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

org.apache.jasper.runtime.JspServlet$JspServletWrapper.service(JspServle
t.java:174)

  at

org.apache.jasper.runtime.JspServlet.serviceJspFile(JspServlet.java:261)


  at org.apache.jasper.runtime.JspServlet.service(JspServlet.java,
 Compiled Code)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
  at

org.apache.tomcat.core.ServletWrapper.handleRequest(ServletWrapper.java,


 Compiled Code)
  at

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

org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(H
ttpConnectionHandler.java,

 Compiled Code)
  at

org.apache.tomcat.service.TcpConnectionThread.run(SimpleTcpEndpoint.java
,

 Compiled Code)
  at java.lang.Thread.run(Thread.java, Compiled Code)


Thanks for the help.



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Action class

2001-02-06 Thread Ted Husted

To satisify Struts, you only need to return null. 

Once that is done, you can respond to the request using standard
servlet techniques. 

A good references for that is 


http://developer.java.sun.com/developer/Books/cservletsjsp/chapter7.pdf


and of course 

 http://www.w3.org/Protocols/rfc2616/rfc2616-sec6.html#sec6 

*** REPLY SEPARATOR  ***

On 2/5/2001 at 8:27 PM John Hunt wrote:

If an action class directly wants set the headers like
content type etc and write the output directly, what
all issues should be taken care of apart form
returning null in perform method?
Thanks
Hunt

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



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





RE: Data Validation

2001-02-06 Thread Ted Husted

In our case, we have chosen to use the java.text.Format as a
superclass of
all our validation and formatting classes.

Can you provide working examples of any of the classes you are using
now?

Putting something like this into a sample Struts application can really
help move things along.

Beyond the simple aspect of validating the format of an input string,
it is
also often required to transform the validated string into a usable
form for
further processing.

Eventually, beyond the use of Format classes, we intend to create a
sort of
format class instance pool, whereby pre-initialized format classes are
stored for repetitive usage. This avoids the creation and
initialization of
an object each time a validation/formatting has to be performed. The
Struts
digester would be a great tool for initializing this pool.

A big example of that is inserting the value into a JDBC DBMS. Here, it
can be convenient to use a string-based entity bean to work with the
Struts form, and then let the driver do the final conversion of the
validated sttring. A pool  of JDBC-orientated validation classes sounds
be very useful.

If you haven't already, you should consider subscribing to the
Struts-Dev too, where there is more talk about how to extend Struts.










Could you provide a simple example of how you use the  java.text.Format
class to validate some standard types. For example, a form with fields
like:

Date
Name
Amount
Telephone Number



An important reason for validation, as you point out, is for later use
of the value, especially the insertion of the value into the database.




*** REPLY SEPARATOR  ***

On 2/6/2001 at 8:12 AM Rey Francois wrote:

In our case, we have chosen to use the java.text.Format as a
superclass of
all our validation and formatting classes. I would suggest Struts to
consider this approach. Our decision derives from the following
requirements:

1 Validation of Strings data according to a specified format
The basic requirement is to validate that a string complies to a
specified
format. For example, for a string representing a date, the requirement
is to
make sure it is of the form: dd/mm/.

2 Parsing Strings to Objects and vice-versa
Beyond the simple aspect of validating the format of an input string,
it is
also often required to transform the validated string into a usable
form for
further processing. In Java this means creating an object instance
from the
string. With the date example, this could mean creating a
java.util.Date
object.
On the other hand, it is also required to perform the reverse
operation. In
the case of an instance of a java.util.Date, it should be possible to
get a
string representation of it according to a specified format.

3 String buffer parsing and formatting
It should be easy to parse only a certain part of a larger string when
the
latter contains the formatting of several elements. Conversely, it
should be
easy to append the string representation of an object to an existing
string.
This can be useful for example in the context of marshalling object
instances into an XML representation.

4 Independence of the usage context
The classes involved should be coupled to any context of usage. This
is to
allow maximum reuse of the logic in various contexts. For example the
framework should not depend on the HTTP request of the Servlet API.
This should enable the creation of a library of formatter that can be
used
in various projects. This library can contain basic formatters, but
also
more business oriented ones such as account number formatting, etc.

5 Internationalization
In some cases it is necessary to have the parsing and validation
processing
aware of locale-specific factors. The date example is again a very
good
illustration of this requirement, whereby in the United States dates
are of
the form mm/dd/, while in Europe dates are of the form dd/mm/.
In
the context of a graphical user interface, this is an important
requirement.

The java.text.Format class satisfies all the above requirements. It is
a
standard Java object, so using it should be consistent with future
Java
developments. Finally, J2SE already proposes some formatters for
numeric
values, date, and messages.

In our context, these format classes will be used for:
- HTTP request parameter validation
- Handling of request and return buffer to and from legacy systems
- Displaying of the data elements in an HTML front-end

Eventually, beyond the use of Format classes, we intend to create a
sort of
format class instance pool, whereby pre-initialized format classes are
stored for repetitive usage. This avoids the creation and
initialization of
an object each time a validation/formatting has to be performed. The
Struts
digester would be a great tool for initializing this pool.

Comments welcomed!

Franois Rey
Financial WebSuite
The Capital Markets Company
http://www.capco.com/


-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]]
Sent: 06 February 2001 01:01

Re: What's the estimated release schedule for struts 1.0?

2001-02-06 Thread Ted Husted

On 2/6/2001 at 4:08 AM Ronen Babayoff wrote:
I'm asking because I want to know which version should I use in my new
web
project.

This is a volunteer project, so there isn't a release schedule per se.
We all do what we can on a time-available basis.

The 1.0 todo list is part of the package, which you can check on the
Web site. The latest bug list is at 

When these are resolved, it would be some period of formal
beta-testing, a final vote of the committers, and it ships.

Implied question Can I use it for production now ? Is it that stable ?

I'd say so. I'm developing against it now, and wouldn't hestitate to
ship. 

Some early-birds are still working with 0.5, and are very happy with
it, but most people seem to be using the latest builds, which tend to
be very stable. 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: What's the estimated release schedule for struts 1.0?

2001-02-06 Thread Ted Husted

On 2/6/2001 at 7:42 AM Ted Husted wrote:
The latest bug list is at 

Oops, forgot to check this 

The latest bug list is at   http://nagoya.apache.org/bugzilla 


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Installation notes for other servlet containers

2001-02-06 Thread Ted Husted

We now have notes for Orion, Tomcat, Resin, and Weblogic. Similar
instructons for other containers, like Enhydra, JBoss, JRun, and
Websphere, and whatever else anyone is using, would be very much
appreciated. 

If you know that Struts won't work with a container, and have a good
explanation as to the specific problem, we should include that too. 

If you can help us out, please see the install file in your
jakarta-struts folder for an example format. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Tomcat/Struts-friendly hosting services

2001-02-06 Thread Ted Husted

imagineis.com

Just a customer, but it's a good shop.

*** REPLY SEPARATOR  ***

On 2/6/2001 at 11:11 AM Tom Miller wrote:

Any recommendations on web hosting services that support Tomcat 3.2.1?
I'm especially interested in experiences in fielding a Struts based
site
with a reasonably priced hosting service that was/is a good bet to
recommend to clients. Has anyone compiled a list somewhere?

TIA

--
Tom Miller
[EMAIL PROTECTED]
641.469.3535 Phone
413.581.6326 FAX



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Ted's FAQ What Web sites are already Powered by Struts?

2001-02-07 Thread Ted Husted

On 2/7/2001 at 2:26 PM [EMAIL PROTECTED] wrote:

We use struts in portions of the Ironmax website
(http://www.ironmax.com)
Namely the irst step in the RFQ process, and we use struts in all of
our
informational products.

Are the links to ".ojsp" files going through the controller (e.g. ".do"
files)?

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: Ted's FAQ What Web sites are already Powered by Struts?

2001-02-08 Thread Ted Husted

I believe I've added the Powered by Struts sites submitted to this
thread so far. Thanks so much!

I've also fleshed out more of the "kickstart" FAQ at 

 http://husted.com/about/struts/kickstart.html . 

There are still three questions on my list, in case anyone wants to
jump in. 

+ What development tool should I use?
+ How do I develop a Struts application?
+ How do I troubleshoot a problem with a Struts application?

I've some notes about these at the bottom of the page, again, in case
anyone wants to jump in ;-).

When this is complete, I'll propose it for the documentation package. 

Of course, any comments or suggestions would be welcome!


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





RE: struts-config_1_0.dtd File question

2001-02-08 Thread Ted Husted

http://java.sun.com/products/javabeans/docs/

*** REPLY SEPARATOR  ***

On 2/8/2001 at 5:42 PM Mike Campbell wrote:

Can someone point me to the spec doc for JavaBeans?  I'm having a bit
of
trouble finding it on Sun's site.



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





Re: forms, formbeans and JavaScript

2001-02-12 Thread Ted Husted

Yes.

Mike Dewhirst wrote:
 
 As a lot of forms may have JavaScript in them to dynamically rebuild menus, etc. Is 
it possible to combine this with the Struts tag-styled form design?
 
 Thanks in advance for your help,
 
 Mike
 
 --
 
 This e-mail may contain confidential and/or privileged information. If you are not 
the intended recipient (or have received this e-mail in error) please notify the 
sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/



Re: Struts user base

2001-02-12 Thread Ted Husted

You probably want to spend some time in the mail archives. 

The Struts-User archive at  http://mail-archive.com  is my personal
favorite. 

It was recently mentioned that there are over 900 subscribers to the
mailing lists. 

Jakarta projects offer nightly builds with the latest fixes. 

How often formal releases happen depend on how many people contribute. 

Your team, for example, could offer patches and improvements to the
code, and eventually become Committers. You could then help decide when
and how many of these things happen. 

Struts is standards-based, and works with most containers. WebLogic 5.1
with sp8 is fine, and WegLogic 6 is suppose to a no-brainer. 

Mike Dewhirst wrote:
 
 I am working on the same project as Mark Mclaren, and have some additional questions 
regarding Struts:
 
 1. Does anyone have an idea of how many people are developing/using Struts?
 
 I have checked the bug list and indeed it is very small, but I want to know that 
that is due to product stability, not because of the lack of users. Don't mean to be 
rude, just cautious.
 
 2. Are there any European users?
 3. Does anyone run Struts on commercial servers, e.g. BEA's Weblogic?
 4. What is the envisaged frequency of update releases? (just a rough idea, e.g. 
every 2 quarters, years, etc.)
 
 Thanks in advance for your help!
 
 Mike Dewhirst
 
 --
 
 This e-mail may contain confidential and/or privileged information. If you are not 
the intended recipient (or have received this e-mail in error) please notify the 
sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.



Re: Struts example doesn't work???

2001-02-13 Thread Ted Husted

Mark Davidson wrote:
 I've seen other postings from people using both Tomcat and Weblogic, and
 having the same problem.  My question is... why?  I know some people have
 suggested unpacking the war file and struts.jar file so they can be in your
 classpath, but I would love to know the reason behind this issue.

There are actually two issues:

(1) Running a Struts application from a WAR

(2) Compiling your own Struts application

The containers and development environments have conflicting
requirements, which is the source of a lot of confusion.

The bottom line is that the struts.jar SHOULD NOT be on the classpath
when Tomcat is running.

See  http://husted.com/about/struts/kickstart.html#jar  for more. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/



Re: Struts installation notes

2001-02-13 Thread Ted Husted

 
 STRUTS INSTALLATION NOTES - JRun 3.0
 
 
 TESTED ENVIRONMENT (your mileage may vary):
 ---
 JRun 3.0 SP2a, Version 3.02a.11614
 Microsoft IIS 5.0, Windows 2000

Thanks so much, Eric!

Any other JRUN users: please, if possible, try to give these a whirl,
and let us know how they work for you!

So with JRUN and SilverStream being added today, of the containers most
often mentioned, we're down to Websphere! Any takers?



Re: Old questions that die hard

2001-02-13 Thread Ted Husted

My initial thoughts were to look at what some of the advanced HTML
authoring tools, like FrontPage and Dreamweaver do with this. Craig
mentioned to me that the client-side validations should be coordinated
with any new work on server-side validations. 

Obviously, some standard "domain type" validations would be very useful,
corresponding to Java or SQL types. These might be the sorts of things
we could easily add as properties, and would fit in with any IDE
integration projects.

These could then be braced server-side with hardcore regex validations,
along with any business logic checking.

Of course, late-model Javascript also supports regex ...

Jim Richards wrote:
The other thing I haven't found reference to yet is
client side validation (but I also haven't looked that hard either)

 I did notice that you had your name down for the client
 side validation. I'd be interested in your thoughts, and
 ideas because this is something I've done a lot of
 recently (not in Struts/JSP though) ...

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/



Re: As promised (Struts Presentation)

2001-02-13 Thread Ted Husted

Kewl!

I think I know what I'll be doning after Dark Angel tonight!

I did notice one point on page 17, where it says "Struts will only
handle models in an automatic fashion if you extended
org.apache.struts.action.ActionForm"

Is the word "only" accurate? 

I believe Struts works best if the form beans are ActionForm subclasses,
but I think the form and action would work just fine with any JavaBean.

-Ted.

Craig Tataryn wrote:
 
 
 Craig M.: Can you add the link to the presentation (if you deem it
 suitable) to the resources section of the Struts User Guide?
 
 
 URL forwarding sucks.  Given that, I will have to give you the link to
 the presentation as it exists on the server space I am borrowing until I
 get my own server box.  The URL may change in the future to my
 computer-programmer.org domain.
 
 The Struts presentation I did can be found (at least for the time being)
 at:
 http://www.us-eh.com/craiger/articles/struts/
 
 Let me know of any problems or suggestions you may have about the
 presentation!
 
 Thanks,
 
 Craig.
 
 --
 I've been trying to change the world for years, but they just won't give
 me the source code



Re: Struts and Turbine

2001-02-14 Thread Ted Husted

Jonathan Carlson wrote:
 Are there a lot of Struts users using major Turbine components like the user
 access control module?  If so, is it 2% 50% or 90%?  In other words, how
 compatible are they really?  I checked the archives but didn't see much that
 answered this question.
 
 What I'm really getting at is that I don't see much on either the Struts web
 site or the Turbine site that refers to each other.  Considering they are
 both Apache projects, the perceived silence about each other makes me kind
 of nervous.

Since technologies on many of the Jakarta products are starting to
overlap, we are discussing a component sharing library on the General
list. This would make it much easier for Jakarta products (as well as
others) to share individual components. Right now, a lot of the pieces
of an individual product depend on several other pieces, which makes it
difficult to take the banana without getting the whole gorilla. If you
have an interest in this sort of thing, see 
 http://husted.com/about/jakarta/library.html 

Turbine is very results-orientated, and is a good choice for advanced
developers looking for a high-performance, omnibus solution. 

Struts is very standards-orientated, and is a good choice for enterprise
developers looking for something that will fit well with their own big
picture. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/



Re: Client-side validation (Old questions that die hard)

2001-02-15 Thread Ted Husted

David Winterfeldt wrote:
 I posted the code and a example war at.  Ted, if you
 want to, you can add this to the list of struts
 sites/resources you have.  

I've added this to my list at  http://husted.com/about/struts , along
with Craig T's very kewl presentation.

If this keeps up, we're going to need an announcement list just to keep
up with the new Struts resources!

I'm hip deep (down from neck deep) in the Dreamweaver UltraDev tutorials
right now, but as soon that's done, I'm back to refining validation
for my working application -- which would now mean taking your Validator
for a spin!

What I really like about this at first glance is the XML configuration.
This plays well into integrating this both with Struts and with visual
environments, like UltraDev. 

Have you thought about offering built-in expressions for standard Java 
and SQL types?

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/



Re: Blank Newbie (on Tomcat)

2001-02-16 Thread Ted Husted

 Dan Connelly wrote:
 Should you also have trouble with this, the Newbie problem (my
 problem, now solved) is that you must re-deploy the application if you
 make a change to the struts-config.xml.   (Is this obvious?  It wasn't
 to me.   In fact, the splash screen on struts-blank implies
 otherwise.)

The index.jsp says 

"To get started on your own application, rename struts-blank.war to the
name for your application, and let your container auto-deploy it. Edit
the blank configuration files as needed, and you are on your way! (You
can find the ApplicationResources file with this message in the classes
folder.)"

Do you think that changing that to 

"To get started on your own application, copy the struts-blank.war to a
new WAR file using the name for your application. Place it in your
container's "webapp" folder (or equivalent), and let your container
auto-deploy the application. Edit the skeleton configuration files as
needed, reload Struts or restart your container, and you are on your
way! (You can find the ApplicationResources file with this message in
the classes folder.)"

-Ted.



Re: Latest reasonably stable release

2001-02-17 Thread Ted Husted

The was a recent spate of fixes last week, as Craig gears up for final
release testing. I would say that the latest build is your best bet.
We've been in major feature lock for some time, and are just tying up
loose ends right now. 

-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/

Peter Lappo wrote:
 
 I'm trying to put together a Java distribution for Linux containing
 JDK1.3, Tomcat, Struts, JBoss and other bits and pieces. I'm doing this
 for myself initially but will post the instructions when its complete.
 My question is.
 Should I use version 0.5 or is there another more advanced release that
 is reasonably stable? Or should I just choose the latest release? I'd
 like to contribute eventually so don't really want to use an "old"
 version.
 
 Peter



Re: Struts on IPlanet

2001-02-19 Thread Ted Husted

 Mallari Kulkarni wrote:
 
  Hi,
 
  Anybody knows how to implemet Struts on IPlanet Fast-track Server
  4.1 which
  supports Custom Tags and JSP 1.1.  Is it comatible ?
 
  Regards
  Mallari Kulkarni

People have mentioned the iPlanet WS and AS products on the list.

The latest AS roundups seem to be here 


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



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



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



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


and we have this for WS


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


I'm about to try and assemble this into something for the installation
page.

-Ted.



Re: AW: Struts on IPlanet

2001-02-20 Thread Ted Husted

Oliver, 

For the installation page, I just entered for iPlanet Application Server
6.0

Service Pack 2 is recommended.

NOTE: At present, the Struts example application still uses a
non-Serializable servlet context attribute, and will not run in an
environment that requires them, like iPlanet Application Server.

For iPlanet Web Server 4.2 I added Stanley Santiago's notes from


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


Is this sufficient?

Should we include your workaround(s) for Service Pack 1?

Are these them? 


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



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





[EMAIL PROTECTED] wrote:
 
 Hi,
 
 no it isn't scary...it is working :-) !
 We are using IP6.0 with WS4.1 and although the manual says that SP1 is
 supporting SERVLET2.1 and JSP0.92 only  the main functions are runing (with
 a small workaround). But IP6.0 SP2 supports SERVLET2.2 and JSP1.1 as SUN
 announced. We are just installing SP2 and in a week we will see if this
 workaround isn't necessary any longer.
 
 Regards Oliver (Craig :-) ) Lauer



[Fwd: cvs commit: jakarta-struts/src/share/org/apache/struts/taglib/html ImageTag.java ImgTag.java]

2001-02-20 Thread Ted Husted

Anyone who is using the HTML Image tag should note the following.

See also 
http://www.mail-archive.com/struts-dev%40jakarta.apache.org/msg00443.html


--- Original Message 

From: [EMAIL PROTECTED]
Subject: cvs commit:
jakarta-struts/src/share/org/apache/struts/taglib/html ImageTag.java
ImgTag.java
To: [EMAIL PROTECTED]

craigmcc01/02/19 18:59:00

  Modified:src/doc  struts-html.xml
   src/share/org/apache/struts/taglib/html ImageTag.java
ImgTag.java
  Log:
  Retrofit the html:image tag so that it offers the same support for
  dynamically looking up alternate text, context-relative URIs, or
source
  URLs in a message resources bundle that the html:img tag has.
  
  NOTE:  This change is *not* backwards compatible, but the changes are
very
  easy:
  * Change any use of 'src="foo" isKey="true"' to 'srcKey="foo"' instead
  * Change any use of 'path="/foo"' to 'page="/foo"' instead
  
  Revision  ChangesPath
  1.14  +144 -74   jakarta-struts/src/doc/struts-html.xml
  
  Index: struts-html.xml
  ===
  RCS file: /home/cvs/jakarta-struts/src/doc/struts-html.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- struts-html.xml   2001/02/20 01:48:44 1.13
  +++ struts-html.xml   2001/02/20 02:58:59 1.14
  @@ -1251,165 +1251,235 @@
   
   /tag
   
  -  tag 
  -  nameimage/name
  -  summary
  -Renders an input of type "image"
  -  /summary
  -  tagclassorg.apache.struts.taglib.html.ImageTag/tagclass
  -  info
  -This tag renders an input of type "image".  Use the
"src" attribute
  -in conjunction with a non-null "isKey" attribute to
retrieve a
  -property value from a resource bundle.  Use the
"path"
  -attribute to specify a direct path to the image.  See
info on
  -the "property" attribute if you would like to obtain
the coordinates
  -of the mouse click submitted with the request.
  -  /info
  -  attribute 
  -namelocale/name 
  -requiredfalse/required 
  -rtexprvaluetrue/rtexprvalue 
  -info
  -The locale to use to retrieve the key specified by
"src".
  -/info
  -  /attribute 
  -  attribute 
  -namebundle/name 
  -requiredfalse/required 
  -rtexprvaluetrue/rtexprvalue
  -info
  -The servlet context attribute key for the
MessageResources
  -instance to use.
  -/info
  -  /attribute 
  -  attribute 
  -nameaccesskey/name 
  -requiredfalse/required 
  -rtexprvaluetrue/rtexprvalue 
  -  /attribute 
  +tag 
  +nameimage/name
  +summary
  +Render an input tag of type "image"
  +/summary
  +   
tagclassorg.apache.struts.taglib.html.ImageTag/tagclass
  +info
  +
  +pRenders an HTML codelt;inputgt;/code tag of
type
  +"image".  The base URL for this image is calculated
directly
  +based on the value specified in the codesrc/code
or
  +codepage/code attributes, or indirectly by
looking up a
  +message resource string based on the
codesrcKey/code or
  +codepageKey/code attributes.  You
strongmust/strong
  +specify exactly one of these attributes./p
  +
  +pIf you would like to obtain the coordinates of the
mouse
  +click that submitted this request, see the
information below
  +on the codeproperty/code attribute./p
  +
  +/info
  +
  +attribute 
  +nameaccesskey/name 
  +requiredfalse/required 
  +rtexprvaluetrue/rtexprvalue 
  +info
  +pThe keyboard character used to move focus
immediately
  +to this element./p
  +/info
  +/attribute 
  +
  +attribute
  +namealt/name
  +requiredfalse/required
  +rtexprvaluetrue/rtexprvalue
  +info
  +pThe alternate text for this image./p
  +/info
  +/attribute
  +
  +attribute
  +namealtKey/name
  +requiredfalse/required
  +rtexprvaluetrue/rtexprvalue
  +info
  +pThe message resources key of the alternate text
for this
  +image./p
  +/info
  +/attribute
  +
  +attribute 
  +namebundle/name 
  +requiredfalse/required 
  +   

Re: AW: Re: AW: Struts on IPlanet

2001-02-20 Thread Ted Husted

Oliver, 

Is there any chance that you could phrase this as a how-to?

[EMAIL PROTECTED] wrote:
 
 -- Original Nachricht --
 
 Oliver,
 
 For the installation page, I just entered for iPlanet Application Server
 6.0
 
 Service Pack 2 is recommended.
 
 == In a week I will know if that will fix our problems concerning the Servlet2.2
 incompatibility
 
 NOTE: At present, the Struts example application still uses a
 non-Serializable servlet context attribute, and will not run in an
 environment that requires them, like iPlanet Application Server.
 
 == you have to deploy the Servlet as non distributable and then
 it works with SP1, too
 
 For iPlanet Web Server 4.2 I added Stanley Santiago's notes from
 
 
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg00022.html
 
 
 Is this sufficient?
 
 Should we include your workaround(s) for Service Pack 1 ?
 
 == You have to, not especially this one, but one that fixes the
 getServletPath()-Problem.
 
 Are these them?
 
 == Yes, it works and I like STRUTS. We did not use all the Tags yet but
 it runs...
 
 
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg01992.html
 
 
 == This one is cheap but the most important one
 
 
 http://www.mail-archive.com/struts-user@jakarta.apache.org/msg02011.html
 



Re: more than one formclass for a one jsp ?

2001-02-25 Thread Ted Husted

You might want to clarify what you mean by form class. Struts offers a
base ActionForm class. This class is a JavaBean wrapper that works with
the HTML Form tag to automagically populate the fields on your form. It
also provides a built-in validation mechanism that works with the Struts
Action Class.

The ActionForm class for a HTML Form tag can be specified in the Struts
configuration file, or with the tag. There's not a way to specify more
than one ActionForm class in either of these places. Of course, you
could have more than one HTML form in your JSP, and associate different
ActionForm classes with each. Here, you would specify the ActionForm as
the "name" property to the Struts HTML form tag. 

I haven't tried it myself, but the form tags also accept a name
property, which may imply that you can use different ActionForm classes
for different fields.

Here's an answer to a different question: Can I use more than one entity
bean with my ActionForm beans?

Often, there is a one:one relationship between the ActionForm class and
an entity bean class that represents your table. However, you can now
nest other JavaBeans, of any class, within the ActionForm subclass. So,
a good way to go is to define a different entity bean classes for each
of your tables, and then encapsulate these within your ActionForm
subclass. 

See the Bean Developers guide 


http://jakarta.apache.org/struts/api/org/apache/struts/taglib/bean/package-summary.html#package_description


for more about the syntax for addressing nested properties. This syntax
also works for HTML tags.

 Mallari Kulkarni wrote:
 
 Hi,
 
 I wanted to have more than one form class for   a  one jsp file.
 Because in my one jsp file,  i have a information of 4 tables. So i
 want to transfer the information to 4  formclasses?  Is it possible?
 
 Please help me.
 
 Regards
 Mallari

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



Re: Struts in Websphere, missing resources attribute...

2001-02-25 Thread Ted Husted

Were the instructions here 

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

any help?

Wayland Chan wrote:
 
 Sorry, I should have mentioned that I'm using Struts
 0.5 and WAS 3.5.2
 
 __
 Do You Yahoo!?
 Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/



Re: Client-side validation (Old questions that die hard)

2001-02-25 Thread Ted Husted

An Internet month, perhaps ;-)

I am using Dreamweaver UltraDev to work on HTML pages, but haven't
customized it for Struts JSPs yet. 

It does look promising though.

 Tony Baity wrote:
 
 Ted,
 
 Since it has been a month or so since you were "hip deep" in Ultradev,
 can you provide a quick list of how it needs to be configured to
 handle struts tags for round-tripping.
 
 This and similar info for other IDEs is about the only thing missing
 from the already lengthy list of Struts links that you have previously
 provided and I believe would help give development teams a jumpstart
 for using Struts as part of their J2EE projects.
 
 -Original Message-----
 From: Ted Husted [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, February 15, 2001 4:25 AM
 To: [EMAIL PROTECTED]
 Subject: Re: Client-side validation (Old questions that die hard)
 
 David Winterfeldt wrote:
  I posted the code and a example war at.  Ted, if you
  want to, you can add this to the list of struts
  sites/resources you have.
 
 I've added this to my list at  http://husted.com/about/struts ,
 along
 with Craig T's very kewl presentation.
 
 If this keeps up, we're going to need an announcement list just to
 keep
 up with the new Struts resources!
 
 I'm hip deep (down from neck deep) in the Dreamweaver UltraDev
 tutorials
 right now, but as soon that's done, I'm back to refining validation
 for my working application -- which would now mean taking your
 Validator
 for a spin!
 
 What I really like about this at first glance is the XML
 configuration.
 This plays well into integrating this both with Struts and with visual
 
 environments, like UltraDev.
 
 Have you thought about offering built-in expressions for standard Java
 
 and SQL types?
 
 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel 716 425-0252; Fax 716 223-2506.
 -- http://www.husted.com/about/struts/



Re: Error invoking servlet

2001-02-25 Thread Ted Husted

There's a link to the patch for Bluestone here:

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

Ramakrishna VasiReddy wrote:
 
 Hi,
 I'm getting an error in the browser like this.I'm using bluestone
 application server 7.2.2(eval).
 I cann't figure it out where its happening.
 
 Compiler Error:
 XML translator error: The tag library at '/WEB-INF/struts-bean.tld' could
 not be opened: The URI '/WEB-INF/struts-bean.tld' is malformed: no protocol:
 /WEB-INF/struts-bean.tld
 
 Thanks in advance



Re: faq

2001-02-27 Thread Ted Husted

Unfortunately, there's not an official FAQ for Struts right now.
(Jakarta's Jyve
installation seems to be hopelessly broken.) 

I've started a draft of a "kickstart" FAQ at 

 http://husted.com/about/struts/kickstart.html 

in case that helps. 

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



Re: Strut / Turbine

2001-03-01 Thread Ted Husted

See 


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


and 

 http://www.mail-archive.com/general@jakarta.apache.org/msg00495.html 

Christophe Vigny wrote:
 
 It seems that the database support is pretty lesser in strut than in turbine.
 
 I'm wonder what is the better frame work to use, I want to build database driven web 
site in java
 technologie.



Re: Article on struts

2001-03-02 Thread Ted Husted

malcolm davis wrote:
 
 Where is the link?

 http://www.sys-con.com/java/archives/0603/mcclanahan/ 

now along with the others at

 http://www.husted.com/about/struts/ 

-Ted.



Re: Dreamweaver TagLib

2001-03-04 Thread Ted Husted

I picked it up from another posting, and to be honest, I'm not sure how
to use it either ;0

I'm working on an extensions of my own now. Let me know if you're
interested in an alpha. This let's you use  Struts tags within
Dreamweaver as if they were standard HTML tags. 

Dreamweaver doesn't seem to read TLD's directly. It has its own
extension system -- that also works with ColdFusion, ASP, and whatever
else. 

Martin Duffy wrote:
 
 I guess that this may be off topic but.
 
 I saw the DreamWeaver Struts taglib(?) on Ted Husted's site. Are there any
 instructions for using it? It looks to me like it is some sort of
 pre-processor? I do not understand how to use it. I thought that taglibs
 were TLD's?
 
 Thanks
 
 Martin



Re: Article on struts

2001-03-04 Thread Ted Husted

see 

  http://www.sys-con.com/java/archives/0603/mcclanahan/  

and 

 http://www.husted.com/about/struts/ 


Maya Muchnik wrote:
 
 Hi,
 No link.
 
 Incze Lajos wrote:
 
  Yet another article on Struts. You won't believe it ...

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



Re: You make the decision Velocity/Turbine vs. Struts/JSP

2001-03-04 Thread Ted Husted

I think it might be. Basically, Velocity renders the output, and passes
it back. When used with a WebApp, the Velocity engine gets wrapped in a
servlet, which pipes the output to the browser. From Strut's viewpoint,
it wouldn't be any different than rendering a PDF or GIF. You just pass
null back to controller, and everybody's happy. In the Velocity demo
app, there's a controller that uses a switch statement to choose a
template. It would be cool seeing it use the Strut's ActionMappings
instead. 

[EMAIL PROTECTED] wrote:
 
 A question I have... is it feasible at all to use Velocity as the
 presentation mechanism with a Struts MVC framework?
 
 Regards,
 James W.
 
 --
 This e-mail is from Cards Etc Pty Ltd (ACN: 069 533 302). It may contain
 privileged and confidential information. It is intended for the named
 recipient(s) only. If you are not an intended recipient, please notify us
 immediately by reply e-mail or by phone on +61 2 9212 7773  delete this
 e-mail from your system.
 --

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



Re: Action forwards

2001-03-06 Thread Ted Husted

Katherine Barry wrote:
 We are using action forwards, but the url in the browser never changes.
 Everything works happily, so the only thing we want is for the browser to
 change and display the new URL(mainly for the refresh button).

I believe Refresh repeats the last request, rather than the URL that
appears in the browser's address window. 

If you want refresh to redisplay the current page (without repeating the
last request, which may include input from a form), then you should use
the redirect technique that Craig mentioned. (In which case generating a
new request becomes a benefit rather than a drawback.)

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



Re: Preferred HTML Editor

2001-03-06 Thread Ted Husted

DONNIE HALE wrote:
 It's got Tomcat built into it, so you can right-click on a JSP and say "Execute". It 
also has auto-completion for custom tags - once you put the prefix:tag in, it will 
show the list of parameters for that tag. 

Is it possible to redistribute that part of the NetBeans configuration? 

-Ted.



Re: Preferred HTML Editor

2001-03-06 Thread Ted Husted

Donnie mentioned "once you put the prefix:tag in", and I was wondering
if the "prefix:tags" were stored in an external file, that could be
created once with all the Struts (and Taglibs) tags -- plug and play. 

"Craig R. McClanahan" wrote:
 
 Ted Husted wrote:
 
  DONNIE HALE wrote:
   It's got Tomcat built into it, so you can right-click on a JSP and say 
"Execute". It also has auto-completion for custom tags - once you put the prefix:tag 
in, it will show the list of parameters for that tag.
 
  Is it possible to redistribute that part of the NetBeans configuration?
 
 
 NetBeans is under a modified Mozilla Public License license, so it's basically 
compatible.  However, I don't see the value add from redistributing this part of 
NetBeans, because it won't do any good unless you have
 all of NetBeans anyway -- and then you've got that piece already, right?
 
 
  -Ted.
 
 Craig

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



Re: Database pooling code

2001-03-07 Thread Ted Husted

Work is under way on a database connection pool that can be used by
Struts and other Jakarta products. 

The codebase includes several requested features, including monitoring
expired connections. 

For a few additional details, see 
http://www.webappcabaret.com/rwald/dbcp/ . 

Rodney Waldhoff is working on this with Geir Magnusson, of Velocity, and
several committers from other projects, including, or course, The Craig.

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

Jim Richards wrote:
 
 Has anyone got the database pooling code/DataSource to work or specifically
 had it fail?
 
 I've been having problems (documented previously) and I've read about a few others
 who can't seem to get the pooling to work as well, and I want to get an idea
 of specifically where the problem might lie in order to fix it.



Logging IP Addresses

2001-03-12 Thread Ted Husted

This is mildly off-topic, but I'm logging accesses to my application
when people login. I'd like to convert the IP string (xxx.xxx.xxx.xxx)
returned by the HttpRequest to an unsigned integer. Before I write one,
I wondered if anyone had a handy library routine for that. 

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



Re: Strut Books

2001-03-12 Thread Ted Husted

Are you including the new Taglibs JDBC tag set (which works well with
Struts, among other frameworks)?

"Lacerda, Wellington (AFIS)" wrote:
 
 I'm working on a book about tag libraries that has quite a number of
 chapters dedicated to Struts. What are the topics you want to be covered
 with more detail? I'm still working on those chapters to have them more
 up-to-date! This kind of input would be nice and right in time! :-)
 
 Wellington Silva
 UN/FAO



Re: Question about struts application model (DataSource, Business Logic beans)

2001-03-13 Thread Ted Husted

 My problem is that
 access to the DataSource is through the servlet.findDataSource() call.

Struts stores the JDBC Connection pools as servlet context attributes
(in JSP terms, application-scope beans). You can also access them that
way. If you do not specify a name in the Struts-config file, it uses a
constant value. If you specify null to findDataSource(), it uses the
same constant. But you can also access the pools using your own labels
(or the Struts constant) without using the servlet method. 

 Carles Pi-Sunyer wrote:
 
 Hi,
 
 I'm using Struts for a new application that I'm developing. I have a
 question about the separation between the Action classes and the
 Business Logic beans.
 
 My Business Logic beans are making database accesses to manipulate the
 underlying data model. I am planning on using the struts db connection
 pool, which is supplied through the DataSource. My problem is that
 access to the DataSource is through the servlet.findDataSource() call.
 How do I make the Business Logic beans unaware of the servlet/http
 layer (as suggested in the developers guide) while still making the
 DataSource available to the Business Logic beans? Do I have to pass a
 reference to the DataSource on every call the Business Logic beans
 (not an option that I like), or is there a cleaner way to do this? I
 also have a similar issues with logging services.
 
 I believe that a common way to solve this problem is to bind the
 DataSource to a jndi service. I am using tomcat 3.2.1, and I don't
 believe that this functionality is supplied in either Tomcat or
 Struts.
 
 Thank You,
 Carles



Re: Strut Books

2001-03-13 Thread Ted Husted

Julia Reynolds wrote:
 Also, many people who visit this list need ammunition to convince
 their management to
 use the struts framework in an upcoming project, so a "Why do I need
 Struts" section with a compelling case study or two would be a good
 idea.

"Why You Need Struts" is also (now) a good subtitle to Jason Hunter's
seminal JSP critique. 

 http://www.servlets.com/soapbox/problems-jsp.html 

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



Fwd: [ANNOUNCE] JDBC tag library released

2001-03-17 Thread Ted Husted

Note: These tags are very easy to use with the Struts connection pool.

Simply give your datasource a "key" property in your Struts-config file,
and use the same key with the JDBC connection tag. 

  data-sources
  data-source
driverClass="org.gjt.mm.mysql.Driver"
   maxCount="4"
   minCount="2"
   password=""
url="jdbc:mysql://localhost/test"
   user="test"
key="DATASOURCE"
  /
  /data-sources

and in your JSP

sql:connection id="cn1" dataSource="DATASOURCE"/sql:connection

Viola! That's it!

(Or, if you're a purist, omit the key property and use:

sql:connection id="cn1" 
dataSource="%=org.apache.struts.action.Action.DATA_SOURCE_KEY%"
/sql:connection

whew!)

 Original Message 
From: Morgan Delagrange [EMAIL PROTECTED]
Subject: [ANNOUNCE] JDBC tag library released
To: taglibs-dev [EMAIL PROTECTED],taglibs-user
[EMAIL PROTECTED]

Taglibs is proud to announce the release of the JDBC
tag library!  For full details, visit the site:

 
http://jakarta.apache.org/taglibs/doc/jdbc-doc/intro.html

The JDBC tag library is designed for reading from and
writing to databases.  Features include:

  - Seamless support for multiple databases
  - Obtaining connections from Drivers, 
DataSources, and JNDI DataSources
  - Support for Statements and PreparedStatements
  - Automatic looping of ResultSets
  - And so much more!

Thanks to Rich Catlett, Glenn Nielsen, and most
especially Marius Scurtescu for their invaluable
contributions.

- Morgan Delagrange

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Re: Confusion : Usage of Struts

2001-03-21 Thread Ted Husted

 "Tewathia, Atul" wrote:
 What happens to javascript validations? Where do we fit them in the
 comlete picture?

Client-side validation using Javascript is on the list for Struts 1.1. 

David Winterfeldt has a very nice start on a package that does this at 

 http://home.earthlink.net/~dwinterfeldt/ .

I'm using it myself now. Highly recommended. It uses regular expressions
to create a Javascript that checks fields in the client (via onsubmit),
and then uses them again on the server-side, in case Javascript is not
available. 

After that, you can subclass the standard validation method and do any
other server-side validation in the usual way.

 Who takes care of whether is it a normal application or struts
 application. does the container do this ?

The Struts framework is used to create standard Web applications. Struts
provides a number of services internal to the Web application, many of
which you would otherwise have to write yourself, and the container
handles the rest. 

 If we have to code the struts-jsp and a corresponding bean for every
 form then where is the convenience ? Are we not trading one problem
 with another.

In practice, you usually end-up writing code for the equivalent of a
form bean anyway. Struts helps you focus that work to get the most out
of it.

 Under what circumstances do I need to extend ActionServlet and use
 that ?

People sometimes decide to do that for one reason or another, but in the
normal course it is not usually necessary.

 I have a gut feeling that struts application will be slow as it
 involves one extra component at the server side for every single GUI
 developed ?

In practice, you may actually have less code and fewer components in a
Struts application than an equally robust Web application using another
approach. 

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



Re: Struts, Trubine, Velocity, Expresso

2001-03-21 Thread Ted Husted

The best references for Struts, Turbine, and Velocity are probably: 

 http://www.mail-archive.com/general@jakarta.apache.org/msg00495.html 


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


and 

 http://jakarta.apache.org/velocity/ymtd/ymtd.html 

There's also an interesting chart at 


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


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



Re: How can a Struts Action developer best document the system for a JSP developer?

2001-03-23 Thread Ted Husted

This is not actually what you want, but I did start a simple, sample 
specification for a Struts application (based on the example). It's 
still just an unfinished rough draft, but available at 

 http://husted.com/about/struts/example-spec.html 

if you want to mine it for ideas.

Bryan Field-Elliot wrote:
 
 I am struggling right now with how to properly and efficently document
 my Struts application for my JSP developer (who is by no means a Java
 expert). Specifically, I want to document each Action as well as each
 ActionForm that I code, including things like:
 
 1. the pages I expect the user to have come from
 2. the pages to which I might forward, or redirect, the user after
 completing the action
 3. The beans I expect to be in place prior to submitting to my action
 4. The beans I will set up with values for the resulting JSP page to
 work with
 5. The errors (html:errors) I may set up
 
 And anything else that might be appropriate. I'd like to do so in a way
 that lets me rely on Javadoc, so that I can keep my documentation inside
 my code. Javadoc when used correctly will also let me do things like
 "see also" the Bean documentation (from the Action documentation).
 
 I am curious if anyone has developed a "template" action or bean, which
 makes best use of Javadoc and which I can cut-and-paste at the head of
 every one of my Action classes, etc?
 
 Thanks,
 Bryan



Re: db and forms

2001-03-23 Thread Ted Husted
nobody has time to answer them, but
 perhaps someone could share couple of his jsp/java files (along with
 struts-config.xml) that deal with relation db and forms similar to those I
 tried to describe above. Struts-example it's a good thing but more
 examples are even better.
 
 I would really appreciate any help.
 
 Thank you for your time.
 
 Best of luck.
 
 ___
 Do You Yahoo!?
 Get your free @yahoo.ca address at http://mail.yahoo.ca

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



Re: How to use html:errors ?

2001-03-24 Thread Ted Husted

Since Struts is a framework, there a number of inter-related parts that
work together, the error handling is a good example of that. 

When you detect an error in your Action, you need a way to display it to
the user. Since most Actions are not designed to be "views", this is a
problem. 

Struts solves this problem using four (count'em 4) components, the
ActionErrors class, the message resource, the SaveError method, and,
finally, the html:errors tag.

The ActionErrors class is a way to "log" an error. Rather have you embed
a string, the ActionErrors class lets you insert a message resource key.
This is the same resource that bean:message tag uses to provide
internationalization. The SaveError method puts your ActionError class
under a reserved key in the request context, where the html:error tag
can find it. 

In your Action, you would usually have code snippets that look like
this:

// grab a reference to the application resource collection
MessageResources messages = getResources(); 

// create a error message buffer
ActionErrors errors = new ActionErrors();

// process action 
// detect error

if (detect_error) {
errors.add(ActionErrors.GLOBAL_ERROR,new
ActionError("error.detected"));
}

// On error, return to input form
if (!errors.empty()) {
saveErrors(request, errors); // put the error(s) where the
htlm:error tag can find them
 return (new ActionForward(mapping.getInput())); // go home
}

If the error concerns a particular field on a form, you might also have
if (field_error) {
errors.add("field name",new ActionError("error.fieldname"));
}

An important thing to realize is that "error.fieldname" is not what the
tag will display. The html:error tag assumes that the strings are the
name of a key in your application's message resource, which might look
like this 

; application.properties
errors.header = ul
error.fieldname = liPassword required/li
error.detected = liDatabase not available/li
error.username = liThat username was not found/li
errors.footer =/ul

For more complex needs, ActionErrors can also use "replacement values"
to build customized messages, or to build messages from stock phrases. 

For more on these classes, see

 http://jakarta.apache.org/struts/api   

"Suriyanarayanan, Senthil Kumar" wrote:
 
 How do you make the errors shows up on the generated page.? Here is the code
 snapshot..
 
 LogonForm.java
 public ActionErrors validate(ActionMapping mapping, HttpServletRequest
 request)
 {
 if(password == null || !password.equals("password"))
 {
 ActionErrors aes = new ActionErrors();
 ActionError ae = new ActionError("Please type the
 valid password");
 aes.add("?", ae);
 return aes;
 }
 return null;
 }
 What should I put at the place of '?' in the above add method
 
 struts-config.xml
 
 form-beans
 form-bean name="logonForm" type="package.LogonForm"/
 /form-beans
 
   action-mappings
 !-- Logon Action --
 actionpath="/logon"
type="package.LogonAction"
scope="request"
name="logonForm"
validate="true"
input="/logon.jsp"
forward name="successpage" path="/success.jsp" /
 /action
   /action-mappings
 
 logon.jsp
 
 html:errors/
 html:form action="logon.do"
 UserId: html:text property="userId" size="15" maxlength="15"
 redisplay="false" /
 Password: html:password property="password" size="16"
 maxlength="16" redisplay="false" /
 html:submit/
 /html:form
 
 I saw one of the postings talking about saveErrors method. It belongs to
 Action Object, and I how do
 I get reference to action object from the validate method?
 
 Thanks in advance,
 Senthil Kumar.S



Jyve FAQ

2001-03-26 Thread Ted Husted

The Jakarta Jyve FAQ is still ailing, but the rights on my own account
are now working, and I can add, modify, and delete entries. I've already
posted the "Quickstart FAQ", and will start adding some more questions
as time allows. Of course, we hope that the Jyve installation will
eventually be repaired so that we can all maintain this "wiki-style" in
the future. 

 http://jakarta.apache.org:8080/jyve-faq/Turbine/screen/DisplayProjects


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



Re: Struts in WebSphere - VICTORY !!!!!!! - Addendum

2001-03-28 Thread Ted Husted

Thanks for posting this, Chris. 

I added it to the installation guide, and the Jyve FAQ. 

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



Re: JavaScript in Struts

2001-03-29 Thread Ted Husted

I've added these to our Jyve FAQ:

How Do I use Javascript in my Struts forms?
---

The relevant HTML tags provide support for the Javascript event handlers
onblur, onchange, onclick, ondblclick, onfocus, onkeydown, onkeypress,
onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup.

For more about Javascript events, see the Netscape Javascript Reference
guide 
http://developer.netscape.com/docs/manuals/communicator/jsref/evnt.htm
.

For more about HTML tags, see the Struts HTML Tag Guide 
http://developer.netscape.com/docs/manuals/communicator/jsref/evnt.htm
.

The Javascript itself can then be placed 

1. Inline, if it is simple enough, like onclick="history.go(-1)"
2. As a SCRIPT in your JSP
3. As an included SCRIPT src="my.js" in your JSP

Note that the Struts Javascript properties use all lowercase
identifiers, for XML compatibility. 


How Do I use Javascript to perform Validations in Struts?
-

The best way is using David Winderfeldt's Struts validator servlet
http://home.earthlink.net/~dwinterfeldt/. This provides seamless
client-side and server-side validation using regular expressions. 

Other than that, you can also attach other Javascript validation to the
Struts form fields using the provided properties for Javascript event
handling. Of course, these types of validations cannot be guaranteed if
a browser has Javascript turned off.

Why doesn't Struts provide it's own facility for regex or Javascript
validations?

It's on the TODO list for the 1.1 release. 



Is it possible to combine dynamic Javascript menu systems with Struts?
--

The challenge with doing this is that the JSP tags run on the server (as
the page is  being generated), while the JavaScript runs on the client
side.  To integrate the two, you need your tags (and other JSP code) to
dynamically generate the JavaScript functions themselves -- sort of
having a program write a program -- so that the JavaScript is customized
to your particular need on this particular page.

A very trivial example is the way that the html:form tag deals with
the "focus" attribute.  If you specify it, a dynamically generated bit
of JavaScript is created to set the input focus, which includes the name
of the field you want initial focus 
assigned to.

For a more comprehensive scenario, consider that for most menuing
systems you will need to configure the list of available options into a
JavaScript array or something.  You could use the logic:iterate tag to
render the elements that get set in the array's initialization
expression.

[Craig McClanahan]


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



Re: forward in struts-config.xml file

2001-03-29 Thread Ted Husted

 syntax :  forward name="advanced"  path=""/

What I do is put in the actual name for the forward, and then point the
path to an "under construction page" where I also list any beta-testing
issues. 

As the pages come online, you simply need to update the configuration
file -- all the forward links remain the same.

So I have a sections in my struts-config that looks like this:

 forward name="help"path="/help/index.jsp"/
 forward name="helpBid" path="/issues.jsp"/
 forward name="helpDonate"  path="/issues.jsp"/
 forward name="helpFacts"   path="/issues.jsp"/

and so forth. (Issues is my "under construction" page.)

The forward and action names should actually be considered part of the
requirements process. If you've built a "straw man" version of the
application, you can usually define them all from that.

I haven't gotten there myself yet, but I have heard of people having
well over a 100 action classes in a Struts applications. 

"Nanduri, Amarnath" wrote:
 
 Hi everybody,
 
I am faced with a unique situation. I have at present 45 Action
 classes in my project. In the future this number may climb to more than 100
 ( yeah it is a huge project). We just completed requirements and want to
 make sure that struts can really handle such a heavy load (flow). For some
 of the forwards in the struts_config.xml file there is not yet a defined
 stage as to where to take the user to. For that reason the path is set to an
 empty string.
 
 syntax :  forward name="advanced"  path=""/
 
 During the demo i noticed that i get a 404 error when trying to reach this
 page (which is as it should be). I want to keep an indefined state page to
 these. My problem is that i don't want to write the 'undefined.jsp' in each
 and every forward (i confess i am lazy, besides it is dull and monotonous).
 I want to know if there is a flag i can set in the struts-config.xml which
 defines a global undefined state (similar to the 'unknown' attribute for an
 action class). Please note that the forward names are different (in
 different actions). So i can't use a single global forward.
 
 Now if one of you gurus out there can find me a  solution i would greatly
 appreciate it.
 
 cheers,
 Amar..

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



Re: need some explaination with logon.do

2001-03-29 Thread Ted Husted

First, be sure that you have followed the "tour" that comes with the
example. There's a small link on the first page. 

The "do" pages are "action mappings". When the Struts ActionServlet is
registered with the container, it asks for the "do" pages. The
ActionServlet then refers to the mappings defined in the struts-config
file to call the appropriate Action class. The Action class is not
really a page, but it does have access to the ActionServlet, and so can
create a HTTP response, or forward control on to a JSP. 

"Charlemagne L. Rey" wrote:
 
 Hello everybody,
 
 I think I still don't understand how did the struts-example flows.
 Could anybody please give me an explaination of what is happening
 to have the virtual page logon.do? Who created this page? How this
 page come-up?  It is here where I am stocked up with my learning
 of the Jakarta Struts.
 Any help will be greatly appreciated.
 
 Thank you.
 Charlemagne Rey

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



Re: downloadable javadoc

2001-03-29 Thread Ted Husted

Absolutely everything is in the source distribution.

Burr Sutter wrote:
 
 Is there a downloadable version of the javadoc for Struts (found online at
 http://jakarta.apache.org/struts/api/index.html)?
 
 I normally like to keep these things on the local disk for offline work.
 
 Burr

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



Re: MySQL

2001-03-30 Thread Ted Husted

I use Mark Matthew's driver  http://mmmysql.sourceforge.net/ , which
works well with Resin (and everything else under the sun). Caucho even
puts it in their own examples.

 James Bell wrote:
 
 Hi everyone
 
 I want to use MySQL with Struts.  Although not a Struts specific
 question, what jdbc driver is the best to use.  I downloaded the
 driver from caucho and noticed that it was marked as experimental.  I
 know that may mean that it is still a good driver.  But I would like
 an independent opionion.
 
 Thanks in Advance
 James Bell



Re: .properties file

2001-03-30 Thread Ted Husted

I believe the message resource is implemented as a hashmap. The resource
is loaded into memory for each locale (when 1 or more users need it),
and so storing a relatively big amount of text this way may be unwise. 

You want to determine the locale within your view and then display or
include the alternate text that way. I would then document the other
text files as comments in the application resource file, so that it is
still the master reference to the i18n text. You might even store the
reference to an include file in the application resource and read it
back to determine the user's locale.

Yuriy Zubarev wrote:
 
 Hello friends,
 
 I was wondering if there is a way to store a relatively big amount of text
 (which can't be fitted in one single line) assigned to some variable in
 the ApplicationResources.properties file. This text eventually will be
 local-sensitive that's why I want to put it into the .properties file.
 
 Thank you for your time.
 
 Best of luck,
 Yuriy Zubarev
 
 ___
 Do You Yahoo!?
 Get your free @yahoo.ca address at http://mail.yahoo.ca

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



Re: JUNIT and Struts

2001-03-30 Thread Ted Husted

Vincent and Ron have been working on some things. Take a look at the
web/test directory in the nightly build.

Vincent is also in midst of donating J2EEUnit to Apache/Jakarta. Yeah
Vincent!

 Padma Ginnaram wrote:
 Is there a sample available for testing struts with j2eeunit



Re: SSL and Struts

2001-04-11 Thread Ted Husted

I'm finding a similar problem with Resin - under SSL it connects fine
but the html:link tags resolve to a /a. 

I tried adding the handler at the command line (as also recommended by
http://java.sun.com/products/jsse/INSTALL.html - item 7). 

java -Djava.protocol.handler.pkgs=com.sun.net.ssl.internal.www.protocol

but got the standard help screen in return, like I used an invalid
option, although -Dname=value is listed as an option. 

I'm using 

java version "1.3.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)

And a Thawte certificate (PKCS #7 Certificate Chain format).

The jsse.jar is in my /jre/lib/ext directory, and everything not
involving hyperlinks seems fine.

Any ideas why this didn't take at the command line? If not, I guess the
next thing to try would be to subclass ActionServlet, extend init, and
try it at runtime.

(BTW, it seems that Catalina adds this protocol automatically, but
apparently other containers are not so clever ;-)

Dan Miser wrote:
 
 Here's the reply I just posted on Bugzilla about this:
 
 This isn't a bug of Struts, but a misconfiguration of SSL. In addition to
 the comments in Tomcat's server.xml, you need to define a system property to
 tell Java where it should find the classes for SSL support. You can do this
 either in code (System.setProperty(key, value)) or by passing the property
 in on the command line (-Dkey=value). This is the property I used with JSSE,
 and it works fine.
 
 java.protocol.handler.pkgs = com.sun.net.ssl.internal.www.protocol
 
 If anything, I would argue that the bug here is to report the
 MalformedURLException in RequestUtils.absoluteURL to a log file.
 
 Dan Miser
 
 From: "Michael Wilimsky" [EMAIL PROTECTED]
 Reply-To: [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: SSL and Struts
 Date: Tue, 10 Apr 2001 17:54:48 +0200
 
 i tried to establish a SSL-Connection with Tomcat / Struts using openSSL
 
 but when using https protocol url-rewriting seems to fail somehow... is
 there a solution for that...
 
 p.s. i am working on a w2k machine with ie5
 
 michael



Re: REPOST: How to code and use the html:image tag?

2001-04-13 Thread Ted Husted

The property and value for the button is passed as a parameter
(property=value), that you can retrieve from the request context. 

A typical approach would be to give each button the same property but
different values, like 

html:image page="/images/login.gif" alt="Login" property="login"
value="havePassword" /
html:image page="/images/forgotpassword.gif" alt="Forgot Password"
property="login" value="forgotPassword" /

Then in the action method, you would use a pattern like 

string loginType = request.getParameter("login") ;
if loginType.equals(""forgotPassword") { forward to forgotPassword page
} 
if loginType.equals("havePassword") { validate password  } 

"Suriyanarayanan, Senthil Kumar" wrote:
 What methods should I code inside my LoginForm corresponding to those two
 buttons? How to code the properties (loginButton, forgotPasswordButton). I'm
 more concerned about whether a particular button is clicked rather then
 their co-ordinates.



Re: Loggig Mechanism in Struts

2001-04-13 Thread Ted Husted

Scott Ganyo wrote:
 P.S. Shouldn't the other Jakarta projects (Struts, Tomcat, etc.) do the
 same?

That would be up to the individual Committers to each Jakarta project.
Them that does the work makes the decisions.

In general, I would say a framework like Struts should provide for
different logging technologies to be plugged in, but to standardize on
any particular implementation --- ahhh, that way lies Borg ;-)


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



Re: [Fwd: FW: REPOST: How to code and use the html:image tag?]

2001-04-13 Thread Ted Husted

You're right. This doesn't seem to be working. I'd report it as a bug. 

 http://nagoya.apache.org/bugzilla/ 

[EMAIL PROTECTED] wrote:
 
  Ted,
 I tried this with no success. I put two html:image tags into my
 login.jsp
 
 trtd/tdtdhtml:image page="/images/lanikai.jpg" property =
 "login" value="lanikai" /td/tr
 trtd/tdtdhtml:image page="/images/larry.jpg" property = "login"
 value="larry" /td/tr
 
 In the perform method of LoginAction.java I traverse the Enumeration
 returned by request.getParameters() looking for a parameter named login.
 It's not there. :-(
 
 Here's the code:
 
java.util.Enumeration enum = request.getParameterNames();
 while( enum.hasMoreElements() ){
 String str = (String) enum.nextElement();
 System.out.println( str + " = " + request.getParameter( str
 ) );
 
 }
 and the output:
 
 course = pebblebeach
 login.y = 147
 login.x = 129
 
 I have a html:select named course set to pebblebeach. I DO get the
 mouseclick x and y values. So, I'm seeing something from my login
 control.
 
 I don't see what I'm doing wrong.
 
 thanks
 
 john ware
 
 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 13, 2001 12:59 PM
 To: [EMAIL PROTECTED]
 Subject: Re: REPOST: How to code and use the html:image tag?
 
 The property and value for the button is passed as a parameter
 (property=value), that you can retrieve from the request context.
 
 A typical approach would be to give each button the same property but
 different values, like
 
 html:image page="/images/login.gif" alt="Login" property="login"
 value="havePassword" /
 html:image page="/images/forgotpassword.gif" alt="Forgot Password"
 property="login" value="forgotPassword" /
 
 Then in the action method, you would use a pattern like
 
 string loginType = request.getParameter("login") ;
 if loginType.equals(""forgotPassword") { forward to forgotPassword page
 }
 if loginType.equals("havePassword") { validate password  }
 
 "Suriyanarayanan, Senthil Kumar" wrote:
  What methods should I code inside my LoginForm corresponding to those two
  buttons? How to code the properties (loginButton, forgotPasswordButton).
 I'm
  more concerned about whether a particular button is clicked rather then
  their co-ordinates.

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



Re: [Fwd: FW: REPOST: How to code and use the html:image tag?]

2001-04-13 Thread Ted Husted

I'm getting the same result with Netscape 4.7 and IE 5.5 -- so if the
browser react to the input image, like the submit button, but do not
pass the value the same way, then the only alternative seems to be to
examine the x:y parameters, and use those to determine which button was
pressed. 

If that's the case, I'll work a note into the Developer's Guide. 

Zhengxi Ruan wrote:
 
 it is not a bug of Struts, but the browser's.
 
 Jesse
 
 -Original Message-
 From: Ted Husted [mailto:[EMAIL PROTECTED]]
 Sent: Friday, April 13, 2001 7:52 PM
 To: [EMAIL PROTECTED]
 Subject: Re: [Fwd: FW: REPOST: How to code and use the html:image tag?]
 
 You're right. This doesn't seem to be working. I'd report it as a bug.
 
  http://nagoya.apache.org/bugzilla/ 
 
 [EMAIL PROTECTED] wrote:
 
   Ted,
  I tried this with no success. I put two html:image tags into my
  login.jsp
 
  trtd/tdtdhtml:image page="/images/lanikai.jpg" property =
  "login" value="lanikai" /td/tr
  trtd/tdtdhtml:image page="/images/larry.jpg" property = "login"
  value="larry" /td/tr
 
  In the perform method of LoginAction.java I traverse the Enumeration
  returned by request.getParameters() looking for a parameter named login.
  It's not there. :-(
 
  Here's the code:
 
 java.util.Enumeration enum = request.getParameterNames();
  while( enum.hasMoreElements() ){
  String str = (String) enum.nextElement();
  System.out.println( str + " = " + request.getParameter( str
  ) );
 
  }
  and the output:
 
  course = pebblebeach
  login.y = 147
  login.x = 129
 
  I have a html:select named course set to pebblebeach. I DO get the
  mouseclick x and y values. So, I'm seeing something from my login
  control.
 
  I don't see what I'm doing wrong.
 
  thanks
 
  john ware
 
  -Original Message-
  From: Ted Husted [mailto:[EMAIL PROTECTED]]
  Sent: Friday, April 13, 2001 12:59 PM
  To: [EMAIL PROTECTED]
  Subject: Re: REPOST: How to code and use the html:image tag?
 
  The property and value for the button is passed as a parameter
  (property=value), that you can retrieve from the request context.
 
  A typical approach would be to give each button the same property but
  different values, like
 
  html:image page="/images/login.gif" alt="Login" property="login"
  value="havePassword" /
  html:image page="/images/forgotpassword.gif" alt="Forgot Password"
  property="login" value="forgotPassword" /
 
  Then in the action method, you would use a pattern like
 
  string loginType = request.getParameter("login") ;
  if loginType.equals(""forgotPassword") { forward to forgotPassword page
  }
  if loginType.equals("havePassword") { validate password  }
 
  "Suriyanarayanan, Senthil Kumar" wrote:
   What methods should I code inside my LoginForm corresponding to those
 two
   buttons? How to code the properties (loginButton, forgotPasswordButton).
  I'm
   more concerned about whether a particular button is clicked rather then
   their co-ordinates.
 
 -- Ted Husted, Husted dot Com, Fairport NY USA.
 -- Custom Software ~ Technical Services.
 -- Tel 716 737-3463.
 -- http://www.husted.com/about/struts/



Re: Struts TagLibs

2001-04-13 Thread Ted Husted

Both projects started about the same time. 

Check the archive on the Developer's list for a recent thread
(mail-archive.com). 

Rajan Gupta wrote:
 
 I am looking for all type of tags such as equal, iterate etc related to
 logic  presentation.
 Just out of curiosity why did u not decide to use TagLibs instead of
 building your own, were TagLibs were not sufficient or were not available
 when u started on your project.



<    4   5   6   7   8   9   10   11   12   13   >