Validator - Javascript question

2004-08-11 Thread Ratnakar Parakala

Hi, 

I tried to write custom validation rule called "identical". But, if I give oIdentical 
= new identical(); I didn't get any client side alert messages. Hope this statement 
doesn't generate necessary javascript code when the rule is configured and executed. 
I'm using Struts 1.2.1 (Beta). Could sombody tell me the use of oTwoFields = new 
twofields(); statement and how struts uses this statement to generate client side 
javascript. 

Thanx in advance, 

Ratnakar


-
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!

Re: Struts - passing unicode parameter from jsp to action

2004-08-11 Thread Pavel Kolesnikov
On Thu, 12 Aug 2004, Masoud Kalali wrote:

> I  use post for sending parameter to action and also add
> (request.setCharacterEncoding("UTF-8");
> to my action before reading parameter from it , also i add two 

You should better call request.setCharacterEncoding() in
a filter or overriden ActionServlet's method process().

Request parameters are read when ActionServlet prepares form
instances - it happens before your Action is called.

> difinition on my jsp page <%request.setcharacterEncoding("UTF-8");%>

I think you have no reason to put this call in your JSP.

Pavel

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



Re: [OT] DAO ... where to draw the line?

2004-08-11 Thread Navjot Singh
hi matthew,
I wont say that you go with one or other of your approaches.
It depends upon type of assosciation that 2 entities may share. They may 
have aggregation or composition relationship. Depending on that your DAO 
implementation will decide that you need to get ONLY id or the composite 
objects.

Let me explain.
Say you have class named ORDER ad ORDER_DETAILS. (consists-of 
relationship) Order without order details is nothing. So you may get the 
OrderDetails object as well when you get Order.

Now say you have EMPLOYEE and DEPARTMENT. (has-a relationship) EMPLOYEE 
*may* still exists with or without department. So you may get only id of 
department and later fetch the department.

Think in employee table, you have relationship (reports-to). If you 
specify this relation as composition, you may go on fetching the objects 
all the way up to the organization chart ;-)

Do i make sense?
Navjot Singh
-Original Message-
From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 8:21 AM
To: Struts Users Mailing List
Subject: [OT] DAO ... where to draw the line?

[OFF TOPIC]
I know this is a struts forum, but as struts developers using DAOs, 
where do your DAO implementation draw the line? 

For example:
Let''s say I have three tables:
Employee (contains employee_id, employee_name,  and dept_id)
Department (contains dept_id, dept_name, loc_id)
Location (contains loc_id, location_name)
How deep do your classes go to replicate the data? 

Do you do this...
public class Employee {
   private int id;
   private String name;
   private int deptId;   // just the id
   // .. implementation details
}
or do you do this
public class Employee {
   private int id;
   private String name;
   private Department dept;  // all of the data
   // .. implementation details
}
and so on and so on.   Class Department has the same type of problem.  
Does it hold just the id for location or a variable class Location?

Should DAOs just fill in the id (keys) so it is up to the application 
using the DAOs to get the Employee class, then the Department class, and 
the the Location class like:

Employee emp = EmployeDAO.getEmployee(1);
Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
Location loc = LocationDAO.getLocation(dept.getLocId());
System.out.println(emp.getEmpName() + " works in " + loc.getLocationName());
or
Employee emp = EmployeDAO.getEmployee(1);
System.out.println(emp.getEmpName() + " works in " + 
emp.getDept().getLoc().getLocationName());

Now this is just a simple example, but where do you draw the line?  It's 
possible to go on and on and on and cycle back to employee...

Any thoughts, links, tips, best practices, whatvere would be helpful!
Thanks!
Matt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
.
 

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


Re: HTTP Compression (Struts)

2004-08-11 Thread Navjot Singh
unless you have special reasons why do you wish to burden struts or web 
app with everything?

why not use mod_gzip with apache and put tomcat/xyz behind apache?
it gives good compression and you can define compression or no 
compression based on mime types.

regards
Navjot Singh
Nathan Maves wrote:
Yeah a lot of people.  There was a thread on this very topic last week 
please check the archive before posting :)

http://marc.theaimsgroup.com/?l=struts-user&m=109183678222344&w=2
Nathan
On Aug 11, 2004, at 4:17 AM, Shailender Jain wrote:
Hi,
Has anybody used Http Compression technique for a web application
developed using Struts Framework.
Please provide the information
Shailender Jain
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


Struts - passing unicode parameter from jsp to action

2004-08-11 Thread Masoud Kalali
hi friends,  i have problem with sending unicode parameter to my action 
from jsp page
I  use post for sending parameter to action
and also add
(request.setCharacterEncoding("UTF-8");
to my action before reading parameter from it , also i add two 
difinition on my jsp page <%request.setcharacterEncoding("UTF-8");%>
and  which both of them set content and encoding of my jsp 
pages to utf-8 but i istill could not use my parameter , thier encoding 
seems to be " ISO  Latin-1 " . while i type unicode characters in my 
text are at jsp page.
I use Websphere as APPS , is it a problem of Websphere?
or i should make some changes?

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


RE: I have a form spread over several pages. The user fills out each section in progression. I am using a dispatch action and each page calls the same function i.e. processForm. I want struts to validate each submission but I cannot change the input page

2004-08-11 Thread Kataria, Satish
Ok I got what u r saying.
What I am trying to say is that you have a single Action class but
multiple action mappings(one per page) and since you can configure input
setting at action mapping level therefore it will solve ur problem
Structure of code will be

public class Actionclass extends org.apache.struts.action.DispatchAction
{
--method1 for page1
--method2 for page2
---



And so on
}



Struts-config.xml



And so on for each page


Hope it helps

Satish

-Original Message-
From: teknokrat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 6:45 PM
To: [EMAIL PROTECTED]
Subject: Re: I have a form spread over several pages. The user fills out
each section in progression. I am using a dispatch action and each page
calls the same function i.e. processForm. I want struts to validate each
submission but I cannot change the input page


Kataria, Satish wrote:
> I am suggesting that you should have a single action having a method
for
> each of the page. This can be configured by using DispatchAction class
> and configured in struts-config.xml using the attribute "parameter"
for
> finding which of the method to execute.

I get you. This is what we have currently, the problem is that when the 
validation ( on say page 5 ) fails the user gets sent back to page one 
because only one input page parameter is allowed per action definition 
(in struts-config).  It seems to me you still have to define a separate 
action path for each page you want validated (though it would map to a 
particular function in your DispatchAction ) .


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

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



Re: Struts and encoding

2004-08-11 Thread Masoud Kalali
hi friends,
I  add
(request.setCharacterEncoding("UTF-8"); to my action before reading parameter from it , also i add two difinition on my jsp page 
<%request.setcharacterEncoding("UTF-8");%>
and  which both of them set content and encoding of my jsp pages to utf-8 
but i istill could not use my parameter , thier encoding seems to be " ISO  Latin-1 " . while i type unicode characters in my text are at jsp page.
I use Websphere as APPS , is it a problem of Websphere?
or i should make some changes?



Václavík Radek wrote:
Are you sending the form using POST method?
Do you set request encoding in your action before reading the parameter
value? - (request.setCharacterEncoding("UTF-8");
Do you have the content type of jsp set to UTF-8? - <%@ page
contentType="text/html;charset=UTF-8" language="java" %>
Radek
 

-Original Message-
From: Masoud Kalali [mailto:[EMAIL PROTECTED]
Sent: Monday, August 09, 2004 7:59 PM
To: Struts Users Mailing List
Subject: Struts and encoding
Hi friends
I have a problem with Struts / Jsp
when i send a paramete from a jsp to my action (by using formBean)
It seems that character encoding of my parameter changes , is it true?
my prameter is UTF-8 , but in action it seems that its 
encoding changed 
to iso Latin-1

is there any solution for this?
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

 


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


FileUpload questions

2004-08-11 Thread Victor.T.Ying
Hi all,
   I have a question about the controller parameters
for file upload,I have to upload a file upto 100M,but
when I use the following settings to upload a small
file,the App server seems to be slow and consume a lot
of memory so that I have to set JVM heap to a larger
size,I am not sure which parameter can be
adjusted.Anyone knows 
what's the best setting from performance point of
view.
Thanks.


   
 




__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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



Page expired warning on history.go(-1) Internet Explorer

2004-08-11 Thread Ajay Katre
I have a struts action URL http://myhost.mydomain.com/myapp/myaction.do

It is a non-secure page. The form action is HTTP-POST.

On submitting this form it displays the results. On results page I've a Back button 
with javascript: window.history.go(-1); 

Sometimes it gives "Warning: Page has expired" error. This is not consistently 
reproducible.

Error has been confirmed to be intermittent with Internet Explorer 6.0 browser.

Any information about this error and fix.

Thanks in advance,

ajay.


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



Re: test

2004-08-11 Thread Shinobu Kawai

Hi all,

> test
You know what?  I was thinking about that too. ;-)
http://sourceforge.net/project/showfiles.php?group_id=39190
# Haven't really got the knack of it yet, though...

Have fun,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]>


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



Re: [OT] HTML and Email Client: Eudora

2004-08-11 Thread Shinobu Kawai

Hi Michael,

> I am trying to see the tags in list emails, but the code is not showing 
> up.  I am using Eudora.  As much as I scout around I cannot find the 
> problem.  Anyone know what it is?
Sorry, I don't know anything about Eudora.  But are you talking about
HTML email?  Then my advise is to encourage those people not to send
them.  Makes everybody happier that way.
cf. http://jakarta.apache.org/site/mail.html

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED], [EMAIL PROTECTED]>


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



test

2004-08-11 Thread BOU Hou
test
(B
(B__
(BGANBARE! NIPPON!
(BYahoo! JAPAN JOC OFFICIAL INTERNET PORTAL SITE
(Bhttp://mail.ganbare-nippon.yahoo.co.jp/
(B
(B
(B-
(BTo unsubscribe, e-mail: [EMAIL PROTECTED]
(BFor additional commands, e-mail: [EMAIL PROTECTED]

[OT] HTML and Email Client: Eudora

2004-08-11 Thread Michael McGrady
I am trying to see the tags in list emails, but the code is not showing 
up.  I am using Eudora.  As much as I scout around I cannot find the 
problem.  Anyone know what it is?

Michael 


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


[OT] test

2004-08-11 Thread Michael McGrady
test

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


RE: html:javascript problem

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Erik Weber [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 4:17 PM
> To: Struts Users Mailing List
> Subject: Re: html:javascript problem
> 
> 
> Jim, I assume you meant
> 
> 
> 
> and not
> 
> 
> 
> right?

Well.. I copied mine out of Struts In Action, so yours is probably right.. :)

> 
> I tried this to no effect.
> 
> I have
> 
> 
>   . . .
> 
> 
> 
> Still no worky . . . Did I misunderstand you?

No, the key bit of magic it looked like you were missing was the onsubmit bit of magic.
So, whatever puts the validateBlahForm(this) on the page is what you want.. and then 
call it.. Considering that SIA is an interesting mix of 1.1 and 1.2 you might want 
to look at the javascript being generated and make sure the you're onsubmit is calling 
the right javascript function.



> 
> Erik
> 
> 
> 
> Jim Barrows wrote:
> 
> >  
> >
> >>-Original Message-
> >>From: Erik Weber [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, August 11, 2004 3:51 PM
> >>To: Struts Users Mailing List
> >>Subject: html:javascript problem
> >>
> >>
> >>I am using the validator plugin, specifying all my validation in 
> >>validation.xml.
> >>
> >>I want to use the automatic javascript generation feature to add 
> >>client-side validation.
> >>
> >>My form page is basically like this:
> >>
> >>. . .
> >>
> >>
> >>
> >>
> >
> >This one is not easy to find... which sucks.. I knew what I 
> was looking for and couldn't find it.. anyway...
> >
> >
> >blah blah
> > >
> >
> >
> >
> >
> >  
> >
> >>. . .
> >>
> >>
> >>
> >>When the page is rendered, I can view source and see the javascript 
> >>function is seemingly properly rendered, and the function 
> >>name matches 
> >>up with that called in the onsubmit attribute, yet if I 
> >>submit a blank 
> >>form, I don't get any alerts -- the form submits.
> >>
> >>I'm not sure how to debug this since the javascript is generated 
> >>dynamically; I suppose I could edit validator-rules.xml to 
> >>put alerts in?
> >>
> >>Anything I am obviously doing wrong or forgetting here? I'm 
> not very 
> >>good with javascript, but I was hoping to avoid pasting the 
> function 
> >>because it's quite lengthy.
> >>
> >>I tried moving the html:javascript tag around to different 
> >>places -- at 
> >>the top of the page, just above the form, just inside the 
> >>form, doesn't 
> >>seem to make any difference. I do have other (non-generated) 
> >>javascript 
> >>functions working.
> >>
> >>If you don't see anything wrong so far I'll paste a snip of 
> the page 
> >>source from the browser (Mozilla 1.7).
> >>
> >>
> >>Erik
> >>
> >>
> >>
> -
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >>
> >>
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >  
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



Re: html:javascript problem

2004-08-11 Thread Erik Weber
Jim, I assume you meant

and not

right?
I tried this to no effect.
I have

 . . .



Still no worky . . . Did I misunderstand you?
Erik

Jim Barrows wrote:
 

-Original Message-
From: Erik Weber [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 3:51 PM
To: Struts Users Mailing List
Subject: html:javascript problem
I am using the validator plugin, specifying all my validation in 
validation.xml.

I want to use the automatic javascript generation feature to add 
client-side validation.

My form page is basically like this:
. . .

   

This one is not easy to find... which sucks.. I knew what I was looking for and 
couldn't find it.. anyway...

blah blah


 

. . .

When the page is rendered, I can view source and see the javascript 
function is seemingly properly rendered, and the function 
name matches 
up with that called in the onsubmit attribute, yet if I 
submit a blank 
form, I don't get any alerts -- the form submits.

I'm not sure how to debug this since the javascript is generated 
dynamically; I suppose I could edit validator-rules.xml to 
put alerts in?

Anything I am obviously doing wrong or forgetting here? I'm not very 
good with javascript, but I was hoping to avoid pasting the function 
because it's quite lengthy.

I tried moving the html:javascript tag around to different 
places -- at 
the top of the page, just above the form, just inside the 
form, doesn't 
seem to make any difference. I do have other (non-generated) 
javascript 
functions working.

If you don't see anything wrong so far I'll paste a snip of the page 
source from the browser (Mozilla 1.7).

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

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

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


RE: html:javascript problem

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Erik Weber [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 3:51 PM
> To: Struts Users Mailing List
> Subject: html:javascript problem
> 
> 
> I am using the validator plugin, specifying all my validation in 
> validation.xml.
> 
> I want to use the automatic javascript generation feature to add 
> client-side validation.
> 
> My form page is basically like this:
> 
> . . .
> 
> 

This one is not easy to find... which sucks.. I knew what I was looking for and 
couldn't find it.. anyway...


blah blah





> 
> . . .
> 
> 
> 
> When the page is rendered, I can view source and see the javascript 
> function is seemingly properly rendered, and the function 
> name matches 
> up with that called in the onsubmit attribute, yet if I 
> submit a blank 
> form, I don't get any alerts -- the form submits.
> 
> I'm not sure how to debug this since the javascript is generated 
> dynamically; I suppose I could edit validator-rules.xml to 
> put alerts in?
> 
> Anything I am obviously doing wrong or forgetting here? I'm not very 
> good with javascript, but I was hoping to avoid pasting the function 
> because it's quite lengthy.
> 
> I tried moving the html:javascript tag around to different 
> places -- at 
> the top of the page, just above the form, just inside the 
> form, doesn't 
> seem to make any difference. I do have other (non-generated) 
> javascript 
> functions working.
> 
> If you don't see anything wrong so far I'll paste a snip of the page 
> source from the browser (Mozilla 1.7).
> 
> 
> Erik
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



html:javascript problem

2004-08-11 Thread Erik Weber
I am using the validator plugin, specifying all my validation in 
validation.xml.

I want to use the automatic javascript generation feature to add 
client-side validation.

My form page is basically like this:
. . .

. . .

When the page is rendered, I can view source and see the javascript 
function is seemingly properly rendered, and the function name matches 
up with that called in the onsubmit attribute, yet if I submit a blank 
form, I don't get any alerts -- the form submits.

I'm not sure how to debug this since the javascript is generated 
dynamically; I suppose I could edit validator-rules.xml to put alerts in?

Anything I am obviously doing wrong or forgetting here? I'm not very 
good with javascript, but I was hoping to avoid pasting the function 
because it's quite lengthy.

I tried moving the html:javascript tag around to different places -- at 
the top of the page, just above the form, just inside the form, doesn't 
seem to make any difference. I do have other (non-generated) javascript 
functions working.

If you don't see anything wrong so far I'll paste a snip of the page 
source from the browser (Mozilla 1.7).

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


RE: Importing context with Struts

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Leandro Melo [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 2:13 PM
> To: struts jakarta
> Subject: Re: Importing context with Struts
> 
> 
> Jim,
> as i said i have a page with only one line of code,
> wich is the error page.
> It only has this:
> 
> 

Try this instead of html:errors:








If that works then you can mangle the html however you want of course.

> 
> Suppose now we want to register a company in the
> application, i got then an form with all the necessary
> inputs in a page registercompanycustominforeq.jsp.
> Here's the page for registering.

We have the same setup.. the differenece being that mines working,and yours isn't.  So 
if we start looking for differences.. one is that i'm using the code above instead of 
.  I would have sworn that's what I was using for dumping my error 
messages.  Another would be the way we're generating these messages... I use the 
Struts validation stuff, so it does it all automagically.




> 
> 
>   <%@ include
> file="/functionalBlocks/companyHTMLcomponent.jsf" %>
> 
> 
> The user sees the following definition when he's
> filling the company info.
>  name=".PartyPlace.RegisterCompanyCustomInfoReq"
> extends=".PartyPlace">
>value="/register/registercompanycustominforeq.jsp"/>
>value="/pageComments/registercompanycustominforeq_PAGECOMMENT.jsp"/>
>value="/functionalSideBars/registercompany_SideBar.jsp"/>
> 
> 
> If your remember, the base class ".PartyPlace" has
> already inserts the error page.
> 
> I don't know what you meant about "WHat scope are
> your errors beign put in?". How do i find out that?
> 
> The only thing i know is if the user request is
> blocked in validation, my html:errors tag doesn't show
> anything.
> BUT, if i place the html:errors tag inside the page
> with the registercompanycustominfo action, it works
> fine.
> In other words, if i modify my
> registercompanycustominforeq.jsp to this:
> 
> 
>   <%@ include
> file="/functionalBlocks/companyHTMLcomponent.jsf" %>
> 
> 
> Everything works!!! The errors tag works.
> 
> 
> 
> > OKay... I have the exact same setup, and validation
> > works just fine with this setup.  The one thing I'm
> > not doing is the ${name} that you are, but that
> > shouldn't make a difference at all.  WHat scope are
> > your errors beign put in?  That could be an issue.
> > 
> > Here's my base layout:
> >  > path="/layout/layout2.jsp">
> >  > />
> >  
> > 
> > 
> > 
> > 
> > 
> >  > value="/showPaymentHistory.do?detail=summary"/>
> > 
> > 
> > 
> > 
> >   
> > 
> >  
> >  
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > 
> > > Here's the simple
> > > /functionalBlocks/errorHTMLcomponent.jsp page:
> > > <%@ taglib uri="/WEB-INF/struts-html.tld"
> > > prefix="html"%> 
> > > 
> > > 
> > > 
> > > I have a page for registering company data, wich
> > is
> > > part of the following definition:
> > > > > name=".PartyPlace.RegisterCompanyCustomInfoReq"
> > > extends=".PartyPlaceSideBar">
> > >> >
> > value="/register/registercompanycustominforeq.jsp"/>
> > >> >
> >
> value="/pageComments/registercompanycustominforeq_PAGECOMMENT.jsp"/>
> > >> >
> >
> value="/functionalSideBars/registercompany_SideBar.jsp"/>
> > >
> > > 
> > > 
> > > The registercompanycustominforeq.jsp page is the
> > > following one:
> > > 
> > >   <%@ include
> > > file="/functionalBlocks/companyHTMLcomponent.jsf"
> > %>
> > >   <%@ include
> > > file="/functionalBlocks/buttonsHTMLcomponent.jsf"
> > %>
> > > 
> > > 
> > > 
> > > 
> > > NOTE that the tag html:errors is not in
> > > registercompanycustominforeq.jsp page, it's in the
> > > errorHTMLcomponent.jsp page (as i showed).
> > > When i submit a request the hits the validate
> > method,
> > > it comes back, but i cannot see the error because
> > the
> > > html:errors tag is in another page.
> > > That's why i wanted to import the Struts
> > context...
> > > However, if there's a Tiles way to workaround
> > that,
> > > please, would you explain it to me?
> > > Maybe with some code... 
> > > 
> > > Thank you very much,
> > > ltcmelo
> > > 
> > > 
> > > 
> > > 
> > > 
> > > > > -Original Message-
> > > > > From: Michael McGrady
> > > > [mailto:[EMAIL PROTECTED]
> > > > > Sent: Tuesday, August 10, 2004 3:51 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: RE: Importing context with Struts
> > > > > 
> > > > > 
> > > > > I thought that digester actually created
> > classes
> > > > out of this 
> > > > > stuff, Jim.  No?
> > > > 
> > > > Not quite the defintiion file gets turned
> > into
> > > > 

Re: Multiple image tags

2004-08-11 Thread Michael McGrady
You got it, Leandro.
You end up doing with this solution what the LookupDispatchAction does with 
less overhead, less of a footprint, and without all the coupling to the 
framework.  I put the solution on the Struts wiki, and a pretty good 
programmer actually suggested using this solution and adding it to 
LookupDispatchAction.  That really confounded me.

What's your first language?  Don't say Java!  LOL
Michael
At 01:46 PM 8/11/2004, you wrote:
Michael,
i think i understand your point now!
If my english let get the point correctly, i realized
that if i have an ordinary Action, and have such
method that finds out what was the value of the image
tag (using your getCommand function) and delegate
(probably with an "if") the processing of the request
to the responsible method, i'll end up doing just what
DispatchAction and LookupDispatchAction does. This way
your solution certainly works perfectly.
Is that it?
Thank you again,
ltcmelo
> Let me try again on this, Leandro, as much for
> myself as for you.  The
> LookupDIspatchAction, which I don't care for, only
> gives you one thing: a
> promise that the page author will have to use a
> particular name for the
> parameter name to be used in the Action for deciding
> which method to
> use.  That is it.  So, somehow the page author has
> to provide a value for
> the parameter name you specify in your
> LookupDispatchAction action mapping
> xml parameter attribute.  Thus, if you use
> parameter='method' in your
> action mapping xml, then you can know that using
> 'method' in your "hidden"
> values in the form will work.  You can also know, of
> course, that you then
> MUST use the request parameter 'method' in your
> form.  You can do the same
> thing without giving the parameter attribute of your
> action mapping any
> value at all.  You merely have to coordinate the
> page hidden parameter name
> and the parameter name mined in the Action.  The use
> of the parameter
> attribute in the action mapping MERELY forces the
> page author to conform to
> your requirements in the Action class, which then
> becomes the
> DispatchAction class or LookupDispatchActino class.
>
> The whole point of using an image tag solution is to
> (1) get out of a
> Struts specific solution to this "age old" problem
> and to (2) provide a
> solution to the need to make a switch in the
> processing of an action.  The
> ".x" and ".y" in the parameter names of an image tag
> operate just like the
> parameter attribute of the action mapping for the
> LookupDispatchAction and
> DispatchAction.  The difference is that it is not
> Struts specific and is a
> "worldwide" standard.  The code which follows, viz.
>
> public final class ButtonCommand {
>private ButtonCommand() {
>}
>public final static String
> getCommand(HttpServletRequest request) {
>  Enumeration enum = request.getParameterNames();
>  String parameterName = null;
>  while(enum.hasMoreElements()) {
>parameterName = (String)enum.nextElement();
>if(parameterName.endsWith(".x")) {
>  return
>
parameterName.substring(0,parameterName.indexOf('.'));
>}
>  }
>  return parameterName;
>}
> }
>
> simply does this using image tags instead of hidden
> parameters in the
> form.  You can, of course, just copy the method
> getCommand into your
> processing helper classes in the model.
>
> Does this ring any bells?
>
> Michael McGrady
>
> At 08:09 PM 8/10/2004, you wrote:
> >The problem is that both solutions in a higher
> level
> >focus on getting the parameter and checking it out
> to
> >see its value.
> >
> >In my case, i got a MyLookupDispatchAction that
> >receives all the requests and forwards it to the
> >specific method. So, there's no meanwhile to get
> the
> >request parameter, check it out and forward to some
> >method.
> >
> >UNLESS,
> >i use someking of hidden field in the form with a
> name
> >that MyLookupDispatchAction expects:
> >
> >protected Map getKeyMethodMap(){
> >Map map = new HashMap();
> >map.put("hidden.field",
> "verifyParameterMethod");
> >}
> >
> >And the in the "verifyParameterMethod()", i'd use
> call
> >
> >"getCommand(HttpServletRequest request)" to check
> what
> >was the value of the real parameter i want (the one
> >from the image tag). Finally, i would compare this
> >value and forward the data to the responsible
> method.
> >Am i correct?
> >
> >
> >It just seems a little confusing...


___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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

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


Re: Importing context with Struts

2004-08-11 Thread Leandro Melo
Jim,
as i said i have a page with only one line of code,
wich is the error page.
It only has this:



Suppose now we want to register a company in the
application, i got then an form with all the necessary
inputs in a page registercompanycustominforeq.jsp.
Here's the page for registering.


  <%@ include
file="/functionalBlocks/companyHTMLcomponent.jsf" %>


The user sees the following definition when he's
filling the company info.

  
  
  


If your remember, the base class ".PartyPlace" has
already inserts the error page.

I don't know what you meant about "WHat scope are
your errors beign put in?". How do i find out that?

The only thing i know is if the user request is
blocked in validation, my html:errors tag doesn't show
anything.
BUT, if i place the html:errors tag inside the page
with the registercompanycustominfo action, it works
fine.
In other words, if i modify my
registercompanycustominforeq.jsp to this:

  
  <%@ include
file="/functionalBlocks/companyHTMLcomponent.jsf" %>


Everything works!!! The errors tag works.



> OKay... I have the exact same setup, and validation
> works just fine with this setup.  The one thing I'm
> not doing is the ${name} that you are, but that
> shouldn't make a difference at all.  WHat scope are
> your errors beign put in?  That could be an issue.
> 
> Here's my base layout:
>  path="/layout/layout2.jsp">
>  />
>
> 
>   
> 
> 
>   
>value="/showPaymentHistory.do?detail=summary"/>
>   
>   
>   
>   
> 
>   
>
>
>   
>   
>   
>   
>   
> 
> 
> 
> > 
> > Here's the simple
> > /functionalBlocks/errorHTMLcomponent.jsp page:
> > <%@ taglib uri="/WEB-INF/struts-html.tld"
> > prefix="html"%> 
> >   
> > 
> > 
> > I have a page for registering company data, wich
> is
> > part of the following definition:
> > > name=".PartyPlace.RegisterCompanyCustomInfoReq"
> > extends=".PartyPlaceSideBar">
> >  >
> value="/register/registercompanycustominforeq.jsp"/>
> >  >
>
value="/pageComments/registercompanycustominforeq_PAGECOMMENT.jsp"/>
> >  >
>
value="/functionalSideBars/registercompany_SideBar.jsp"/>
> >
> > 
> > 
> > The registercompanycustominforeq.jsp page is the
> > following one:
> > 
> > <%@ include
> > file="/functionalBlocks/companyHTMLcomponent.jsf"
> %>
> > <%@ include
> > file="/functionalBlocks/buttonsHTMLcomponent.jsf"
> %>
> > 
> > 
> > 
> > 
> > NOTE that the tag html:errors is not in
> > registercompanycustominforeq.jsp page, it's in the
> > errorHTMLcomponent.jsp page (as i showed).
> > When i submit a request the hits the validate
> method,
> > it comes back, but i cannot see the error because
> the
> > html:errors tag is in another page.
> > That's why i wanted to import the Struts
> context...
> > However, if there's a Tiles way to workaround
> that,
> > please, would you explain it to me?
> > Maybe with some code... 
> > 
> > Thank you very much,
> > ltcmelo
> > 
> > 
> > 
> > 
> > 
> > > > -Original Message-
> > > > From: Michael McGrady
> > > [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, August 10, 2004 3:51 PM
> > > > To: Struts Users Mailing List
> > > > Subject: RE: Importing context with Struts
> > > > 
> > > > 
> > > > I thought that digester actually created
> classes
> > > out of this 
> > > > stuff, Jim.  No?
> > > 
> > > Not quite the defintiion file gets turned
> into
> > > one java bean per definition.  These java beans
> are
> > > then used to pull the parts together for the
> tags (
> > > paraphrased from SIA Chap 11.1 pg 324).
> > > Since all jsp files are converted to a servlet
> > > first, then compiled, I would tend to say that
> all
> > > the jsps being declared in a tile definition
> being
> > > in the same class couldn't happen... however I
> can't
> > > seem to find out where websphere puts it's
> working
> > > stuff *SIGH* to verify this I can't say for
> sure.
> > > 
> > > However, after digging through the tiles code I
> came
> > > across this:
> > >
> >
>
http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org
> >
>
/apache/struts/tiles/TilesUtilImpl.java?rev=1.9&view=markup
> > > The part that answers the question:
> > >  public void doInclude(
> > > String uri,
> > > HttpServletRequest request,
> > > HttpServletResponse response,
> > > ServletContext servletContext)
> > > throws IOException, ServletException {
> > > 
> > >
> > >
> request.getRequestDispatcher(uri).include(request,
> > > response);
> > > }
> > > Which means no. all those jsp files are
> _NOT_
> > > compiled into one big huge class. they are
> > > individual servlets in keeping with the spec.
> > > 
> > > 
> > > > 
> > > > At 03:23 PM 8/10/2004, you wrote:
> > > > 
>

Re: Multiple image tags

2004-08-11 Thread Leandro Melo
Michael,
i think i understand your point now!
If my english let get the point correctly, i realized
that if i have an ordinary Action, and have such
method that finds out what was the value of the image
tag (using your getCommand function) and delegate
(probably with an "if") the processing of the request
to the responsible method, i'll end up doing just what
DispatchAction and LookupDispatchAction does. This way
your solution certainly works perfectly.
Is that it?

Thank you again,
ltcmelo

 
> Let me try again on this, Leandro, as much for
> myself as for you.  The 
> LookupDIspatchAction, which I don't care for, only
> gives you one thing: a 
> promise that the page author will have to use a
> particular name for the 
> parameter name to be used in the Action for deciding
> which method to 
> use.  That is it.  So, somehow the page author has
> to provide a value for 
> the parameter name you specify in your
> LookupDispatchAction action mapping 
> xml parameter attribute.  Thus, if you use
> parameter='method' in your 
> action mapping xml, then you can know that using
> 'method' in your "hidden" 
> values in the form will work.  You can also know, of
> course, that you then 
> MUST use the request parameter 'method' in your
> form.  You can do the same 
> thing without giving the parameter attribute of your
> action mapping any 
> value at all.  You merely have to coordinate the
> page hidden parameter name 
> and the parameter name mined in the Action.  The use
> of the parameter 
> attribute in the action mapping MERELY forces the
> page author to conform to 
> your requirements in the Action class, which then
> becomes the 
> DispatchAction class or LookupDispatchActino class.
> 
> The whole point of using an image tag solution is to
> (1) get out of a 
> Struts specific solution to this "age old" problem
> and to (2) provide a 
> solution to the need to make a switch in the
> processing of an action.  The 
> ".x" and ".y" in the parameter names of an image tag
> operate just like the 
> parameter attribute of the action mapping for the
> LookupDispatchAction and 
> DispatchAction.  The difference is that it is not
> Struts specific and is a 
> "worldwide" standard.  The code which follows, viz.
> 
> public final class ButtonCommand {
>private ButtonCommand() {
>}
>public final static String
> getCommand(HttpServletRequest request) {
>  Enumeration enum = request.getParameterNames();
>  String parameterName = null;
>  while(enum.hasMoreElements()) {
>parameterName = (String)enum.nextElement();
>if(parameterName.endsWith(".x")) {
>  return
>
parameterName.substring(0,parameterName.indexOf('.'));
>}
>  }
>  return parameterName;
>}
> }
> 
> simply does this using image tags instead of hidden
> parameters in the 
> form.  You can, of course, just copy the method
> getCommand into your 
> processing helper classes in the model.
> 
> Does this ring any bells?
> 
> Michael McGrady
> 
> At 08:09 PM 8/10/2004, you wrote:
> >The problem is that both solutions in a higher
> level
> >focus on getting the parameter and checking it out
> to
> >see its value.
> >
> >In my case, i got a MyLookupDispatchAction that
> >receives all the requests and forwards it to the
> >specific method. So, there's no meanwhile to get
> the
> >request parameter, check it out and forward to some
> >method.
> >
> >UNLESS,
> >i use someking of hidden field in the form with a
> name
> >that MyLookupDispatchAction expects:
> >
> >protected Map getKeyMethodMap(){
> >Map map = new HashMap();
> >map.put("hidden.field",
> "verifyParameterMethod");
> >}
> >
> >And the in the "verifyParameterMethod()", i'd use
> call
> >
> >"getCommand(HttpServletRequest request)" to check
> what
> >was the value of the real parameter i want (the one
> >from the image tag). Finally, i would compare this
> >value and forward the data to the responsible
> method.
> >Am i correct?
> >
> >
> >It just seems a little confusing...






___
Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! Acesse: 
http://br.acesso.yahoo.com/

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



Re:

2004-08-11 Thread Kishore Senji
You might be getting a ClassCastException, because, you might be using
Struts 1.1, and adding a ActionMessage to ActionErrors and using the
 tag. The tag assumes ActionError object, so, when it
tries to cast your ActionMessage to ActionError, that's where you run
in to ClassCastException. So, instead of  use
 in the way shown below.


errors.add("name", new ActionMessage("user.name.empty.error"));

In jsp use, 
 
   


Kishore Senji.

On Wed, 11 Aug 2004 13:08:14 -0400, Laran Evans <[EMAIL PROTECTED]> wrote:
> When I use  I get a ClassCastException.  So I used
>  which displayed nothing, but worked.
> 
> ActionErrors doesn't accept ActionError objects any longer (deprecated),
> just ActionMessage objects.
> 
> What's the consensus on the correct way to display 
> currently?
> 
> IA
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Struts security/validation

2004-08-11 Thread Brett Connor
Craig McClanahan wrote:
On Wed, 11 Aug 2004 10:32:04 -0700, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
 

I had a similar problem, which I discovered when one of my users tried to
enter a street address containing an apostrophe. Since I use apostrophes to
delineate my text strings in my SQL statements, this caused a database
error. I fixed it by not allowing apostrophes to be entered into any of the
test fields.
   

I hope you never have a customer named O'Reilly :-).
 

I admit this is overly restrictive, but I don't know how to get the
apostrophe into my database otherwise. How would you do it Craig?
For SQL destined test, I disallow \ and '.
   

If I'm doing the SQL myself, I always use prepared statements:
 

Absolutely. PreparedStatement is always the way to go, depending on the 
database you'll get a couple of performance gains also.

 String streetAddress = "..."; // String may have "\" and "'" characters in it
 PreparedStatement stmt = conn.prepareStatement
   ("UPDATE CUSTOMER SET STREET_ADDRESS=? WHERE CUSTID=?");
 stmt.setString(1, streetAddress);
 stmt.setInt(2, custId);
 stmt.executeUpdate();
and let the JDBC driver take care of getting the sensitive characters
escaped as needed.
 

In fact the drivers should not (again implementation specific) need to 
do any escaping, the statement and data are seperate entities. The 
statement will still contain ? (or equivalent) in the rdbms.

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


Re: custom transactions

2004-08-11 Thread Brett Connor
Woodchuck wrote:
hihi,
this is my scenario:
- container managed pooling (Tomcat 4.1.24)
- jdbc (PreparedStatement objects)
- wrapping my own transactions by autoCommit(false), and issuing
commit() manually
i'm running into a table-lock situation after DELETE statements.  i'm
using the same Connection object for multiple PreparedStatement
objects.  my plan is to call commit() at the end.  but when i reach a
PreparedStatement that is doing a DELETE, the code stops and does not
continue with the rest of the other PreparedStatement objects.
is this the nature of DELETE statements?  that we cannot continue
further without first committing it immediately?  or is this possible
and there is something else wrong?
how can i handle a 'custom transaction' that contains many INSERTS,
UPDATES, DELETE statements in random order?
thanks in advance!
 

Woodchuck wrote:
hihi,
this is my scenario:
- container managed pooling (Tomcat 4.1.24)
- jdbc (PreparedStatement objects)
- wrapping my own transactions by autoCommit(false), and issuing
commit() manually
i'm running into a table-lock situation after DELETE statements.  i'm
using the same Connection object for multiple PreparedStatement
objects.  my plan is to call commit() at the end.  but when i reach a
PreparedStatement that is doing a DELETE, the code stops and does not
continue with the rest of the other PreparedStatement objects.
is this the nature of DELETE statements?  that we cannot continue
further without first committing it immediately?  or is this possible
and there is something else wrong?
how can i handle a 'custom transaction' that contains many INSERTS,
UPDATES, DELETE statements in random order?
 

There is nothing fundamentally wrong with what you describe. If you have 
conflicting locks or changes between transactions (typically 
connections) then any DML statement can potentially hang up. What 
database are you using? Are you testing it with just one session? My 
first suspision would be the connection pooling, especially if this is 
failing with only a single session active. Perhaps try disabling that 
for a test.

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


Re: using tiles with dynamic links

2004-08-11 Thread Brett Connor
Brett Connor wrote:
David Stevenson wrote:
On 11/8/04 6:18, "Michael McGrady" <[EMAIL PROTECTED]> wrote:
I loved those competitions in perl that tried to
be the hardest to understand.   

Competitions? I've seen C ones (the 12 days of Xmas one is a 
classic), but
truly idiomatic Perl is self-obfuscating!

Let's not get into language wars, eh?  I did Perl then, I do Java now, I
want to keep legacy content, but integrate it with the tiles-based
templating if possible.
Still, got a few ideas out of this thread

Uh? How!? :-)

Ah, and _now_ the rest of the thread arives in my inbox. Up until this 
point I had seen only conversations on the correct name for soccer / 
football, and terse reply competitions. All very entertaining, but had 
me a little confused.

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


ot: pgSQL goes windows native

2004-08-11 Thread Vic Cekvenich
My favirite SQL engine on the level of Oracle but free:
http://developer.postgresql.org/beta.php
.V
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE:

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Laran Evans [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 12:15 PM
> To: Struts Users Mailing List
> Subject: Re: 
> 
> 
> So would it be my best bet to follow 
> http://husted.com/struts/tips/017.html?


More then likely.  If you look at the 1.2 javadocs at 
http://struts.apache.org/api/index.html you might be better able to tell what's going 
to work for you.



> 
> Jim Barrows wrote:
> 
> >>-Original Message-
> >>From: Tom Kane [mailto:[EMAIL PROTECTED]
> >>Sent: Wednesday, August 11, 2004 11:38 AM
> >>To: [EMAIL PROTECTED]
> >>Subject: RE: 
> >>
> >>
> >>
> >>
> -Original Message-
> From: Laran Evans [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 10:08 AM
> To: Struts User Mailing List
> Subject: 
> 
> 
> 
> 
> >>One main difference between the method in the archive and my 
> >>method is that
> >>I put the "errors" object into the session instead of the 
> >>request.  The
> >>reason is that all my actions redirect to their respective 
> >>.jsp pages to
> >>avoid the user re-running an action simply by refreshing the 
> >>page (e.g. a
> >>'create' action). 
> >>I think that anything stored in the 
> >>request is lost by
> >>the time the action is redirected.  I put "errors" in the 
> >>session instead.
> >>One problem with this is that the "errors" object remains in 
> >>the session so
> >>any subsequent visits to the page display errors.  Since an 
> >>error redirects
> >>the user right back to the same page, I think I may remove 
> >>the "errors"
> >>object from the session as soon as the form is submitted.
> >>
> >>My questions are:
> >>
> >>1) Do I need to put "errors" in the session so that it survives the
> >>redirection long enough to be displayed?
> >>
> >>
> >
> >More then likely.. try it and see.  You're reasons for 
> redirection kind of bother me.. I've never run into a 
> situation where a refresh submits a form twice, but then 
> again I haven't run into every situation.
> >
> >  
> >
> >>2) Do I need to use  inside an  tag to output
> >>messages?  Is it the only way?
> >>
> >>
> >
> >Nope, you can use  >
> >  
> >
> >>3) Is it considered bad form to use ActionErrors?  I don't 
> >>want to build
> >>dependencies on soon-to-be-deprecated stuff.
> >>
> >>
> >
> >Depends... for struts 1.1 no, for struts 1.2 yes.  If you're 
> planning on migrating soon... up to you.
> >
> >
> >
> >-
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >  
> >
> 

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



Re:

2004-08-11 Thread Laran Evans
So would it be my best bet to follow http://husted.com/struts/tips/017.html?
Jim Barrows wrote:
-Original Message-
From: Tom Kane [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 11:38 AM
To: [EMAIL PROTECTED]
Subject: RE: 
   

-Original Message-
From: Laran Evans [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 10:08 AM
To: Struts User Mailing List
Subject: 
   

One main difference between the method in the archive and my 
method is that
I put the "errors" object into the session instead of the 
request.  The
reason is that all my actions redirect to their respective 
.jsp pages to
avoid the user re-running an action simply by refreshing the 
page (e.g. a
'create' action). 
I think that anything stored in the 
request is lost by
the time the action is redirected.  I put "errors" in the 
session instead.
One problem with this is that the "errors" object remains in 
the session so
any subsequent visits to the page display errors.  Since an 
error redirects
the user right back to the same page, I think I may remove 
the "errors"
object from the session as soon as the form is submitted.

My questions are:
1) Do I need to put "errors" in the session so that it survives the
redirection long enough to be displayed?
   

More then likely.. try it and see.  You're reasons for redirection kind of bother 
me.. I've never run into a situation where a refresh submits a form twice, but then 
again I haven't run into every situation.
 

2) Do I need to use  inside an  tag to output
messages?  Is it the only way?
   

Nope, you can use 

 

3) Is it considered bad form to use ActionErrors?  I don't 
want to build
dependencies on soon-to-be-deprecated stuff.
   

Depends... for struts 1.1 no, for struts 1.2 yes.  If you're planning on migrating 
soon... up to you.

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



Re:

2004-08-11 Thread Niall Pemberton
Since ActionError extends ActionMessage then I don't think this is true.
When I converted a current app to Struts 1.2.x I'm sure it all still worked
with ActionError - I have now changed all ActionError to ActionMessage so
that I don't get all the "deprecated" warnings. Can you post your stack
trace with the ClassCastException?

Niall


- Original Message - 
From: "Laran Evans" <[EMAIL PROTECTED]>
To: "Struts User Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 11, 2004 6:08 PM
Subject: 


> When I use  I get a ClassCastException.  So I used
>  which displayed nothing, but worked.
>
> ActionErrors doesn't accept ActionError objects any longer (deprecated),
> just ActionMessage objects.
>
> What's the consensus on the correct way to display 
> currently?
>
> IA
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>



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



RE:

2004-08-11 Thread Jim Barrows
> -Original Message-
> From: Tom Kane [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 11:38 AM
> To: [EMAIL PROTECTED]
> Subject: RE: 
> 
> 
> >> -Original Message-
> >> From: Laran Evans [mailto:[EMAIL PROTECTED]
> >> Sent: Wednesday, August 11, 2004 10:08 AM
> >> To: Struts User Mailing List
> >> Subject: 
> >> 
> >> 
> 
> One main difference between the method in the archive and my 
> method is that
> I put the "errors" object into the session instead of the 
> request.  The
> reason is that all my actions redirect to their respective 
> .jsp pages to
> avoid the user re-running an action simply by refreshing the 
> page (e.g. a
> 'create' action). 
> I think that anything stored in the 
> request is lost by
> the time the action is redirected.  I put "errors" in the 
> session instead.
> One problem with this is that the "errors" object remains in 
> the session so
> any subsequent visits to the page display errors.  Since an 
> error redirects
> the user right back to the same page, I think I may remove 
> the "errors"
> object from the session as soon as the form is submitted.
> 
> My questions are:
> 
> 1) Do I need to put "errors" in the session so that it survives the
> redirection long enough to be displayed?

More then likely.. try it and see.  You're reasons for redirection kind of bother me.. 
I've never run into a situation where a refresh submits a form twice, but then again I 
haven't run into every situation.

> 2) Do I need to use  inside an  tag to output
> messages?  Is it the only way?

Nope, you can use  3) Is it considered bad form to use ActionErrors?  I don't 
> want to build
> dependencies on soon-to-be-deprecated stuff.

Depends... for struts 1.1 no, for struts 1.2 yes.  If you're planning on migrating 
soon... up to you.



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



RE:

2004-08-11 Thread Hubert Rabago

--- Tom Kane <[EMAIL PROTECTED]> wrote:
> My questions are:
> 
> 1) Do I need to put "errors" in the session so that it survives the
> redirection long enough to be displayed?

That's one way to do it.  In support of this, Struts 1.2.x has what's called
"Session-scoped ActionMessages".  See the release notes. 
http://struts.apache.org/userGuide/release-notes.html .  
Another way is to pass the errors as a redirect parameter, which is what I
do.  I wrote some extension classes which I include in my projects for this
purpose.  If you're interested, lemme know.

> 2) Do I need to use  inside an  tag to output
> messages?  Is it the only way?

The standard code I've seen actually has  because that's the tag
that comes with Struts, but  works, too, as you've discovered.

> 3) Is it considered bad form to use ActionErrors?  I don't want to build
> dependencies on soon-to-be-deprecated stuff.
> 

ActionErrors will be deprecated in 1.2 and removed in a future version.  If
you're still using 1.1, though, I don't think you have a choice since the
methods these will only work with ActionErrors.  

> Laran: hope that helps
> Everyone else: hope you help me
> 
> -tom
> 

- Hubert




__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



Re: using tiles with dynamic links

2004-08-11 Thread Brett Connor
David Stevenson wrote:
On 11/8/04 6:18, "Michael McGrady" <[EMAIL PROTECTED]> wrote:
 

I loved those competitions in perl that tried to
be the hardest to understand.
   

Competitions? I've seen C ones (the 12 days of Xmas one is a classic), but
truly idiomatic Perl is self-obfuscating!
Let's not get into language wars, eh?  I did Perl then, I do Java now, I
want to keep legacy content, but integrate it with the tiles-based
templating if possible.
Still, got a few ideas out of this thread
 

Uh? How!? :-)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE:

2004-08-11 Thread Tom Kane
>> -Original Message-
>> From: Laran Evans [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, August 11, 2004 10:08 AM
>> To: Struts User Mailing List
>> Subject: 
>> 
>> 
>> When I use  I get a ClassCastException.  So I used 
>>  which displayed nothing, but worked.
>> 
>> ActionErrors doesn't accept ActionError objects any longer 
>> (deprecated), just ActionMessage objects.
>> 
>> What's the consensus on the correct way to display  
>> currently?
>
>NOt sure about how common this is, but Husted has a cool tip: 
>http://husted.com/struts/tips/017.html
>

I found this in the struts mailing list archives which may be helpful to
you: 
http://marc.theaimsgroup.com/?l=struts-user&m=108757076826525&w=2

I'm also confused about the preferred method of displaying errors after the
deprecation of ActionError.  Armed with the knowledge from the archive I did
the following:

Here's the short version; code follows.  (Note: I'm using Struts 1.1)

In the action: I create an ActionMessages object called "errors". For each
new error I add an ActionMessage to "errors" with the field as the key
("username" in the following case).  I then store the ActionMessages object
as an attribute called "errors" in the session.  

In the .jsp page: I output each error next to its respective field in the
form.  Each error's key is the same as its field name.



Say we have a form with a 'username' field.

In SubmitFormAction.java :

public ActionForward execute(ActionMapping mapping, 
ActionForm form,
HttpServletRequest request, 
HttpServletResponse response)
throws Exception {

ActionMessages errors = new ActionMessages();

...

if ( isBad(username) ) {
errors.add("username", new ActionMessage("error.bad_username"));
}

...

if ( !errors.isEmpty() ) {
request.getSession().setAttribute("errors", errors);
return (mapping.findForward("error"));
} 

return (mapping.findForward("success"));
}

In form.jsp:

User Name: 





The output is:
User Name:  



One main difference between the method in the archive and my method is that
I put the "errors" object into the session instead of the request.  The
reason is that all my actions redirect to their respective .jsp pages to
avoid the user re-running an action simply by refreshing the page (e.g. a
'create' action).  I think that anything stored in the request is lost by
the time the action is redirected.  I put "errors" in the session instead.
One problem with this is that the "errors" object remains in the session so
any subsequent visits to the page display errors.  Since an error redirects
the user right back to the same page, I think I may remove the "errors"
object from the session as soon as the form is submitted.

My questions are:

1) Do I need to put "errors" in the session so that it survives the
redirection long enough to be displayed?
2) Do I need to use  inside an  tag to output
messages?  Is it the only way?
3) Is it considered bad form to use ActionErrors?  I don't want to build
dependencies on soon-to-be-deprecated stuff.

Laran: hope that helps
Everyone else: hope you help me

-tom


Re: Struts security/validation

2004-08-11 Thread Kishore Senji
Jakarta commons lang String Escape Utils has a set of utility methods
for escaping xml, html, sql, java, javascript ...
http://jakarta.apache.org/commons/lang/apidocs/org/apache/commons/lang/StringEscapeUtils.html

Kishore Senji.


On Wed, 11 Aug 2004 10:41:13 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: Wiebe de Jong [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 10:32 AM
> > To: 'Struts Users Mailing List'
> > Subject: RE: Struts security/validation
> >
> >
> > I had a similar problem, which I discovered when one of my
> > users tried to
> > enter a street address containing an apostrophe. Since I use
> > apostrophes to
> > delineate my text strings in my SQL statements, this caused a database
> > error. I fixed it by not allowing apostrophes to be entered
> > into any of the
> > test fields.
> >
> > I admit this is overly restrictive, but I don't know how to get the
> > apostrophe into my database otherwise. How would you do it Craig?
> 
> I'd change them to their HTML equivalents.. however I've found that using the 
> prepared sql statements eliminates the interpretation problem you've outlined.
> 
> 
> 
> >
> > For SQL destined test, I disallow \ and '.
> > For XML destined text, I disallow <, >, &, \, and ".
> >
> > Wiebe de Jong
> >
> > -Original Message-
> > From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 10:21 AM
> > To: Struts Users Mailing List
> > Subject: Re: Struts security/validation
> >
> > On Wed, 11 Aug 2004 14:45:05 +0100, James Adams
> > <[EMAIL PROTECTED]> wrote:
> > > Hello all,
> > >
> > > I'm in the process of trying to secure my struts application against
> > "Cross site scripting", "SQL injection" style attacks.
> > >
> > > One of the things I'm doing to prevent this is trying to
> > restrict special
> > characters (;.<>(){}...etc) getting beyond the validator.
> > >
> >
> > Just thinking out loud for a moment ...
> >
> > Cross site scripting attacks don't happen when sensitive characters
> > are inside an *input* field.  The problem comes if you *output* the
> > data without filtering for them.  That's why the Struts 
> > tag, for example, filters "<", ">", "&", and ";" for you unless you
> > explicitly tell it not to, so if you are diligent about how you copy
> > your database data to output pages, you can safely accept these kinds
> > of character in input.
> >
> > I notice that Kishore Senji (one of the other respondents in this
> > thread) is using Google's Gmail, just as I am at the moment.  Since
> > this is a web application, it's a good thing that Googe isn't
> > disallowing the magic characters on input into a textarea, or else we
> > would not be able to participate in this conversation :-).
> >
> > Is filtering input really the appropriate strategy for dealing with
> > this problem?  If successful it will certainly help, but the approach
> > strikes me as overly restrictive for most application needs.
> >
> > Craig
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



extending the html:select tag

2004-08-11 Thread Wiebe de Jong

I am having trouble extending the struts html:select tag, and I hope
somebody can help me.

Naill's example at http://www.niallp.pwp.blueyonder.co.uk/#errortag shows
how to extend the text tag. I used it to extend the password tag with no
problem.

However, when I use the same method to extend the select tag, I get a
runtime error. It seems to die even before the constructor is called.

So, how do you debug tags and does anyone have a solution to make this work?

Wiebe de Jong



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



RE: Problem depoying struts-blank.war

2004-08-11 Thread Martin Gainty
Jim-
found this on the archives-
validation.xml does not conform to your DTD
http://www.mail-archive.com/[EMAIL PROTECTED]/msg01486.html
HTH,
Martin Gainty
(cell) 617-852-7822
(e) [EMAIL PROTECTED]


From: "Jim Barrows" <>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Subject: RE: Problem depoying struts-blank.war
Date: Wed, 11 Aug 2004 08:53:44 -0700
MIME-Version: 1.0
Received: from mail.apache.org ([209.237.227.199]) by mc1-f18.hotmail.com 
with Microsoft SMTPSVC(5.0.2195.6824); Wed, 11 Aug 2004 08:54:22 -0700
Received: (qmail 44335 invoked by uid 500); 11 Aug 2004 15:53:50 -
Received: (qmail 44275 invoked by uid 99); 11 Aug 2004 15:53:49 -
Received: from [12.34.77.106] (HELO SSSC-MAIL-2.internal.sssc.com) 
(12.34.77.106)  by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 11 Aug 2004 
08:53:46 -0700
X-Message-Info: JGTYoYF78jFA4AKLaAHhE2C1nXMAlPiM
Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
Precedence: bulk
List-Unsubscribe: 
List-Subscribe: 
List-Help: 
List-Post: 
List-Id: "Struts Users Mailing List" 
Delivered-To: mailing list [EMAIL PROTECTED]
X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=
X-Spam-Check-By: apache.org
content-class: urn:content-classes:message
X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1
Message-ID: 
<[EMAIL PROTECTED]>
X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem depoying 
struts-blank.war
Thread-Index: AcR/ujhiZ2ZYXXt1SjKOVJEPyaY5IQAARnCw
X-Virus-Checked: Checked
Return-Path: [EMAIL PROTECTED]
X-OriginalArrivalTime: 11 Aug 2004 15:54:22.0526 (UTC) 
FILETIME=[78304DE0:01C47FBB]


> -Original Message-
> From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:45 AM
> To: [EMAIL PROTECTED]
> Subject: Problem depoying struts-blank.war
>
>
> I am trying to teach myself Struts while writing a real
> application.
> I followed an tutorial that said to start by putting the
> struts-blank.war in the webapps directory of Tomcat 5.  Unfortunately,
> here's what I got:
Which version of struts did you get the struts-blank.war from?  This is 
awfully odd.


>
>
>
> Aug 11, 2004 8:24:50 AM
> org.apache.struts.util.PropertyMessageResources
> 
>
> INFO: Initializing,
> config='org.apache.webapp.admin.ApplicationResources', retur
>
> nNull=true
>
> Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> install
>
> INFO: Processing Context configuration file URL
> file:C:\tomcat50\conf\Catalina\l
>
> ocalhost\balancer.xml
>
> Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> install
>
> INFO: Processing Context configuration file URL
> file:C:\tomcat50\conf\Catalina\l
>
> ocalhost\manager.xml
>
> Aug 11, 2004 8:24:56 AM org.apache.catalina.core.StandardHostDeployer
> install
>
> INFO: Installing web application at context path
> /struts-blank from URL
> file:C:/
>
> tomcat50/webapps/struts-blank
>
> Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> initDefinitionsFacto
>
> ry
>
> INFO: Tiles definition factory loaded for module ''.
>
> Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> initResource
>
> s
>
> INFO: Loading validation rules file from
> '/WEB-INF/validator-rules.xml'
>
> Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> initResource
>
> s
>
> INFO: Loading validation rules file from '/WEB-INF/validation.xml'
>
> Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
>
> SEVERE: Parse Error at line 45 column 15: The content of element type
> "formset"
>
> is incomplete, it must match "(constant*,form+)".
>
> org.xml.sax.SAXParseException: The content of element type
> "formset" is
> incomple
>
> te, it must match "(constant*,form+)".
>
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
>
> known Source)
>
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> Source)
>
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
>
> at
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
>
> ource)
>
> at
> org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> Source)
>
>
>
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
>
> n Source)
>
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
>
> Dispatcher.dispatch(Unknown Source)
>
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
>
> known Source)
>
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
>
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>
>

RE: Taglibs generating lots of warning messages

2004-08-11 Thread David Friedman
I used to turn on/off the logging for various modules (or everything) using
the commons logging.   Check that out.  I used SimpleLog and turned
everything off.  Then, I used debug or info for the modules I'm interested
in.
http://jakarta.apache/org/commons/logging

I think I turned it all off in my simplelog.properties file using:
org.apache.commons.logging.simplelog.log.org.apache.struts=none
But you could set it to "info", "debug", etc.

I setup up commons logging to use the simplelog by creating a
simplelog.properties file like so:

org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
org.apache.commons.logging.simplelog.defaultlog=debug
org.apache.commons.logging.simplelog.showlogname=true
org.apache.commons.logging.simplelog.showdatetime=true

Regards,
David

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 11:32 AM
To: Struts Users Mailing List
Subject: RE: Taglibs generating lots of warning messages




> -Original Message-
> From: Andy Schmidgall [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 7:06 PM
> To: Struts Users Mailing List
> Subject: RE: Taglibs generating lots of warning messages
>
>
> Does anyone know anything about this? This is generating HUGE
> catalina.out files, and I would really like to use log4j to
> catch these
> rather than having to build and/or configure yet another app just to
> rotate this one file...

No idea... tried to figure out how to reproduce this but couldn't.  Almost
sounds like one of the struts jar files is mildly corrputed, but don't know
for sure.




>
> Thanks,
> Andy
>
> -Original Message-
> From: Andy Schmidgall
> Sent: Wednesday, August 04, 2004 4:57 PM
> To: Struts Users Mailing List
> Subject: Taglibs generating lots of warning messages
>
>
> Hello,
>
> In our Struts app, whenever a JSP uses taglibs, the following
> 4 messages
> are produced for each taglib referenced:
>
> ---
> ParserUtils: warning org.xml.sax.SAXParseException: missing system ID,
> using http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
> ParserUtils: warning org.xml.sax.SAXParseException: URI was
> not reported
> to parser for entity [document]
> ParserUtils: warning org.xml.sax.SAXParseException: No base URI; hope
> URI is absolute:
http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
ParserUtils: warning org.xml.sax.SAXParseException: No base URI; hope
this SYSTEM id is absolute:
http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
---

Now, this wouldn't be so bad, but I can't seem to figure out how to
filter these out with log4j. I turned off all logging to stdout, but
these warnings still go to stdout. (and on to catalina.out making for a
nice large log file)

Does anyone know how to either fix what it's complaining about, or
prevent these messages from displaying? The tags seem to be working just
fine otherwise.

Thanks,
Andy

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


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


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


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



RE: Struts security/validation

2004-08-11 Thread Wiebe de Jong
Craig, both you and Jim suggested that I make use of prepared statements. I
implemented my SQL using strings because it is easier to tweak during the
development phase. 

Now that the project is in maintenance, moving to prepared statements is a
good idea. Probably help a bit in performance as well.

As for the XML/SOAP calls, using the serializer to create the character
entities would be good.

Thanks

Wiebe de Jong

-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 10:50 AM
To: Struts Users Mailing List
Subject: Re: Struts security/validation

On Wed, 11 Aug 2004 10:32:04 -0700, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
> I had a similar problem, which I discovered when one of my users tried to
> enter a street address containing an apostrophe. Since I use apostrophes
to
> delineate my text strings in my SQL statements, this caused a database
> error. I fixed it by not allowing apostrophes to be entered into any of
the
> test fields.
> 

I hope you never have a customer named O'Reilly :-).

> I admit this is overly restrictive, but I don't know how to get the
> apostrophe into my database otherwise. How would you do it Craig?
> 
> For SQL destined test, I disallow \ and '.

If I'm doing the SQL myself, I always use prepared statements:

  String streetAddress = "..."; // String may have "\" and "'" characters in
it
  PreparedStatement stmt = conn.prepareStatement
("UPDATE CUSTOMER SET STREET_ADDRESS=? WHERE CUSTID=?");
  stmt.setString(1, streetAddress);
  stmt.setInt(2, custId);
  stmt.executeUpdate();

and let the JDBC driver take care of getting the sensitive characters
escaped as needed.

(Of course, if you're using a persistence tier abstraction like EJB or
JDO or JDBC RowSets or Hibernate or iBatis et. al., you don't need to
worry about any of this -- it all happens automatically for you.)

> For XML destined text, I disallow <, >, &, \, and ".

For XML, I use one of several strategies depending on the detailed
situation:

* Recognize that XML allows either " or ' as attribute delimiters,
  so if a string includes one kind, just use the other.

* Write or use an XML serializer that translates "&" to "&"
  and so on for me.

* If the XML I am writing is actually markup on a page, use
  JSF components ... JSF includes APIs that do all the escaping
  for you.

> 
> Wiebe de Jong

Craig

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


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



RE: Struts security/validation

2004-08-11 Thread Zhang, Larry \(L.\)
Oracle sql insert needs to escape apostrophes so that you can insert apostrophes. So 
in your case you may need a utility method to convert all your text containing 
apostrophes to some thing like ''.

Example: If your user enters "I like he's idea", when inserting to data base you need 
to convert it to be "l like he''s idea".

Hope this helps.


-Original Message-
From: Wiebe de Jong [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 1:32 PM
To: 'Struts Users Mailing List'
Subject: RE: Struts security/validation


I had a similar problem, which I discovered when one of my users tried to
enter a street address containing an apostrophe. Since I use apostrophes to
delineate my text strings in my SQL statements, this caused a database
error. I fixed it by not allowing apostrophes to be entered into any of the
test fields.

I admit this is overly restrictive, but I don't know how to get the
apostrophe into my database otherwise. How would you do it Craig?

For SQL destined test, I disallow \ and '.
For XML destined text, I disallow <, >, &, \, and ".

Wiebe de Jong

-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 10:21 AM
To: Struts Users Mailing List
Subject: Re: Struts security/validation

On Wed, 11 Aug 2004 14:45:05 +0100, James Adams <[EMAIL PROTECTED]> wrote:
> Hello all,
> 
> I'm in the process of trying to secure my struts application against
"Cross site scripting", "SQL injection" style attacks.
> 
> One of the things I'm doing to prevent this is trying to restrict special
characters (;.<>(){}...etc) getting beyond the validator.
> 

Just thinking out loud for a moment ...

Cross site scripting attacks don't happen when sensitive characters
are inside an *input* field.  The problem comes if you *output* the
data without filtering for them.  That's why the Struts 
tag, for example, filters "<", ">", "&", and ";" for you unless you
explicitly tell it not to, so if you are diligent about how you copy
your database data to output pages, you can safely accept these kinds
of character in input.

I notice that Kishore Senji (one of the other respondents in this
thread) is using Google's Gmail, just as I am at the moment.  Since
this is a web application, it's a good thing that Googe isn't
disallowing the magic characters on input into a textarea, or else we
would not be able to participate in this conversation :-).

Is filtering input really the appropriate strategy for dealing with
this problem?  If successful it will certainly help, but the approach
strikes me as overly restrictive for most application needs.

Craig

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


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


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



Re: Struts security/validation

2004-08-11 Thread Craig McClanahan
On Wed, 11 Aug 2004 10:32:04 -0700, Wiebe de Jong <[EMAIL PROTECTED]> wrote:
> I had a similar problem, which I discovered when one of my users tried to
> enter a street address containing an apostrophe. Since I use apostrophes to
> delineate my text strings in my SQL statements, this caused a database
> error. I fixed it by not allowing apostrophes to be entered into any of the
> test fields.
> 

I hope you never have a customer named O'Reilly :-).

> I admit this is overly restrictive, but I don't know how to get the
> apostrophe into my database otherwise. How would you do it Craig?
> 
> For SQL destined test, I disallow \ and '.

If I'm doing the SQL myself, I always use prepared statements:

  String streetAddress = "..."; // String may have "\" and "'" characters in it
  PreparedStatement stmt = conn.prepareStatement
("UPDATE CUSTOMER SET STREET_ADDRESS=? WHERE CUSTID=?");
  stmt.setString(1, streetAddress);
  stmt.setInt(2, custId);
  stmt.executeUpdate();

and let the JDBC driver take care of getting the sensitive characters
escaped as needed.

(Of course, if you're using a persistence tier abstraction like EJB or
JDO or JDBC RowSets or Hibernate or iBatis et. al., you don't need to
worry about any of this -- it all happens automatically for you.)

> For XML destined text, I disallow <, >, &, \, and ".

For XML, I use one of several strategies depending on the detailed situation:

* Recognize that XML allows either " or ' as attribute delimiters,
  so if a string includes one kind, just use the other.

* Write or use an XML serializer that translates "&" to "&"
  and so on for me.

* If the XML I am writing is actually markup on a page, use
  JSF components ... JSF includes APIs that do all the escaping
  for you.

> 
> Wiebe de Jong

Craig

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



RE: Struts security/validation

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Wiebe de Jong [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 10:32 AM
> To: 'Struts Users Mailing List'
> Subject: RE: Struts security/validation
> 
> 
> I had a similar problem, which I discovered when one of my 
> users tried to
> enter a street address containing an apostrophe. Since I use 
> apostrophes to
> delineate my text strings in my SQL statements, this caused a database
> error. I fixed it by not allowing apostrophes to be entered 
> into any of the
> test fields.
> 
> I admit this is overly restrictive, but I don't know how to get the
> apostrophe into my database otherwise. How would you do it Craig?

I'd change them to their HTML equivalents.. however I've found that using the prepared 
sql statements eliminates the interpretation problem you've outlined.

> 
> For SQL destined test, I disallow \ and '.
> For XML destined text, I disallow <, >, &, \, and ".
> 
> Wiebe de Jong
> 
> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 11, 2004 10:21 AM
> To: Struts Users Mailing List
> Subject: Re: Struts security/validation
> 
> On Wed, 11 Aug 2004 14:45:05 +0100, James Adams 
> <[EMAIL PROTECTED]> wrote:
> > Hello all,
> > 
> > I'm in the process of trying to secure my struts application against
> "Cross site scripting", "SQL injection" style attacks.
> > 
> > One of the things I'm doing to prevent this is trying to 
> restrict special
> characters (;.<>(){}...etc) getting beyond the validator.
> > 
> 
> Just thinking out loud for a moment ...
> 
> Cross site scripting attacks don't happen when sensitive characters
> are inside an *input* field.  The problem comes if you *output* the
> data without filtering for them.  That's why the Struts 
> tag, for example, filters "<", ">", "&", and ";" for you unless you
> explicitly tell it not to, so if you are diligent about how you copy
> your database data to output pages, you can safely accept these kinds
> of character in input.
> 
> I notice that Kishore Senji (one of the other respondents in this
> thread) is using Google's Gmail, just as I am at the moment.  Since
> this is a web application, it's a good thing that Googe isn't
> disallowing the magic characters on input into a textarea, or else we
> would not be able to participate in this conversation :-).
> 
> Is filtering input really the appropriate strategy for dealing with
> this problem?  If successful it will certainly help, but the approach
> strikes me as overly restrictive for most application needs.
> 
> Craig
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Struts security/validation

2004-08-11 Thread Wiebe de Jong
I had a similar problem, which I discovered when one of my users tried to
enter a street address containing an apostrophe. Since I use apostrophes to
delineate my text strings in my SQL statements, this caused a database
error. I fixed it by not allowing apostrophes to be entered into any of the
test fields.

I admit this is overly restrictive, but I don't know how to get the
apostrophe into my database otherwise. How would you do it Craig?

For SQL destined test, I disallow \ and '.
For XML destined text, I disallow <, >, &, \, and ".

Wiebe de Jong

-Original Message-
From: Craig McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 10:21 AM
To: Struts Users Mailing List
Subject: Re: Struts security/validation

On Wed, 11 Aug 2004 14:45:05 +0100, James Adams <[EMAIL PROTECTED]> wrote:
> Hello all,
> 
> I'm in the process of trying to secure my struts application against
"Cross site scripting", "SQL injection" style attacks.
> 
> One of the things I'm doing to prevent this is trying to restrict special
characters (;.<>(){}...etc) getting beyond the validator.
> 

Just thinking out loud for a moment ...

Cross site scripting attacks don't happen when sensitive characters
are inside an *input* field.  The problem comes if you *output* the
data without filtering for them.  That's why the Struts 
tag, for example, filters "<", ">", "&", and ";" for you unless you
explicitly tell it not to, so if you are diligent about how you copy
your database data to output pages, you can safely accept these kinds
of character in input.

I notice that Kishore Senji (one of the other respondents in this
thread) is using Google's Gmail, just as I am at the moment.  Since
this is a web application, it's a good thing that Googe isn't
disallowing the magic characters on input into a textarea, or else we
would not be able to participate in this conversation :-).

Is filtering input really the appropriate strategy for dealing with
this problem?  If successful it will certainly help, but the approach
strikes me as overly restrictive for most application needs.

Craig

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


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



RE: Struts security/validation

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Craig McClanahan [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 10:21 AM
> To: Struts Users Mailing List
> Subject: Re: Struts security/validation
> 
> 
> On Wed, 11 Aug 2004 14:45:05 +0100, James Adams 
> <[EMAIL PROTECTED]> wrote:
> > Hello all,
> > 
> > I'm in the process of trying to secure my struts 
> application against "Cross site scripting", "SQL injection" 
> style attacks.
> > 
> > One of the things I'm doing to prevent this is trying to 
> restrict special characters (;.<>(){}...etc) getting beyond 
> the validator.
> > 
> 
> Just thinking out loud for a moment ...
> 
> Cross site scripting attacks don't happen when sensitive characters
> are inside an *input* field.  The problem comes if you *output* the
> data without filtering for them.  That's why the Struts 
> tag, for example, filters "<", ">", "&", and ";" for you unless you
> explicitly tell it not to, so if you are diligent about how you copy
> your database data to output pages, you can safely accept these kinds
> of character in input.
> 
> I notice that Kishore Senji (one of the other respondents in this
> thread) is using Google's Gmail, just as I am at the moment.  Since
> this is a web application, it's a good thing that Googe isn't
> disallowing the magic characters on input into a textarea, or else we
> would not be able to participate in this conversation :-).
> 
> Is filtering input really the appropriate strategy for dealing with
> this problem?  If successful it will certainly help, but the approach
> strikes me as overly restrictive for most application needs.

It can be appropriate, you might eventually need to turn off that filtering.  It may 
be possible to legitametley allow such characters.  The immediate example I can think 
of is content management.  You could jump through hoops ( ex. Wiki's) to not use html 
to mark up the input but why?
If you do it on input, you definitiely need more then just grepping on characters, you 
need to look at what the content is.  Looking for a 

Re: html base tag

2004-08-11 Thread Craig McClanahan
On Wed, 11 Aug 2004 10:30:58 -0600, Travis Stevens
<[EMAIL PROTECTED]> wrote:
> I have been using the struts html base tag.  Unfortunately, our new
> staging machine is done with a proxy pass.  This means that the URL
> being sent to the box in which the tomcat is located is changed and the
> base is then wrong.
> 

The strategy you lay out will probably work, but it's a lot of effort
and means you'll be forever patching new versions of Struts with your
custom changes.  Far better would be to get Tomcat to stop lying to
you about the incoming server name and port:

http://jakarta.apache.org/tomcat/tomcat-5.0-doc/proxy-howto.html

Solving the real problem will make your Struts apps work correctly,
along with every other web appication that is based on servlet
technology.  They will all assume that getServerName() and
getServerPort() return the right things.

Craig


> For example:
> 
> www.outside_firewall.com/tomcat
> 
> is proxy passed to
> 
> www.inside_firewall.com/tomcat
> 
> which means when the page returns to the client, the base tag is
> 
> 
> Currently the base tag determines the server via the following
> 
> 1. Passed as parameter?
> 2. request.getServer()
> 
> I would like to add another step
> 1. Passed as parameter?
> 2. An init parameter in the ServletContext instance?
> 3. request.getServer()
> 
> In order to do this, I will add a field to Global entitled SERVER with
> value "server" which can be configured in web.xml.  I will then access
> that variable via the ServletContext in the BaseTag class.
> 
> Does this sound feasible?  Any other ideas?  Is this something I should
> submit to be added to struts?
> 
> -Trav
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Re: Struts security/validation

2004-08-11 Thread Craig McClanahan
On Wed, 11 Aug 2004 14:45:05 +0100, James Adams <[EMAIL PROTECTED]> wrote:
> Hello all,
> 
> I'm in the process of trying to secure my struts application against "Cross site 
> scripting", "SQL injection" style attacks.
> 
> One of the things I'm doing to prevent this is trying to restrict special characters 
> (;.<>(){}...etc) getting beyond the validator.
> 

Just thinking out loud for a moment ...

Cross site scripting attacks don't happen when sensitive characters
are inside an *input* field.  The problem comes if you *output* the
data without filtering for them.  That's why the Struts 
tag, for example, filters "<", ">", "&", and ";" for you unless you
explicitly tell it not to, so if you are diligent about how you copy
your database data to output pages, you can safely accept these kinds
of character in input.

I notice that Kishore Senji (one of the other respondents in this
thread) is using Google's Gmail, just as I am at the moment.  Since
this is a web application, it's a good thing that Googe isn't
disallowing the magic characters on input into a textarea, or else we
would not be able to participate in this conversation :-).

Is filtering input really the appropriate strategy for dealing with
this problem?  If successful it will certainly help, but the approach
strikes me as overly restrictive for most application needs.

Craig

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



RE:

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Laran Evans [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 10:08 AM
> To: Struts User Mailing List
> Subject: 
> 
> 
> When I use  I get a ClassCastException.  So I used 
>  which displayed nothing, but worked.
> 
> ActionErrors doesn't accept ActionError objects any longer 
> (deprecated), 
> just ActionMessage objects.
> 
> What's the consensus on the correct way to display  
> currently?

NOt sure about how common this is, but Husted has a cool tip: 
http://husted.com/struts/tips/017.html

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



Re: html base tag

2004-08-11 Thread Travis Stevens

I have been using the struts html base tag.  Unfortunately, our new 
staging machine is done with a proxy pass.  This means that the URL 
being sent to the box in which the tomcat is located is 
changed and the 
base is then wrong.
   

This has been discussed before on this list... might want to try searching for the 
solution there.
 

Sorry about this.  I found my answer at
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/proxy-howto.html
thanks to the archive.
-Trav
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


user@struts.apache.org

2004-08-11 Thread Laran Evans
When I use  I get a ClassCastException.  So I used 
 which displayed nothing, but worked.

ActionErrors doesn't accept ActionError objects any longer (deprecated), 
just ActionMessage objects.

What's the consensus on the correct way to display  
currently?

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


RE: [OT] DAO ... where to draw the line?

2004-08-11 Thread Wiebe de Jong
When it comes to app architecture, I always recommend the Core J2EE Patterns
book. The Second Edition is now available and you can get an overview of it
at http://corej2eepatterns.com/Patterns2ndEd/BusinessObject.htm

In response to your question:

A DAO should only contain the SQL code for the
create/read/update/delete/find methods of one single database file or view.

The Business Object, which is new in the Second Edition, wraps the DAO and
manages the state and business rules for that one object. Remove any
business rules, etc currently in your DAO and move them to the associated
Business Object when refactoring.

The Application Service, which is also new in the Second Edition, manages
business rules across multiple objects (Business Objects and/or DAOs).
Remove any business rules, etc currently in your Session Façades and move
them to the Application Service when refactoring.

Leave the transaction control, database connection stuff, etc in the Session
Façade.

So, go with your first example. Employee and Department should each have
their own DAO. If Department is just a simple lookup table, you could
combine them at the Business Object level. If Department is complicated with
its own set of business rules, then make use of an Application Service.

Wiebe de Jong

-Original Message-
From: Matthew J. Vincent [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 8:21 AM
To: Struts Users Mailing List
Subject: [OT] DAO ... where to draw the line?

[OFF TOPIC]

I know this is a struts forum, but as struts developers using DAOs, 
where do your DAO implementation draw the line? 

For example:

Let''s say I have three tables:

Employee (contains employee_id, employee_name,  and dept_id)
Department (contains dept_id, dept_name, loc_id)
Location (contains loc_id, location_name)

How deep do your classes go to replicate the data? 

Do you do this...

public class Employee {
private int id;
private String name;
private int deptId;   // just the id

// .. implementation details
}

or do you do this

public class Employee {
private int id;
private String name;
private Department dept;  // all of the data

// .. implementation details
}

and so on and so on.   Class Department has the same type of problem.  
Does it hold just the id for location or a variable class Location?

Should DAOs just fill in the id (keys) so it is up to the application 
using the DAOs to get the Employee class, then the Department class, and 
the the Location class like:

Employee emp = EmployeDAO.getEmployee(1);
Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
Location loc = LocationDAO.getLocation(dept.getLocId());
System.out.println(emp.getEmpName() + " works in " + loc.getLocationName());

or

Employee emp = EmployeDAO.getEmployee(1);
System.out.println(emp.getEmpName() + " works in " + 
emp.getDept().getLoc().getLocationName());

Now this is just a simple example, but where do you draw the line?  It's 
possible to go on and on and on and cycle back to employee...

Any thoughts, links, tips, best practices, whatvere would be helpful!

Thanks!

Matt


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


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



Re: Struts and Websphere security - best practice

2004-08-11 Thread Ruth, Brice
Craig McClanahan wrote:
On Tue, 10 Aug 2004 09:15:49 -0400, Tom McCobb <[EMAIL PROTECTED]> wrote:
 

   

One thing to double check is that your welcome page really does do a
*redirect* to sessionStart.do, rather than a .  The
latter will not kick in the container managed security, because they
are only applied on the URL that is originally requested from the
client (which will be the one for the welcome page in this scenario).
 

AHA!
Any suggestions for poking the username into the session for alter
retrieval?  I am trying a javascript function launched from the onSubmit
event on the form, and an intermediary jsp/form.  Can I use a struts
form.action to store the username/pw and forward directly to the
j_security_check servlet?
   

You can retrieve the logged-in username by calling
request.getRemoteUser() in some subsequent request.  For security
reasons, you cannot retrieve the password, unless your particular app
server provides some proprietary mechanism.
Craig
 

Tom,
Just as a quick FYI - this isn't WebSphere specific security, per se. My 
understanding is that this is all part of the servlet specification. 
Tomcat supports it, as does any other servlet container. So, if you're 
looking for some documentation on things like getting the username, or 
figuring out what roles the user belongs to - check the servlet 
specification, or any book you have that talks about the servlet spec.

Brice
--
Brice Ruth, Sr. IT Analyst
Fiskars Brands Inc
http://www.fiskarsbrands.com/


RE: Problem depoying struts-blank.war

2004-08-11 Thread Hubert Rabago
It could be just what the error says --  needs a .  Since you
don't have any yet, you can comment out the validator plugin for now by
opening struts-config.xml and commenting out the last very last entry there,
which starts with:



With that uncommented, the app should deploy.  If it doesn't, send another
email.  :)

Once you play around with it and have a form to validate, put that back in,
add your form to the validation.xml file, and it should deploy fine.

hth,
Hubert

--- Kenneth Litwak <[EMAIL PROTECTED]> wrote:

> I used the download I got yesterday:  struts-20040803.zip.  Thakns.
> 
> 
> Ken
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 11, 2004 8:54 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> 
> > -Original Message-
> > From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 8:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: Problem depoying struts-blank.war
> > 
> > 
> > I am trying to teach myself Struts while writing a real 
> > application.
> > I followed an tutorial that said to start by putting the
> > struts-blank.war in the webapps directory of Tomcat 5.  Unfortunately,
> > here's what I got:
> 
> Which version of struts did you get the struts-blank.war from?  This is
> awfully odd.
> 
> 
> 
> > 
> >  
> > 
> > Aug 11, 2004 8:24:50 AM 
> > org.apache.struts.util.PropertyMessageResources
> > 
> > 
> > INFO: Initializing,
> > config='org.apache.webapp.admin.ApplicationResources', retur
> > 
> > nNull=true
> > 
> > Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\balancer.xml
> > 
> > Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\manager.xml
> > 
> > Aug 11, 2004 8:24:56 AM org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Installing web application at context path 
> > /struts-blank from URL
> > file:C:/
> > 
> > tomcat50/webapps/struts-blank
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> > initDefinitionsFacto
> > 
> > ry
> > 
> > INFO: Tiles definition factory loaded for module ''.
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from 
> > '/WEB-INF/validator-rules.xml'
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> > 
> > Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> > 
> > SEVERE: Parse Error at line 45 column 15: The content of element type
> > "formset"
> > 
> > is incomplete, it must match "(constant*,form+)".
> > 
> > org.xml.sax.SAXParseException: The content of element type 
> > "formset" is
> > incomple
> > 
> > te, it must match "(constant*,form+)".
> > 
> > at
> > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> > 
> > known Source)
> > 
> > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> > Source)
> > 
> > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at
> > org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> > 
> > ource)
> > 
> > at 
> > org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> > Source)
> > 
> >  
> > 
> > at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
> > 
> > n Source)
> > 
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> > 
> > Dispatcher.dispatch(Unknown Source)
> > 
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> > 
> > known Source)
> > 
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > 
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > 
> > at
> > org.apache.commons.digester.Digester.parse(Digester.java:1567)
> > 
> > at
> > org.apache.commons.validator.ValidatorResources.(ValidatorResou
> > 
> > rces.java:159)
> > 
> > at
> > org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
> > 
> > ugIn.java:233)
> > 
> > at
> > org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
> > 
> > :164)
> > 
> > at
> > org.apache.struts.action.ActionServlet.initModulePlugIns(

RE: html base tag

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Travis Stevens [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 9:31 AM
> To: [EMAIL PROTECTED]
> Subject: html base tag
> 
> 
> I have been using the struts html base tag.  Unfortunately, our new 
> staging machine is done with a proxy pass.  This means that the URL 
> being sent to the box in which the tomcat is located is 
> changed and the 
> base is then wrong.

This has been discussed before on this list... might want to try searching for the 
solution there.


> 
> For example:
> 
> www.outside_firewall.com/tomcat
> 
> is proxy passed to
> 
> www.inside_firewall.com/tomcat
> 
> which means when the page returns to the client, the base tag is
> 
> 
> Currently the base tag determines the server via the following
> 
> 1. Passed as parameter?
> 2. request.getServer()
> 
> I would like to add another step
> 1. Passed as parameter?
> 2. An init parameter in the ServletContext instance?
> 3. request.getServer()
> 
> In order to do this, I will add a field to Global entitled 
> SERVER with 
> value "server" which can be configured in web.xml.  I will 
> then access 
> that variable via the ServletContext in the BaseTag class.
> 
> Does this sound feasible?  Any other ideas?  Is this 
> something I should 
> submit to be added to struts?
> 
> -Trav
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



RE: Problem depoying struts-blank.war

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 9:27 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> Here is the validation.xml file. Do I need this?  A lot of this is new
> to me.  What would I do to rebuild the war without this file, if I can
> get away with not using it?  Thanks.

Yeah you can I'm just surprised that the xml validator is being that much of a 
pita.  Oh well.   Like another poster said, in the strtusconfig.xml file, there's a 
section dealing with the validator, go ahead and comment it out.


> 
> 
>  "-//Apache Software Foundation//DTD Commons Validator Rules
> Configuration 1.1//EN"  
> 
> "http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>
> 
> 
> 
>   
>   
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Ken
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 11, 2004 9:03 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> 
> > -Original Message-
> > From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 8:59 AM
> > To: Struts Users Mailing List
> > Subject: RE: Problem depoying struts-blank.war
> > 
> > 
> > I used the download I got yesterday:  struts-20040803.zip.  Thakns.
> 
> Looks the validation file is a bit wonky.  That would
> WEB-INF/validation.xml, and something is out of order in it.  Which
> should be easy to fix, just put things in the right order.  
> If they are
> in the right order.
> 
> 
> 
> 
> > 
> > 
> > Ken
> > 
> > -Original Message-
> > From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> > Sent: Wednesday, August 11, 2004 8:54 AM
> > To: Struts Users Mailing List
> > Subject: RE: Problem depoying struts-blank.war
> > 
> > 
> > 
> > > -Original Message-
> > > From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> > > Sent: Wednesday, August 11, 2004 8:45 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Problem depoying struts-blank.war
> > > 
> > > 
> > > I am trying to teach myself Struts while writing a real 
> > > application.
> > > I followed an tutorial that said to start by putting the
> > > struts-blank.war in the webapps directory of Tomcat 5.  
> > Unfortunately,
> > > here's what I got:
> > 
> > Which version of struts did you get the struts-blank.war 
> > from?  This is
> > awfully odd.
> > 
> > 
> > 
> > > 
> > >  
> > > 
> > > Aug 11, 2004 8:24:50 AM 
> > > org.apache.struts.util.PropertyMessageResources
> > > 
> > > 
> > > INFO: Initializing,
> > > config='org.apache.webapp.admin.ApplicationResources', retur
> > > 
> > > nNull=true
> > > 
> > > Aug 11, 2004 8:24:55 AM 
> > org.apache.catalina.core.StandardHostDeployer
> > > install
> > > 
> > > INFO: Processing Context configuration file URL
> > > file:C:\tomcat50\conf\Catalina\l
> > > 
> > > ocalhost\balancer.xml
> > > 
> > > Aug 11, 2004 8:24:55 AM 
> > org.apache.catalina.core.StandardHostDeployer
> > > install
> > > 
> > > INFO: Processing Context configuration file URL
> > > file:C:\tomcat50\conf\Catalina\l
> > > 
> > > ocalhost\manager.xml
> > > 
> > > Aug 11, 2004 8:24:56 AM 
> > org.apache.catalina.core.StandardHostDeployer
> > > install
> > > 
> > > INFO: Installing web application at context path 
> > > /struts-blank from URL
> > > file:C:/
> > > 
> > > tomcat50/webapps/struts-blank
> > > 
> > > Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> > > initDefinitionsFacto
> > > 
> > > ry
> > > 
> > > INFO: Tiles definition factory loaded for module ''.
> > > 
> > > Aug 11, 2004 8:24:59 AM 
> org.apache.struts.validator.ValidatorPlugIn
> > > initResource
> > > 
> > > s
> > > 
> > > INFO: Loading validation rules file from 
> > > '/WEB-INF/validator-rules.xml'
> > > 
> > > Aug 11, 2004 8:24:59 AM 
> org.apache.struts.validator.ValidatorPlugIn
> > > initResource
> > > 
> > > s
> > > 
> > > INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> > > 
> > > Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> > > 
> > > SEVERE: Parse Error at line 45 column 15: The content of 
> > element type
> > > "formset"
> > > 
> > > is incomplete, it must match "(constant*,form+)".
> > > 
> > > org.xml.sax.SAXParseException: The content of element type 
> > > "formset" is
> > > incomple
> > > 
> > > te, it must match "(constant*,form+)".
> > > 
> > > at
> > > 
> > 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> > > 
> > > known Source)
> > > 
> > > at 
> org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> > > Source)
> > > 
> > > at 
> > org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > > Source)
> > > 
> > > at 
> > org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > > Source)
> > > 
> > > at
> > > 
> > 
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> 

html base tag

2004-08-11 Thread Travis Stevens
I have been using the struts html base tag.  Unfortunately, our new 
staging machine is done with a proxy pass.  This means that the URL 
being sent to the box in which the tomcat is located is changed and the 
base is then wrong.

For example:
www.outside_firewall.com/tomcat
is proxy passed to
www.inside_firewall.com/tomcat
which means when the page returns to the client, the base tag is

Currently the base tag determines the server via the following
1. Passed as parameter?
2. request.getServer()
I would like to add another step
1. Passed as parameter?
2. An init parameter in the ServletContext instance?
3. request.getServer()
In order to do this, I will add a field to Global entitled SERVER with 
value "server" which can be configured in web.xml.  I will then access 
that variable via the ServletContext in the BaseTag class.

Does this sound feasible?  Any other ideas?  Is this something I should 
submit to be added to struts?

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


RE: Problem depoying struts-blank.war

2004-08-11 Thread Hubert Rabago
- Resend: Not sure why the first one didn't show; apologies if this becomes
the second one  -

It could be just what the error says --  needs a .  Since you
don't have any yet, you can comment out the validator plugin for now by
opening struts-config.xml and commenting out the last very last entry there,
which starts with:



With that uncommented, the app should deploy.  If it doesn't, send another
email.  :)

Once you play around with it and have a form to validate, put that back in,
add your form to the validation.xml file, and it should deploy fine.

hth,
Hubert

--- Kenneth Litwak <[EMAIL PROTECTED]> wrote:

> I used the download I got yesterday:  struts-20040803.zip.  Thakns.
> 
> 
> Ken
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 11, 2004 8:54 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> 
> > -Original Message-
> > From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 8:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: Problem depoying struts-blank.war
> > 
> > 
> > I am trying to teach myself Struts while writing a real 
> > application.
> > I followed an tutorial that said to start by putting the
> > struts-blank.war in the webapps directory of Tomcat 5.  Unfortunately,
> > here's what I got:
> 
> Which version of struts did you get the struts-blank.war from?  This is
> awfully odd.
> 
> 
> 
> > 
> >  
> > 
> > Aug 11, 2004 8:24:50 AM 
> > org.apache.struts.util.PropertyMessageResources
> > 
> > 
> > INFO: Initializing,
> > config='org.apache.webapp.admin.ApplicationResources', retur
> > 
> > nNull=true
> > 
> > Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\balancer.xml
> > 
> > Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\manager.xml
> > 
> > Aug 11, 2004 8:24:56 AM org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Installing web application at context path 
> > /struts-blank from URL
> > file:C:/
> > 
> > tomcat50/webapps/struts-blank
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> > initDefinitionsFacto
> > 
> > ry
> > 
> > INFO: Tiles definition factory loaded for module ''.
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from 
> > '/WEB-INF/validator-rules.xml'
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> > 
> > Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> > 
> > SEVERE: Parse Error at line 45 column 15: The content of element type
> > "formset"
> > 
> > is incomplete, it must match "(constant*,form+)".
> > 
> > org.xml.sax.SAXParseException: The content of element type 
> > "formset" is
> > incomple
> > 
> > te, it must match "(constant*,form+)".
> > 
> > at
> > org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> > 
> > known Source)
> > 
> > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> > Source)
> > 
> > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at
> > org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> > 
> > ource)
> > 
> > at 
> > org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> > Source)
> > 
> >  
> > 
> > at
> > org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
> > 
> > n Source)
> > 
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> > 
> > Dispatcher.dispatch(Unknown Source)
> > 
> > at
> > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> > 
> > known Source)
> > 
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > 
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > 
> > at
> > org.apache.commons.digester.Digester.parse(Digester.java:1567)
> > 
> > at
> > org.apache.commons.validator.ValidatorResources.(ValidatorResou
> > 
> > rces.java:159)
> > 
> > at
> > org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
> > 
> > ugIn.java:233)
> > 
> > at
> > org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
>

RE: Problem depoying struts-blank.war

2004-08-11 Thread Kenneth Litwak
Here is the validation.xml file. Do I need this?  A lot of this is new
to me.  What would I do to rebuild the war without this file, if I can
get away with not using it?  Thanks.


http://jakarta.apache.org/commons/dtds/validator_1_1.dtd";>



  
  












Ken

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 9:03 AM
To: Struts Users Mailing List
Subject: RE: Problem depoying struts-blank.war



> -Original Message-
> From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:59 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> I used the download I got yesterday:  struts-20040803.zip.  Thakns.

Looks the validation file is a bit wonky.  That would
WEB-INF/validation.xml, and something is out of order in it.  Which
should be easy to fix, just put things in the right order.  If they are
in the right order.




> 
> 
> Ken
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 11, 2004 8:54 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> 
> > -Original Message-
> > From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 8:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: Problem depoying struts-blank.war
> > 
> > 
> > I am trying to teach myself Struts while writing a real 
> > application.
> > I followed an tutorial that said to start by putting the
> > struts-blank.war in the webapps directory of Tomcat 5.  
> Unfortunately,
> > here's what I got:
> 
> Which version of struts did you get the struts-blank.war 
> from?  This is
> awfully odd.
> 
> 
> 
> > 
> >  
> > 
> > Aug 11, 2004 8:24:50 AM 
> > org.apache.struts.util.PropertyMessageResources
> > 
> > 
> > INFO: Initializing,
> > config='org.apache.webapp.admin.ApplicationResources', retur
> > 
> > nNull=true
> > 
> > Aug 11, 2004 8:24:55 AM 
> org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\balancer.xml
> > 
> > Aug 11, 2004 8:24:55 AM 
> org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\manager.xml
> > 
> > Aug 11, 2004 8:24:56 AM 
> org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Installing web application at context path 
> > /struts-blank from URL
> > file:C:/
> > 
> > tomcat50/webapps/struts-blank
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> > initDefinitionsFacto
> > 
> > ry
> > 
> > INFO: Tiles definition factory loaded for module ''.
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from 
> > '/WEB-INF/validator-rules.xml'
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> > 
> > Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> > 
> > SEVERE: Parse Error at line 45 column 15: The content of 
> element type
> > "formset"
> > 
> > is incomplete, it must match "(constant*,form+)".
> > 
> > org.xml.sax.SAXParseException: The content of element type 
> > "formset" is
> > incomple
> > 
> > te, it must match "(constant*,form+)".
> > 
> > at
> > 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> > 
> > known Source)
> > 
> > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> > Source)
> > 
> > at 
> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at 
> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at
> > 
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> > 
> > ource)
> > 
> > at 
> > org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> > Source)
> > 
> >  
> > 
> > at
> > 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
> > 
> > n Source)
> > 
> > at
> > 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> > 
> > Dispatcher.dispatch(Unknown Source)
> > 
> > at
> > 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> > 
> > known Source)
> > 
> > at 
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at 
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > 
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > 
> > at
> > org.apache.commons.digester.Digester.pars

Re: Scriptlet in html:img

2004-08-11 Thread Mark Lowe
Um..

Might just do it for you..
On 10 Aug 2004, at 08:56, ashwini jagtap wrote:
 me error
can anyone correct this

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


RE: Problem depoying struts-blank.war

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:59 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> I used the download I got yesterday:  struts-20040803.zip.  Thakns.

Looks the validation file is a bit wonky.  That would WEB-INF/validation.xml, and 
something is out of order in it.  Which should be easy to fix, just put things in the 
right order.  If they are in the right order.




> 
> 
> Ken
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 11, 2004 8:54 AM
> To: Struts Users Mailing List
> Subject: RE: Problem depoying struts-blank.war
> 
> 
> 
> > -Original Message-
> > From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 11, 2004 8:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: Problem depoying struts-blank.war
> > 
> > 
> > I am trying to teach myself Struts while writing a real 
> > application.
> > I followed an tutorial that said to start by putting the
> > struts-blank.war in the webapps directory of Tomcat 5.  
> Unfortunately,
> > here's what I got:
> 
> Which version of struts did you get the struts-blank.war 
> from?  This is
> awfully odd.
> 
> 
> 
> > 
> >  
> > 
> > Aug 11, 2004 8:24:50 AM 
> > org.apache.struts.util.PropertyMessageResources
> > 
> > 
> > INFO: Initializing,
> > config='org.apache.webapp.admin.ApplicationResources', retur
> > 
> > nNull=true
> > 
> > Aug 11, 2004 8:24:55 AM 
> org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\balancer.xml
> > 
> > Aug 11, 2004 8:24:55 AM 
> org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Processing Context configuration file URL
> > file:C:\tomcat50\conf\Catalina\l
> > 
> > ocalhost\manager.xml
> > 
> > Aug 11, 2004 8:24:56 AM 
> org.apache.catalina.core.StandardHostDeployer
> > install
> > 
> > INFO: Installing web application at context path 
> > /struts-blank from URL
> > file:C:/
> > 
> > tomcat50/webapps/struts-blank
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> > initDefinitionsFacto
> > 
> > ry
> > 
> > INFO: Tiles definition factory loaded for module ''.
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from 
> > '/WEB-INF/validator-rules.xml'
> > 
> > Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> > initResource
> > 
> > s
> > 
> > INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> > 
> > Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> > 
> > SEVERE: Parse Error at line 45 column 15: The content of 
> element type
> > "formset"
> > 
> > is incomplete, it must match "(constant*,form+)".
> > 
> > org.xml.sax.SAXParseException: The content of element type 
> > "formset" is
> > incomple
> > 
> > te, it must match "(constant*,form+)".
> > 
> > at
> > 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> > 
> > known Source)
> > 
> > at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> > Source)
> > 
> > at 
> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at 
> org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> > Source)
> > 
> > at
> > 
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> > 
> > ource)
> > 
> > at 
> > org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> > Source)
> > 
> >  
> > 
> > at
> > 
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
> > 
> > n Source)
> > 
> > at
> > 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> > 
> > Dispatcher.dispatch(Unknown Source)
> > 
> > at
> > 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> > 
> > known Source)
> > 
> > at 
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at 
> org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> > Source)
> > 
> > at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> > 
> > at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> > Source)
> > 
> > at
> > org.apache.commons.digester.Digester.parse(Digester.java:1567)
> > 
> > at
> > 
> org.apache.commons.validator.ValidatorResources.(ValidatorResou
> > 
> > rces.java:159)
> > 
> > at
> > 
> org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
> > 
> > ugIn.java:233)
> > 
> > at
> > 
> org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
> > 
> > :164)
> > 
> > at
> > 
> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
> > 
> > t.java:839)

RE: with HashMap

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Laran Evans [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:57 AM
> To: [EMAIL PROTECTED]
> Subject:  with HashMap
> 
> 
> I have an ActionForm with a method:
> 
>   public HashMap getSelectFieldOptions() {
> return ExampleBO.mySelectFieldOptions;
>   }
> 
> How do I create an  tag that displays:
> 
> _map value_

You have of couse tried the http://struts.apache.org/userGuide/struts-html.html#optionsCollection
and found it to not work for you... 

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



RE: Problem depoying struts-blank.war

2004-08-11 Thread Kenneth Litwak
I used the download I got yesterday:  struts-20040803.zip.  Thakns.


Ken

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 8:54 AM
To: Struts Users Mailing List
Subject: RE: Problem depoying struts-blank.war



> -Original Message-
> From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:45 AM
> To: [EMAIL PROTECTED]
> Subject: Problem depoying struts-blank.war
> 
> 
> I am trying to teach myself Struts while writing a real 
> application.
> I followed an tutorial that said to start by putting the
> struts-blank.war in the webapps directory of Tomcat 5.  Unfortunately,
> here's what I got:

Which version of struts did you get the struts-blank.war from?  This is
awfully odd.



> 
>  
> 
> Aug 11, 2004 8:24:50 AM 
> org.apache.struts.util.PropertyMessageResources
> 
> 
> INFO: Initializing,
> config='org.apache.webapp.admin.ApplicationResources', retur
> 
> nNull=true
> 
> Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> install
> 
> INFO: Processing Context configuration file URL
> file:C:\tomcat50\conf\Catalina\l
> 
> ocalhost\balancer.xml
> 
> Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> install
> 
> INFO: Processing Context configuration file URL
> file:C:\tomcat50\conf\Catalina\l
> 
> ocalhost\manager.xml
> 
> Aug 11, 2004 8:24:56 AM org.apache.catalina.core.StandardHostDeployer
> install
> 
> INFO: Installing web application at context path 
> /struts-blank from URL
> file:C:/
> 
> tomcat50/webapps/struts-blank
> 
> Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> initDefinitionsFacto
> 
> ry
> 
> INFO: Tiles definition factory loaded for module ''.
> 
> Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> initResource
> 
> s
> 
> INFO: Loading validation rules file from 
> '/WEB-INF/validator-rules.xml'
> 
> Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> initResource
> 
> s
> 
> INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> 
> Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> 
> SEVERE: Parse Error at line 45 column 15: The content of element type
> "formset"
> 
> is incomplete, it must match "(constant*,form+)".
> 
> org.xml.sax.SAXParseException: The content of element type 
> "formset" is
> incomple
> 
> te, it must match "(constant*,form+)".
> 
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> 
> known Source)
> 
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> Source)
> 
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> 
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> 
> at
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> 
> ource)
> 
> at 
> org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> Source)
> 
>  
> 
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
> 
> n Source)
> 
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> 
> Dispatcher.dispatch(Unknown Source)
> 
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> 
> known Source)
> 
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> 
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> 
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> 
> at
> org.apache.commons.digester.Digester.parse(Digester.java:1567)
> 
> at
> org.apache.commons.validator.ValidatorResources.(ValidatorResou
> 
> rces.java:159)
> 
> at
> org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
> 
> ugIn.java:233)
> 
> at
> org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
> 
> :164)
> 
> at
> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
> 
> t.java:839)
> 
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
> 
> at javax.servlet.GenericServlet.init(GenericServlet.java:256)
> 
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
> 
> java:1044)
> 
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
> 
> 7)
> 
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
> 
> t.java:3959)
> 
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4
> 
> 284)
> 
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
> 
> .java:866)
> 
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85
> 
> 0)
> 
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.j

with HashMap

2004-08-11 Thread Laran Evans
I have an ActionForm with a method:
 public HashMap getSelectFieldOptions() {
   return ExampleBO.mySelectFieldOptions;
 }
How do I create an  tag that displays:
_map value_
TIA
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Problem depoying struts-blank.war

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Kenneth Litwak [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:45 AM
> To: [EMAIL PROTECTED]
> Subject: Problem depoying struts-blank.war
> 
> 
> I am trying to teach myself Struts while writing a real 
> application.
> I followed an tutorial that said to start by putting the
> struts-blank.war in the webapps directory of Tomcat 5.  Unfortunately,
> here's what I got:

Which version of struts did you get the struts-blank.war from?  This is awfully odd.



> 
>  
> 
> Aug 11, 2004 8:24:50 AM 
> org.apache.struts.util.PropertyMessageResources
> 
> 
> INFO: Initializing,
> config='org.apache.webapp.admin.ApplicationResources', retur
> 
> nNull=true
> 
> Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> install
> 
> INFO: Processing Context configuration file URL
> file:C:\tomcat50\conf\Catalina\l
> 
> ocalhost\balancer.xml
> 
> Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
> install
> 
> INFO: Processing Context configuration file URL
> file:C:\tomcat50\conf\Catalina\l
> 
> ocalhost\manager.xml
> 
> Aug 11, 2004 8:24:56 AM org.apache.catalina.core.StandardHostDeployer
> install
> 
> INFO: Installing web application at context path 
> /struts-blank from URL
> file:C:/
> 
> tomcat50/webapps/struts-blank
> 
> Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
> initDefinitionsFacto
> 
> ry
> 
> INFO: Tiles definition factory loaded for module ''.
> 
> Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> initResource
> 
> s
> 
> INFO: Loading validation rules file from 
> '/WEB-INF/validator-rules.xml'
> 
> Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
> initResource
> 
> s
> 
> INFO: Loading validation rules file from '/WEB-INF/validation.xml'
> 
> Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error
> 
> SEVERE: Parse Error at line 45 column 15: The content of element type
> "formset"
> 
> is incomplete, it must match "(constant*,form+)".
> 
> org.xml.sax.SAXParseException: The content of element type 
> "formset" is
> incomple
> 
> te, it must match "(constant*,form+)".
> 
> at
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un
> 
> known Source)
> 
> at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
> Source)
> 
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> 
> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
> Source)
> 
> at
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S
> 
> ource)
> 
> at 
> org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
> Source)
> 
>  
> 
> at
> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow
> 
> n Source)
> 
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
> 
> Dispatcher.dispatch(Unknown Source)
> 
> at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un
> 
> known Source)
> 
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> 
> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
> Source)
> 
> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
> 
> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
> Source)
> 
> at
> org.apache.commons.digester.Digester.parse(Digester.java:1567)
> 
> at
> org.apache.commons.validator.ValidatorResources.(ValidatorResou
> 
> rces.java:159)
> 
> at
> org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl
> 
> ugIn.java:233)
> 
> at
> org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java
> 
> :164)
> 
> at
> org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle
> 
> t.java:839)
> 
> at
> org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)
> 
> at javax.servlet.GenericServlet.init(GenericServlet.java:256)
> 
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
> 
> java:1044)
> 
> at
> org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88
> 
> 7)
> 
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
> 
> t.java:3959)
> 
> at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4
> 
> 284)
> 
> at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
> 
> .java:866)
> 
> at
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85
> 
> 0)
> 
> at
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)
> 
>  
> 
> at
> org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep
> 
> loyer.java:320)
> 
> at
> org.apache.catalina.core.StandardHost.install(StandardHost.java:875)
> 
> at
> org.apache.catalina.startup.HostConf

RE: Struts security/validation

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: James Adams [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 6:45 AM
> To: Struts Users Mailing List
> Subject: Struts security/validation
> 
> 
> Hello all,
> 
> I'm in the process of trying to secure my struts application 
> against "Cross site scripting", "SQL injection" style attacks.
> 
> One of the things I'm doing to prevent this is trying to 
> restrict special characters (;.<>(){}...etc) getting beyond 

Semicolon and period are perflecty legitimate for a textarea input.  I use a filter, 
that goes through the parameters looking for select.*from.*  for a quick check, then 
do a second more detailed look before rejecting for a security violation.  I do the 
same thing for insert and update as well, as seperate checks, which gives me some idea 
how far into the attack they've gotten.
I would also do the same thing for a cross site scripting attack, if I had a check for 
it.. actually look for keywords before flagging antyhing.  Since I do a lot of 
internal web apps, I'm not as concerned about this as I would be if I had external 
sites.

> the validator.
> 
> At the moment I'm using the validator plugin, within my 
> validation.xml I use the "mask" validator with the regular expression;
> 
> .
> mask
> 
> ^[^;"'\.\^\$\*\+\?\{\}\[\]\\\|\(\)]+$
> 
> .
> 
> 
> 
> 1. Does anyone know the syntax for also preventing < > & 
> within the regular expression bearing in mind its declared in XML?
> 
> Or is there some kind of default validator that does this?
> 
> 
> 
> 2. Some of my action functions also take input in the url as 
> a GET which does not go through the Validator, this is then 
> used to access a DB, these also need to be secured.  
> Obviously I can do this within each individual Action class, 
> but where would be the best single place I could stop 
> characters like < > ; &  ever getting as far as the Action classes?
> 
> Any other suggestions would be much appreciated, as I 
> couldn't find very much related to securing struts applications  
> 
> many thanks in advance
> 
> regards
> 
> James
> 
> 

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



Problem depoying struts-blank.war

2004-08-11 Thread Kenneth Litwak
I am trying to teach myself Struts while writing a real application.
I followed an tutorial that said to start by putting the
struts-blank.war in the webapps directory of Tomcat 5.  Unfortunately,
here's what I got:

 

Aug 11, 2004 8:24:50 AM org.apache.struts.util.PropertyMessageResources


INFO: Initializing,
config='org.apache.webapp.admin.ApplicationResources', retur

nNull=true

Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
install

INFO: Processing Context configuration file URL
file:C:\tomcat50\conf\Catalina\l

ocalhost\balancer.xml

Aug 11, 2004 8:24:55 AM org.apache.catalina.core.StandardHostDeployer
install

INFO: Processing Context configuration file URL
file:C:\tomcat50\conf\Catalina\l

ocalhost\manager.xml

Aug 11, 2004 8:24:56 AM org.apache.catalina.core.StandardHostDeployer
install

INFO: Installing web application at context path /struts-blank from URL
file:C:/

tomcat50/webapps/struts-blank

Aug 11, 2004 8:24:59 AM org.apache.struts.tiles.TilesPlugin
initDefinitionsFacto

ry

INFO: Tiles definition factory loaded for module ''.

Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
initResource

s

INFO: Loading validation rules file from '/WEB-INF/validator-rules.xml'

Aug 11, 2004 8:24:59 AM org.apache.struts.validator.ValidatorPlugIn
initResource

s

INFO: Loading validation rules file from '/WEB-INF/validation.xml'

Aug 11, 2004 8:25:00 AM org.apache.commons.digester.Digester error

SEVERE: Parse Error at line 45 column 15: The content of element type
"formset"

is incomplete, it must match "(constant*,form+)".

org.xml.sax.SAXParseException: The content of element type "formset" is
incomple

te, it must match "(constant*,form+)".

at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Un

known Source)

at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)

at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)

at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown S

ource)

at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown
Source)

 

at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknow

n Source)

at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent

Dispatcher.dispatch(Unknown Source)

at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un

known Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)

at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)

at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)

at
org.apache.commons.digester.Digester.parse(Digester.java:1567)

at
org.apache.commons.validator.ValidatorResources.(ValidatorResou

rces.java:159)

at
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPl

ugIn.java:233)

at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java

:164)

at
org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServle

t.java:839)

at
org.apache.struts.action.ActionServlet.init(ActionServlet.java:332)

at javax.servlet.GenericServlet.init(GenericServlet.java:256)

at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.

java:1044)

at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:88

7)

at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex

t.java:3959)

at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4

284)

at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase

.java:866)

at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:85

0)

at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:638)

 

at
org.apache.catalina.core.StandardHostDeployer.install(StandardHostDep

loyer.java:320)

at
org.apache.catalina.core.StandardHost.install(StandardHost.java:875)

at
org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:657

)

at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:476

)

at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1008)

at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java

:394)

at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl

eSupport.java:166)

at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1134)

 

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:832)

at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1126)

 

at
org.apache.catalina.core.StandardEngine.st

RE: stopping threads when sever stops

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Jignesh Patel [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 4:05 PM
> To: Struts Users Mailing List
> Subject: stopping threads when sever stops
> 
> 
> Hi Rick,
> 
> We are developing our software using struts and quartz with tomcat.
> When we stop our web server it never stops the back end 
> running threads.
> 
> We tried by developing separate listener but we never able to shutdown
> our application properly.
> 
> any suggestion will be helpful on this.

Servlet Context listener, listen on the context destroyed method and nuke your threads.

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



RE: Importing context with Struts

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Leandro Melo [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 8:29 PM
> To: struts jakarta
> Subject: Re: Importing context with Struts
> 
> 
> Well guys,
> i'm just a beginner here, so i couldn't some points.
> 
> I'll expose my situation in details, so maybe you show
> me how to accomplish that...
> 
> 
> Here's the base definition of my pages:
> path="/layouts/layout.jsp">
>   
>   
>   
>
>value="/functionalBlocks/errorHTMLcomponent.jsp"/>
>   
>   
>   
>

OKay... I have the exact same setup, and validation works just fine with this setup.  
The one thing I'm not doing is the ${name} that you are, but that shouldn't make a 
difference at all.  WHat scope are your errors beign put in?  That could be an issue.

Here's my base layout:


 










  

 
 








> 
> Here's the simple
> /functionalBlocks/errorHTMLcomponent.jsp page:
> <%@ taglib uri="/WEB-INF/struts-html.tld"
> prefix="html"%> 
> 
> 
> 
> I have a page for registering company data, wich is
> part of the following definition:
> name=".PartyPlace.RegisterCompanyCustomInfoReq"
> extends=".PartyPlaceSideBar">
>value="/register/registercompanycustominforeq.jsp"/>
>value="/pageComments/registercompanycustominforeq_PAGECOMMENT.jsp"/>
>value="/functionalSideBars/registercompany_SideBar.jsp"/>
>
> 
> 
> The registercompanycustominforeq.jsp page is the
> following one:
> 
>   <%@ include
> file="/functionalBlocks/companyHTMLcomponent.jsf" %>
>   <%@ include
> file="/functionalBlocks/buttonsHTMLcomponent.jsf" %>
> 
> 
> 
> 
> NOTE that the tag html:errors is not in
> registercompanycustominforeq.jsp page, it's in the
> errorHTMLcomponent.jsp page (as i showed).
> When i submit a request the hits the validate method,
> it comes back, but i cannot see the error because the
> html:errors tag is in another page.
> That's why i wanted to import the Struts context...
> However, if there's a Tiles way to workaround that,
> please, would you explain it to me?
> Maybe with some code... 
> 
> Thank you very much,
> ltcmelo
> 
> 
> 
> 
> 
> > > -Original Message-
> > > From: Michael McGrady
> > [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 3:51 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: Importing context with Struts
> > > 
> > > 
> > > I thought that digester actually created classes
> > out of this 
> > > stuff, Jim.  No?
> > 
> > Not quite the defintiion file gets turned into
> > one java bean per definition.  These java beans are
> > then used to pull the parts together for the tags (
> > paraphrased from SIA Chap 11.1 pg 324).
> > Since all jsp files are converted to a servlet
> > first, then compiled, I would tend to say that all
> > the jsps being declared in a tile definition being
> > in the same class couldn't happen... however I can't
> > seem to find out where websphere puts it's working
> > stuff *SIGH* to verify this I can't say for sure.
> > 
> > However, after digging through the tiles code I came
> > across this:
> >
> http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org
> /apache/struts/tiles/TilesUtilImpl.java?rev=1.9&view=markup
> > The part that answers the question:
> >  public void doInclude(
> > String uri,
> > HttpServletRequest request,
> > HttpServletResponse response,
> > ServletContext servletContext)
> > throws IOException, ServletException {
> > 
> >
> > request.getRequestDispatcher(uri).include(request,
> > response);
> > }
> > Which means no. all those jsp files are _NOT_
> > compiled into one big huge class. they are
> > individual servlets in keeping with the spec.
> > 
> > 
> > > 
> > > At 03:23 PM 8/10/2004, you wrote:
> > > 
> > > 
> > > > > -Original Message-
> > > > > From: Michael McGrady
> > [mailto:[EMAIL PROTECTED]
> > > > > Sent: Tuesday, August 10, 2004 3:14 PM
> > > > > To: Struts Users Mailing List
> > > > > Subject: RE: Importing context with Struts
> > > > >
> > > > >
> > > > > At 03:00 PM 8/10/2004, you wrote:
> > > > > >Not class no, scope yes.
> > > > >
> > > > > The "extension" is not real?
> > > >
> > > >Humina?
> > > >Let me try again:
> > > >The following definition uses the session scoped
> > bean 
> > > borrowerInformation 
> > > >in multiple jsp pages.  Each of them seperate
> > files, each of 
> > > them entirely 
> > > >unkowing of each other.  All know
> > borrowerInformation, for 
> > > it is in the 
> > > >session scope.  Knowing borrowerInformation makes
> > them

Re: HTTP Compression (Struts)

2004-08-11 Thread Michael McGrady
At 08:08 AM 8/11/2004, you wrote:
Yeah a lot of people.  There was a thread on this very topic last week 
please check the archive before posting :)

http://marc.theaimsgroup.com/?l=struts-user&m=109183678222344&w=2
Nathan
If you do a search on compression in the user messages, at 
www.servlets.com, for example, you really don't get much.  There is the 
good one by Craig, which is enough.  But not much other than that except 
stuff about ant compression.

Michael 


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


RE: Should every Action have an associated form?

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Matthew J. Vincent [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 7:51 PM
> To: Struts Users Mailing List
> Subject: Should every Action have an associated form?
> 
> 
> Hey everyone!
> 
> I hope to not get flamed, but it's getting late here and I'm tired of 
> looking through the archives.  Should every Action have an associated 
> ActionForm?  Is it a bad idea to read a parameter directly from the 
> request in the Action?  I have a page where I need to show 
> details for a 
> particular item in our database.  People will be directed to 
> this page 
> via a url http://127.0.0.1/foo/bar.do?id=123.  If I need an 
> ActonForm, 
> what's the best way to set this up in the struts-config.xml?  
> Thoughts?

The short answer, as other have said is of course no.  However, it can be easier to 
deal with a form then grabbing the var from the request itself, depending on your 
definition of easy, especially with being able to dynamically genereate your forms in 
the strutsconfig itself.
In addition, if you already have a form for showing the full object, you can use it to 
just get the id.  Appfuse does this quite a bit.


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



RE: java.net.ConnectException: Connection refused

2004-08-11 Thread Shilpa Nalgonda
Thanks Jim, I got it, now my application is working, i am using
loaclhost:3306 though.
But i turned off the security option, it is "no", if i make it "yes" i still
have accesControlException on getClassLoader.

-Original Message-
From: Jim Barrows [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 11:13 AM
To: Struts Users Mailing List
Subject: RE: java.net.ConnectException: Connection refused


Sorry, I was supposed to do this last night, but here' my config.
hibernate.connection.username=test
dao.type=hibernate
hibernate.connection.password=test
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.url=jdbc\:mysql\://localhost/VirtualVillage?autoReconne
ct\=true&useUnicode\=true&characterEncoding\=utf-8
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.show_sql=true

> -Original Message-
> From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 1:29 PM
> To: Struts Users Mailing List
> Subject: RE: java.net.ConnectException: Connection refused
>
>
> No there is no firewall on Linux box.
>
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 4:24 PM
> To: Struts Users Mailing List
> Subject: RE: java.net.ConnectException: Connection refused
>
>
>
>
> > -Original Message-
> > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 1:13 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.net.ConnectException: Connection refused
> >
> >
> > Hi Jim,
> > I have tried all different options for the jdbc url, but
> > everything leads to
> > same error,
> >  :java.net.ConnectException: Connection refused -- i tried to
> > get connection
> > from
> > DriverManager.getConnection() instead from datasource and
> > even that doen't
> > work.
> > I was able to use the same configuration on my desktop, so
> > its something to
> > do with the linux environment.
> > I am not able to figure it out, can you send me guildelines
> > on how u were
> > able to make it work, whenever u got time.
> > i am using mysql4.0, Tomcat 4.0, and struts1.1.
>
>
> Does your linux box have a firewall?  If so, is it blocking the port?
>
>
>
> >
> >
> > -Original Message-
> > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 1:17 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.net.ConnectException: Connection refused
> >
> >
> >
> >
> > > -Original Message-
> > > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 10:10 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: java.net.ConnectException: Connection refused
> > >
> > >
> > >
> > > This is a well known problem regarding MySQL and Linux.  One
> > > of two has a
> > > screwy implementation of resolving host names.  WHich one
> > > depends on who you
> > > talk to.
> > >
> > > Known solutions include using 127.0.0.1.  You will also have
> > > issues with
> > > authenticating to the server if you limit mysql logins by server.
> > >
> > > I have tried 127.0.0.1, but even this does not work gives
> > > same error, can
> > > you think of any other solution...
> >
> >
> > Unfortunately I'm not at home, which is where my MySQL
> > implementation is, so
> > I can't show you what I'm doing for another 7-8 hours :(
> >
> > On the other hand the MySQL folk have some great
> > documentation and help
> > forums that could probably help you more, if no one else has
> > any solutions
> > for you here.
> >
> >
> >
> >
> >
> > > Also changed driver class name to com.mysql.jdbc.Driver,
> didn't work
> > >
> > >  
> > > >  url
> > > > jdbc:mysql://127.0.0.1:3306/prototypedb?autoReconnect=t
> > > > rue
> > > >  
> > > > 
> > > > 
> > > >   driverClassName
> > > >   org.gjt.mm.mysql.Driver
> > > > 
> > >
> > >
> > > -Original Message-
> > > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 12:26 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: java.net.ConnectException: Connection refused
> > >
> > >
> > > > -Original Message-
> > > > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, August 10, 2004 9:17 AM
> > > > Cc: Struts Users Mailing List
> > > > Subject: RE: java.net.ConnectException: Connection refused
> > > >
> > > >
> > > >
> > > > I am using Tomcat4.0, struts1.1, mysql 4.0.18 , on Linux
> > > > environment.  And i
> > > > am unable
> > > > to connect to mysql db.  Below is the url
> > > > i am using in server.xml file. and also i have the jdbc
> > driver under
> > > > WEB-INF/lib -
> > mysql-connector-java-3.0.14-production-bin.jar...I was
> > > > successfully able to deploy the same application on Windows,
> > > > using the same
> > > > server.xml file. please help.
> > >
> > >
> > > This is a well known problem regarding MySQL and Linux.  One
> > > of two has a
> > > screwy implementation of resolving ho

RE: Taglibs generating lots of warning messages

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Andy Schmidgall [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 7:06 PM
> To: Struts Users Mailing List
> Subject: RE: Taglibs generating lots of warning messages
> 
> 
> Does anyone know anything about this? This is generating HUGE
> catalina.out files, and I would really like to use log4j to 
> catch these
> rather than having to build and/or configure yet another app just to
> rotate this one file...

No idea... tried to figure out how to reproduce this but couldn't.  Almost sounds like 
one of the struts jar files is mildly corrputed, but don't know for sure.




> 
> Thanks,
> Andy
> 
> -Original Message-
> From: Andy Schmidgall 
> Sent: Wednesday, August 04, 2004 4:57 PM
> To: Struts Users Mailing List
> Subject: Taglibs generating lots of warning messages
> 
> 
> Hello,
> 
> In our Struts app, whenever a JSP uses taglibs, the following 
> 4 messages
> are produced for each taglib referenced:
> 
> ---
> ParserUtils: warning org.xml.sax.SAXParseException: missing system ID,
> using http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
> ParserUtils: warning org.xml.sax.SAXParseException: URI was 
> not reported
> to parser for entity [document]
> ParserUtils: warning org.xml.sax.SAXParseException: No base URI; hope
> URI is absolute: 
http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
ParserUtils: warning org.xml.sax.SAXParseException: No base URI; hope
this SYSTEM id is absolute:
http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd
---

Now, this wouldn't be so bad, but I can't seem to figure out how to
filter these out with log4j. I turned off all logging to stdout, but
these warnings still go to stdout. (and on to catalina.out making for a
nice large log file)

Does anyone know how to either fix what it's complaining about, or
prevent these messages from displaying? The tags seem to be working just
fine otherwise.

Thanks,
Andy

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


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


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



RE: [OT] DAO ... where to draw the line?

2004-08-11 Thread Jim Barrows


> -Original Message-
> From: Matthew J. Vincent [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, August 11, 2004 8:21 AM
> To: Struts Users Mailing List
> Subject: [OT] DAO ... where to draw the line?
> 
> 
> [OFF TOPIC]
> 
> I know this is a struts forum, but as struts developers using DAOs, 
> where do your DAO implementation draw the line? 


Typically, I try to keep things as modular as possible.  This typically means that if 
I'm using JDBC, as opposed to Hibernate, I put the object graph together in the 
business layer, rather then try and do it in the DAO layer.  This allows me some 
flexibility in what I return back.  I can have a business method that will only return 
the employee, as opposed to the entire graph if my view only needs to see the employee 
and the entire graph might prohibitive ( time/space) to fully extract.

If you put everything into the DAO it can be somewhat more troublesome to do, possible 
certainly, but it always seems to me that how much data you pull back is a business 
requirement related to the server power (memory/speed) you have, not a function of the 
data itself.

> 
> For example:
> 
> Let''s say I have three tables:
> 
> Employee (contains employee_id, employee_name,  and dept_id)
> Department (contains dept_id, dept_name, loc_id)
> Location (contains loc_id, location_name)
> 
> How deep do your classes go to replicate the data? 
> 
> Do you do this...
> 
> public class Employee {
> private int id;
> private String name;
> private int deptId;   // just the id
> 
> // .. implementation details
> }
> 
> or do you do this
> 
> public class Employee {
> private int id;
> private String name;
> private Department dept;  // all of the data
> 
> // .. implementation details
> }
> 
> and so on and so on.   Class Department has the same type of 
> problem.  
> Does it hold just the id for location or a variable class Location?
> 
> Should DAOs just fill in the id (keys) so it is up to the application 
> using the DAOs to get the Employee class, then the Department 
> class, and 
> the the Location class like:
> 
> Employee emp = EmployeDAO.getEmployee(1);
> Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
> Location loc = LocationDAO.getLocation(dept.getLocId());
> System.out.println(emp.getEmpName() + " works in " + 
> loc.getLocationName());
> 
> or
> 
> Employee emp = EmployeDAO.getEmployee(1);
> System.out.println(emp.getEmpName() + " works in " + 
> emp.getDept().getLoc().getLocationName());
> 
> Now this is just a simple example, but where do you draw the 
> line?  It's 
> possible to go on and on and on and cycle back to employee...
> 
> Any thoughts, links, tips, best practices, whatvere would be helpful!
> 
> Thanks!
> 
> Matt
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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



[OT] DAO ... where to draw the line?

2004-08-11 Thread Matthew J. Vincent
[OFF TOPIC]
I know this is a struts forum, but as struts developers using DAOs, 
where do your DAO implementation draw the line? 

For example:
Let''s say I have three tables:
Employee (contains employee_id, employee_name,  and dept_id)
Department (contains dept_id, dept_name, loc_id)
Location (contains loc_id, location_name)
How deep do your classes go to replicate the data? 

Do you do this...
public class Employee {
   private int id;
   private String name;
   private int deptId;   // just the id
   // .. implementation details
}
or do you do this
public class Employee {
   private int id;
   private String name;
   private Department dept;  // all of the data
   // .. implementation details
}
and so on and so on.   Class Department has the same type of problem.  
Does it hold just the id for location or a variable class Location?

Should DAOs just fill in the id (keys) so it is up to the application 
using the DAOs to get the Employee class, then the Department class, and 
the the Location class like:

Employee emp = EmployeDAO.getEmployee(1);
Department dept = DepartmentDAO.getDepartment(emp.getDeptId());
Location loc = LocationDAO.getLocation(dept.getLocId());
System.out.println(emp.getEmpName() + " works in " + loc.getLocationName());
or
Employee emp = EmployeDAO.getEmployee(1);
System.out.println(emp.getEmpName() + " works in " + 
emp.getDept().getLoc().getLocationName());

Now this is just a simple example, but where do you draw the line?  It's 
possible to go on and on and on and cycle back to employee...

Any thoughts, links, tips, best practices, whatvere would be helpful!
Thanks!
Matt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Excel File Conversion

2004-08-11 Thread Rick Reumann
Viral_Thakkar wrote:
Data is available on the jsp page. I need to convert this to excel file
on click of a button. Is there any way in struts to do this?
If it you just want the page to display as is in Excel either
1) Use Tiles or Sitemesh and make sure your content opens in the Excel 
layout with the top of the layout having:

<% response.setContentType("application/vnd.ms-excel");
   response.setHeader("Pragma", "");
   response.setHeader("Cache-Control", "max-age=0"); %>
2) reuse the same JSP but have a test for an Excel flag at the top and 
create the same response header as above

If you need a 'true' Excel document I've been messing with JExcel and 
like it. http://www.andykhan.com/jexcelapi/  It's faster than POI.

By the way the two lines
   response.setHeader("Pragma", "");
   response.setHeader("Cache-Control", "max-age=0");
were needed to content with a bug in IE using Excel format across https. 
If you aren't use https you only need the first line
response.setContentType("application/vnd.ms-excel");

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


Re: Struts security/validation

2004-08-11 Thread Kishore Senji
On Wed, 11 Aug 2004 14:45:05 +0100, James Adams <[EMAIL PROTECTED]> wrote:
> Hello all,
> 
> I'm in the process of trying to secure my struts application against "Cross site 
> scripting", "SQL injection" style attacks.
> 
> One of the things I'm doing to prevent this is trying to restrict special characters 
> (;.<>(){}...etc) getting beyond the validator.
> 
> At the moment I'm using the validator plugin, within my validation.xml I use the 
> "mask" validator with the regular expression;
> 
> ..
> mask
> 
> ^[^;"'\.\^\$\*\+\?\{\}\[\]\\\|\(\)]+$
> 
> ..
> 
> 1. Does anyone know the syntax for also preventing < > & within the regular 
> expression bearing in mind its declared in XML?

In your regexp, you can specify "<" & ">" entities as "<" and
">" respectively.

> 
> Or is there some kind of default validator that does this?
> 
> 2. Some of my action functions also take input in the url as a GET which does not go 
> through the Validator, this is then used to access a DB, these also need to be 
> secured.  Obviously I can do this within each individual Action class, but where 
> would be the best single place I could stop characters like < > ; &  ever getting as 
> far as the Action classes?
> 

1) You can use a strategy similar to the one described in the below url
http://wiki.apache.org/struts/StrutsCatalogBaseAction

OR

2) You can also define a custom RequestProcessor and override
processPreprocess(HttpServletRequest request, HttpServletResponse
response).

> Any other suggestions would be much appreciated, as I couldn't find very much 
> related to securing struts applications
> 
> many thanks in advance
> 
> regards
> 
> James
> 
> 

Kishore Senji.

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



RE: java.net.ConnectException: Connection refused

2004-08-11 Thread Jim Barrows
Sorry, I was supposed to do this last night, but here' my config.
hibernate.connection.username=test
dao.type=hibernate
hibernate.connection.password=test
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.connection.url=jdbc\:mysql\://localhost/VirtualVillage?autoReconnect\=true&useUnicode\=true&characterEncoding\=utf-8
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.show_sql=true

> -Original Message-
> From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 1:29 PM
> To: Struts Users Mailing List
> Subject: RE: java.net.ConnectException: Connection refused
> 
> 
> No there is no firewall on Linux box.
> 
> -Original Message-
> From: Jim Barrows [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 10, 2004 4:24 PM
> To: Struts Users Mailing List
> Subject: RE: java.net.ConnectException: Connection refused
> 
> 
> 
> 
> > -Original Message-
> > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 1:13 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.net.ConnectException: Connection refused
> > 
> > 
> > Hi Jim,
> > I have tried all different options for the jdbc url, but 
> > everything leads to
> > same error,
> >  :java.net.ConnectException: Connection refused -- i tried to 
> > get connection
> > from
> > DriverManager.getConnection() instead from datasource and 
> > even that doen't
> > work.
> > I was able to use the same configuration on my desktop, so 
> > its something to
> > do with the linux environment.
> > I am not able to figure it out, can you send me guildelines 
> > on how u were
> > able to make it work, whenever u got time.
> > i am using mysql4.0, Tomcat 4.0, and struts1.1.
> 
> 
> Does your linux box have a firewall?  If so, is it blocking the port?
> 
> 
> 
> > 
> > 
> > -Original Message-
> > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 1:17 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.net.ConnectException: Connection refused
> > 
> > 
> > 
> > 
> > > -Original Message-
> > > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 10:10 AM
> > > To: Struts Users Mailing List
> > > Subject: RE: java.net.ConnectException: Connection refused
> > >
> > >
> > >
> > > This is a well known problem regarding MySQL and Linux.  One
> > > of two has a
> > > screwy implementation of resolving host names.  WHich one
> > > depends on who you
> > > talk to.
> > >
> > > Known solutions include using 127.0.0.1.  You will also have
> > > issues with
> > > authenticating to the server if you limit mysql logins by server.
> > >
> > > I have tried 127.0.0.1, but even this does not work gives
> > > same error, can
> > > you think of any other solution...
> > 
> > 
> > Unfortunately I'm not at home, which is where my MySQL 
> > implementation is, so
> > I can't show you what I'm doing for another 7-8 hours :(
> > 
> > On the other hand the MySQL folk have some great 
> > documentation and help
> > forums that could probably help you more, if no one else has 
> > any solutions
> > for you here.
> > 
> > 
> > 
> > 
> > 
> > > Also changed driver class name to com.mysql.jdbc.Driver, 
> didn't work
> > >
> > >  
> > > >  url
> > > > jdbc:mysql://127.0.0.1:3306/prototypedb?autoReconnect=t
> > > > rue
> > > >  
> > > > 
> > > > 
> > > >   driverClassName
> > > >   org.gjt.mm.mysql.Driver
> > > > 
> > >
> > >
> > > -Original Message-
> > > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 12:26 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: java.net.ConnectException: Connection refused
> > >
> > >
> > > > -Original Message-
> > > > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > > > Sent: Tuesday, August 10, 2004 9:17 AM
> > > > Cc: Struts Users Mailing List
> > > > Subject: RE: java.net.ConnectException: Connection refused
> > > >
> > > >
> > > >
> > > > I am using Tomcat4.0, struts1.1, mysql 4.0.18 , on Linux
> > > > environment.  And i
> > > > am unable
> > > > to connect to mysql db.  Below is the url
> > > > i am using in server.xml file. and also i have the jdbc 
> > driver under
> > > > WEB-INF/lib - 
> > mysql-connector-java-3.0.14-production-bin.jar...I was
> > > > successfully able to deploy the same application on Windows,
> > > > using the same
> > > > server.xml file. please help.
> > >
> > >
> > > This is a well known problem regarding MySQL and Linux.  One
> > > of two has a
> > > screwy implementation of resolving host names.  WHich one
> > > depends on who you
> > > talk to.
> > >
> > > Known solutions include using 127.0.0.1.  You will also have
> > > issues with
> > > authenticating to the server if you limit mysql logins by server.
> > >
> > >
> > >
> > > >
> > > > 
> > > >  factory
> > > >
> > > org.apache.commons.dbcp.BasicDataSourceFactory
> > > >  
> > > > 
> > > >  url
> > > > 

Re: HTTP Compression (Struts)

2004-08-11 Thread Nathan Maves
Yeah a lot of people.  There was a thread on this very topic last week 
please check the archive before posting :)

http://marc.theaimsgroup.com/?l=struts-user&m=109183678222344&w=2
Nathan
On Aug 11, 2004, at 4:17 AM, Shailender Jain wrote:
Hi,
Has anybody used Http Compression technique for a web application
developed using Struts Framework.
Please provide the information
Shailender Jain
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

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


[OT] "hidden" submit button

2004-08-11 Thread Barnett, Brian W.
Does anyone know how to create a hidden submit button? We're using images
for the buttons, but still want the "enter" key to submit the form. Is there
a better way to handle this? We tried a few things with css but it didn't
seem to work. (visibility:hidden and display:none will hide the button, but
"enter" does nothing.)

 

Thanks,

Brian



Re: Intermittent problem with DispatchAction

2004-08-11 Thread Michael McGrady
At 07:23 AM 8/11/2004, you wrote:
I was wondering how the request parameter gets set to null. Because, we
include the request parameter as a hidden property in the JSP, the
javascript method is always called with a hard coded string as argument
e.g.  html:submit onclick="setAction('applyChanges')" value="Apply Changes"
, and the parameter has a default value set in the form.
Try and see what the value of the parameter on the page is in the 
Action.  You may have a simple spelling issue.  Without knowing what the 
machinations are in your code, and they sound pretty "complexified", there 
is not much we can do out here to help.  To be crystal clear, one of the 
following things is happening:

1.   The value of the hidden parameter begins with null and is not being reset.
2.   The value of the hidden parameter begins not null and is set to null.
3.   The name of the hidden parameter is the same as the parameter 
attribute in your action mapping.
4.   The name of the hidden parameter is not the same as the parameter 
attribute in your action mapping.
5.   The names of the parameters in your action mapping, your form and your 
ActionForm are consistent.
6.   The names of the parameters in your action mapping, your form and your 
ActionForm are not consistent.
7.   Your actionscript is working as planned.
8.   Your actionscript is not  working.
9.   Your actionscript is not working as planned.

Or, one the preceding things is not happening.
I think your solution really looks way too complicated.  This is a lot of 
chances at error for a simple switch.

Michael

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


JDK version to be used with Struts 1.1

2004-08-11 Thread Christopher Kwiatkowski
What is the earliest version of the JDK that can be successfully used with
Struts 1.1.  We are currently operating at JDK 1.3 and I am experiencing
difficulty running a simple Struts 1.1 application.  I get the following
error.

[8/11/04 10:32:42:414 EDT] 4a850b15 WebGroup  I SRVE0180I: [webapr]
[/webapr] [Servlet.LOG]: action:   Creating new Action instance
[8/11/04 10:32:42:414 EDT] 4a850b15 WebGroup  I SRVE0181I: [webapr]
[/webapr] [Servlet.LOG]: action: Error creating Action instance for path
'/EmployeeSetupAction', class name
'edu.uga.webdfs.struts.action.EmployeeSetupAction': java.lang.VerifyError:
(class: edu/uga/webdfs/struts/action/EmployeeSetupAction, method: execute
signature:
(Lorg/apache/struts/action/ActionMapping;Lorg/apache/struts/action/ActionFor
m;Ljavax/servlet/http/HttpServletRequest;Ljavax/servlet/http/HttpServletResp
onse;)Lorg/apache/struts/action/ActionForward;) Incompatible o








Re: Multiple image tags

2004-08-11 Thread Michael McGrady
Let me try again on this, Leandro, as much for myself as for you.  The 
LookupDIspatchAction, which I don't care for, only gives you one thing: a 
promise that the page author will have to use a particular name for the 
parameter name to be used in the Action for deciding which method to 
use.  That is it.  So, somehow the page author has to provide a value for 
the parameter name you specify in your LookupDispatchAction action mapping 
xml parameter attribute.  Thus, if you use parameter='method' in your 
action mapping xml, then you can know that using 'method' in your "hidden" 
values in the form will work.  You can also know, of course, that you then 
MUST use the request parameter 'method' in your form.  You can do the same 
thing without giving the parameter attribute of your action mapping any 
value at all.  You merely have to coordinate the page hidden parameter name 
and the parameter name mined in the Action.  The use of the parameter 
attribute in the action mapping MERELY forces the page author to conform to 
your requirements in the Action class, which then becomes the 
DispatchAction class or LookupDispatchActino class.

The whole point of using an image tag solution is to (1) get out of a 
Struts specific solution to this "age old" problem and to (2) provide a 
solution to the need to make a switch in the processing of an action.  The 
".x" and ".y" in the parameter names of an image tag operate just like the 
parameter attribute of the action mapping for the LookupDispatchAction and 
DispatchAction.  The difference is that it is not Struts specific and is a 
"worldwide" standard.  The code which follows, viz.

public final class ButtonCommand {
  private ButtonCommand() {
  }
  public final static String getCommand(HttpServletRequest request) {
Enumeration enum = request.getParameterNames();
String parameterName = null;
while(enum.hasMoreElements()) {
  parameterName = (String)enum.nextElement();
  if(parameterName.endsWith(".x")) {
return parameterName.substring(0,parameterName.indexOf('.'));
  }
}
return parameterName;
  }
}
simply does this using image tags instead of hidden parameters in the 
form.  You can, of course, just copy the method getCommand into your 
processing helper classes in the model.

Does this ring any bells?
Michael McGrady
At 08:09 PM 8/10/2004, you wrote:
The problem is that both solutions in a higher level
focus on getting the parameter and checking it out to
see its value.
In my case, i got a MyLookupDispatchAction that
receives all the requests and forwards it to the
specific method. So, there's no meanwhile to get the
request parameter, check it out and forward to some
method.
UNLESS,
i use someking of hidden field in the form with a name
that MyLookupDispatchAction expects:
protected Map getKeyMethodMap(){
   Map map = new HashMap();
   map.put("hidden.field", "verifyParameterMethod");
}
And the in the "verifyParameterMethod()", i'd use call
"getCommand(HttpServletRequest request)" to check what
was the value of the real parameter i want (the one
from the image tag). Finally, i would compare this
value and forward the data to the responsible method.
Am i correct?
It just seems a little confusing...


Re: Intermittent problem with DispatchAction

2004-08-11 Thread Michael Searles
Thanks for that Kishore,

I was wondering how the request parameter gets set to null. Because, we
include the request parameter as a hidden property in the JSP, the
javascript method is always called with a hard coded string as argument
e.g.  html:submit onclick="setAction('applyChanges')" value="Apply Changes"
, and the parameter has a default value set in the form.

Just as a side note, we are using https. Could there be a problem with the
version of Internet Explorer we are running. I have seen from the mailing
list that there have been issues with IE 6 SP1 and SSL.

Thanks
Mike.


- Original Message -
From: "Kishore Senji" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, August 11, 2004 2:52 PM
Subject: Re: Intermittent problem with DispatchAction


> On Wed, 11 Aug 2004 13:37:40 +0100, Michael Searles
> <[EMAIL PROTECTED]> wrote:
> >
> > Hi Folks,
> >
> > I am using a DispatchAction which switches between several methods
depending on the value of the forwarding parameter which is set in the
JSP(see code snipet below).
> >
> > The DispatchAction is fine approx 80% of the time, but ocassionally and
without warning, I get the following DispatchAction error --
> > ERROR [apache.struts.actions.DispatchAction] Request[/admin/UserDetails]
does not contain handler parameter named action.
>
>  "action", Your request parameter, which drives which method to
> dispatch to, is null for that particular request.
>
> Thanks,
> Kishore Senji.
>
> >
> > Its difficult to trace this problem because of its intermittent nature
and unfortunatley i can't provide more detailed info at this time.
> >
> > Any help wouuld be appreciated.
> > Mike.
> >
> > I am using Internet Explorer 6 with Struts Version 1.1
> >
> > Code Snipet.
> >
> > * javascrip fuction ***
> > function setAction(val) {
> > document.forms[0].action.value=val;
> > }
> > ***
> > 
> > 
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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



RE: java.net.ConnectException: Connection refused

2004-08-11 Thread Shilpa Nalgonda
I am able to get it work with org.gjt.mm.mysql.Driver itself.


-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 10, 2004 6:03 PM
To: [EMAIL PROTECTED]
Subject: RE: java.net.ConnectException: Connection refused


Sounds like you may have a different classloader
best to use the class loader that the DriverManangerConnectionFactory uses
e.g.
Class.forName("com.mysql.jdbc.Driver", true,
DriverManagerConnectionFactory.class.getClassLoader());

Let me know how you make out,

Martin Gainty






>From: "Jim Barrows" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: RE: java.net.ConnectException: Connection refused
>Date: Tue, 10 Aug 2004 10:16:42 -0700
>MIME-Version: 1.0
>Received: from mail.apache.org ([209.237.227.199]) by mc12-f11.hotmail.com
>with Microsoft SMTPSVC(5.0.2195.6824); Tue, 10 Aug 2004 10:17:13 -0700
>Received: (qmail 16184 invoked by uid 500); 10 Aug 2004 17:16:45 -
>Received: (qmail 16166 invoked by uid 99); 10 Aug 2004 17:16:44 -
>Received: from [12.34.77.106] (HELO SSSC-MAIL-2.internal.sssc.com)
>(12.34.77.106)  by apache.org (qpsmtpd/0.27.1) with ESMTP; Tue, 10 Aug 2004
>10:16:44 -0700
>X-Message-Info: JGTYoYF78jHjm9i5WASZbo4Un9bGokO1
>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>Precedence: bulk
>List-Unsubscribe: 
>List-Subscribe: 
>List-Help: 
>List-Post: 
>List-Id: "Struts Users Mailing List" 
>Delivered-To: mailing list [EMAIL PROTECTED]
>X-ASF-Spam-Status: No, hits=0.0 required=10.0tests=
>X-Spam-Check-By: apache.org
>content-class: urn:content-classes:message
>X-MimeOLE: Produced By Microsoft Exchange V6.0.6487.1
>Message-ID:
><[EMAIL PROTECTED]>
>X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic:
>java.net.ConnectException: Connection refused
>Thread-Index: AcR+/Raevrqm1LFhRiC9L2lugobangAAEiFg
>X-Virus-Checked: Checked
>Return-Path: [EMAIL PROTECTED]
>X-OriginalArrivalTime: 10 Aug 2004 17:17:13.0578 (UTC)
>FILETIME=[E0C0E4A0:01C47EFD]
>
>
>
> > -Original Message-
> > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 10:10 AM
> > To: Struts Users Mailing List
> > Subject: RE: java.net.ConnectException: Connection refused
> >
> >
> >
> > This is a well known problem regarding MySQL and Linux.  One
> > of two has a
> > screwy implementation of resolving host names.  WHich one
> > depends on who you
> > talk to.
> >
> > Known solutions include using 127.0.0.1.  You will also have
> > issues with
> > authenticating to the server if you limit mysql logins by server.
> >
> > I have tried 127.0.0.1, but even this does not work gives
> > same error, can
> > you think of any other solution...
>
>
>Unfortunately I'm not at home, which is where my MySQL implementation is,
>so I can't show you what I'm doing for another 7-8 hours :(
>
>On the other hand the MySQL folk have some great documentation and help
>forums that could probably help you more, if no one else has any solutions
>for you here.
>
>
>
>
>
> > Also changed driver class name to com.mysql.jdbc.Driver, didn't work
> >
> >  
> > >  url
> > > jdbc:mysql://127.0.0.1:3306/prototypedb?autoReconnect=t
> > > rue
> > >  
> > > 
> > >   
> > > driverClassName
> > > org.gjt.mm.mysql.Driver
> > >   
> >
> >
> > -Original Message-
> > From: Jim Barrows [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 10, 2004 12:26 PM
> > To: Struts Users Mailing List
> > Subject: RE: java.net.ConnectException: Connection refused
> >
> >
> > > -Original Message-
> > > From: Shilpa Nalgonda [mailto:[EMAIL PROTECTED]
> > > Sent: Tuesday, August 10, 2004 9:17 AM
> > > Cc: Struts Users Mailing List
> > > Subject: RE: java.net.ConnectException: Connection refused
> > >
> > >
> > >
> > > I am using Tomcat4.0, struts1.1, mysql 4.0.18 , on Linux
> > > environment.  And i
> > > am unable
> > > to connect to mysql db.  Below is the url
> > > i am using in server.xml file. and also i have the jdbc driver under
> > > WEB-INF/lib - mysql-connector-java-3.0.14-production-bin.jar...I was
> > > successfully able to deploy the same application on Windows,
> > > using the same
> > > server.xml file. please help.
> >
> >
> > This is a well known problem regarding MySQL and Linux.  One
> > of two has a
> > screwy implementation of resolving host names.  WHich one
> > depends on who you
> > talk to.
> >
> > Known solutions include using 127.0.0.1.  You will also have
> > issues with
> > authenticating to the server if you limit mysql logins by server.
> >
> >
> >
> > >
> > > 
> > >  factory
> > >
> > org.apache.commons.dbcp.BasicDataSourceFactory
> > >  
> > > 
> > >  url
> > > jdbc:mysql://localhost:3306/prototypedb?autoReconnect=t
> > > rue
> > >  
> > > 
> > >   
> > > driverClassName
> > > or

Re: STRUTS ONLINE TUTORIAL

2004-08-11 Thread Michael McGrady
At 06:31 AM 8/11/2004, you wrote:
I suggest Rick Reumann's site:
http://www.reumann.net/do/struts/main
Erik
I had not seen this before.  This is good stuff.  Great job, Rick.
Michael

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


Re: Intermittent problem with DispatchAction

2004-08-11 Thread Michael McGrady
At 06:52 AM 8/11/2004, you wrote:
> Hi Folks,
>
> I am using a DispatchAction which switches between several methods 
depending on the value of the forwarding parameter which is set in the 
JSP(see code snipet below).
>
> The DispatchAction is fine approx 80% of the time, but ocassionally and 
without warning, I get the following DispatchAction error --
> ERROR [apache.struts.actions.DispatchAction] 
Request[/admin/UserDetails] does not contain handler parameter named action.

 "action", Your request parameter, which drives which method to
dispatch to, is null for that particular request.
Thanks,
Kishore Senji.
The reason the request parameter is null is probably because your hidden 
parameter is misspelled or something.  I am not sure why people like this 
DispatchAction.  It overcomplicates simple solutions and leads to this sort 
of problem.  In my opinion, using the DispatchAction just complicates and 
couples matters that don't need the complication and certainly don't need 
the decoupling.  If you had merely used, for example,  and not set your parameter in your action 
mapping to 'method', you would achieve the same result.  The only thing 
that DispatchAction and LookupDispatchAction do is to tie the parameter 
attribute value in the ActionMapping to a given parameter name in the 
request.  This is not a good thing, in my opinion, but a bad thing.

Michael

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


Re: Intermittent problem with DispatchAction

2004-08-11 Thread Kishore Senji
On Wed, 11 Aug 2004 13:37:40 +0100, Michael Searles
<[EMAIL PROTECTED]> wrote:
> 
> Hi Folks,
> 
> I am using a DispatchAction which switches between several methods depending on the 
> value of the forwarding parameter which is set in the JSP(see code snipet below).
> 
> The DispatchAction is fine approx 80% of the time, but ocassionally and without 
> warning, I get the following DispatchAction error --
> ERROR [apache.struts.actions.DispatchAction] Request[/admin/UserDetails] does not 
> contain handler parameter named action.

 "action", Your request parameter, which drives which method to
dispatch to, is null for that particular request.

Thanks,
Kishore Senji.

> 
> Its difficult to trace this problem because of its intermittent nature and 
> unfortunatley i can't provide more detailed info at this time.
> 
> Any help wouuld be appreciated.
> Mike.
> 
> I am using Internet Explorer 6 with Struts Version 1.1
> 
> Code Snipet.
> 
> * javascrip fuction ***
> function setAction(val) {
> document.forms[0].action.value=val;
> }
> ***
>  />
>  tabindex="11"/>

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



Struts security/validation

2004-08-11 Thread James Adams
Hello all,

I'm in the process of trying to secure my struts application against "Cross site 
scripting", "SQL injection" style attacks.

One of the things I'm doing to prevent this is trying to restrict special characters 
(;.<>(){}...etc) getting beyond the validator.

At the moment I'm using the validator plugin, within my validation.xml I use the 
"mask" validator with the regular expression;

.
mask

^[^;"'\.\^\$\*\+\?\{\}\[\]\\\|\(\)]+$

.



1. Does anyone know the syntax for also preventing < > & within the regular expression 
bearing in mind its declared in XML?

Or is there some kind of default validator that does this?



2. Some of my action functions also take input in the url as a GET which does not go 
through the Validator, this is then used to access a DB, these also need to be 
secured.  Obviously I can do this within each individual Action class, but where would 
be the best single place I could stop characters like < > ; &  ever getting as far as 
the Action classes?

Any other suggestions would be much appreciated, as I couldn't find very much related 
to securing struts applications  

many thanks in advance

regards

James



stopping threads when sever stops

2004-08-11 Thread Jignesh Patel
Hi Rick,

We are developing our software using struts and quartz with tomcat.
When we stop our web server it never stops the back end running threads.

We tried by developing separate listener but we never able to shutdown
our application properly.

any suggestion will be helpful on this.

-Jignesh



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



Re: STRUTS ONLINE TUTORIAL

2004-08-11 Thread Erik Weber
I suggest Rick Reumann's site:
http://www.reumann.net/do/struts/main
Erik
Lin, Xinhua wrote:
Dear All,
Where can I find online tutorial or example-driven documents for struts?
Thanks,
Xinhua
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

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


STRUTS ONLINE TUTORIAL

2004-08-11 Thread Lin, Xinhua


Dear All,
Where can I find online tutorial or example-driven documents for struts?
Thanks,

Xinhua

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



Re: I have a form spread over several pages. The user fills out each section in progression. I am using a dispatch action and each page calls the same function i.e. processForm. I want struts to validate each submission but I cannot change the input page

2004-08-11 Thread Michael McGrady
At 06:15 AM 8/11/2004, you wrote:
 the problem is that when the validation ( on say page 5 ) fails the user 
gets sent back to page one because only one input page parameter is 
allowed per action definition (in struts-config).
Don't get stuck on what the XML does.  Use those values as a tool rather 
than as a restriction or boundary.  You can redefine the ActionForward in 
your processing at any time.  The user can be sent back, given different 
validation problems to any page you want.

Michael

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


Re: I have a form spread over several pages. The user fills out each section in progression. I am using a dispatch action and each page calls the same function i.e. processForm. I want struts to validate each submission but I cannot change the input page

2004-08-11 Thread teknokrat
Kataria, Satish wrote:
I am suggesting that you should have a single action having a method for
each of the page. This can be configured by using DispatchAction class
and configured in struts-config.xml using the attribute "parameter" for
finding which of the method to execute.
I get you. This is what we have currently, the problem is that when the 
validation ( on say page 5 ) fails the user gets sent back to page one 
because only one input page parameter is allowed per action definition 
(in struts-config).  It seems to me you still have to define a separate 
action path for each page you want validated (though it would map to a 
particular function in your DispatchAction ) .

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


Re: Servlet help for a Struts programmer

2004-08-11 Thread Denis Avdic
Wow.  I unleashed a beast.  Next time I'll ask the question
way before I have to leave work.

I have to thank you all for your input.  The discussion on Servlets
and Struts and how they relate (or don't) was in itself very helpful
to understanding how the things work.

I will take your advice and tutorials and start from web.xml.  

One of the things I love about my job is that I always learn something
on every project, be it Struts, or a taglib or (in this case a "missed
step") Servlet.

Thank you!

Denis

On Tue, 10 Aug 2004 18:04:04 -0500, joe a. <[EMAIL PROTECTED]> wrote:
> np!  what are cognizantorees?
> 
> On Tue, 10 Aug 2004 14:54:11 -0700, Michael McGrady
> 
> 
> <[EMAIL PROTECTED]> wrote:
> > At 02:21 PM 8/10/2004, you wrote:
> > >Have any of you guys read Jakarta Struts Live by Hightower?  Its
> > >available for free here in pdf form:
> > >http://www.theserverside.com/books/sourcebeat/JakartaStrutsLive/index.tss
> >
> > Thanx!  I also highly recommend as a beginning The Struts Framework by Sue
> > Spielman.  Ted Husted's Struts in Action and Programming Jakarta Struts by
> > Chuck Cavaness are, of course, better for the "cognizantorees".
> >
> >
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

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



Intermittent problem with DispatchAction

2004-08-11 Thread Michael Searles
 
Hi Folks,

I am using a DispatchAction which switches between several methods depending on the 
value of the forwarding parameter which is set in the JSP(see code snipet below).

The DispatchAction is fine approx 80% of the time, but ocassionally and without 
warning, I get the following DispatchAction error --
 ERROR [apache.struts.actions.DispatchAction] Request[/admin/UserDetails] does not 
contain handler parameter named action.

Its difficult to trace this problem because of its intermittent nature and 
unfortunatley i can't provide more detailed info at this time.

Any help wouuld be appreciated.
Mike.

I am using Internet Explorer 6 with Struts Version 1.1 


Code Snipet.

* javascrip fuction ***
function setAction(val) {
document.forms[0].action.value=val;
}
***



Re: Should every Action have an associated form?

2004-08-11 Thread Matthew J. Vincent
Thanks everyone!  Much appreciated.
Matt
Michael McGrady wrote:
I have lots of actions without forms.  They are useful when you don't 
have forms.  LOL  Seriously, that is the reason.

Michael
At 07:51 PM 8/10/2004, you wrote:
Hey everyone!
I hope to not get flamed, but it's getting late here and I'm tired of 
looking through the archives.  Should every Action have an associated 
ActionForm?  Is it a bad idea to read a parameter directly from the 
request in the Action?  I have a page where I need to show details 
for a particular item in our database.  People will be directed to 
this page via a url http://127.0.0.1/foo/bar.do?id=123.  If I need an 
ActonForm, what's the best way to set this up in the 
struts-config.xml?  Thoughts?

Thanks in advance!
Matt
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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

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


RE: I have a form spread over several pages. The user fills out each section in progression. I am using a dispatch action and each page calls the same function i.e. processForm. I want struts to validate each submission but I cannot change the input page

2004-08-11 Thread Kataria, Satish
I am suggesting that you should have a single action having a method for
each of the page. This can be configured by using DispatchAction class
and configured in struts-config.xml using the attribute "parameter" for
finding which of the method to execute.

Thanks,
Satish

-Original Message-
From: teknokrat [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 5:02 PM
To: [EMAIL PROTECTED]
Subject: Re: I have a form spread over several pages. The user fills out
each section in progression. I am using a dispatch action and each page
calls the same function i.e. processForm. I want struts to validate each
submission but I cannot change the input page


Kataria, Satish wrote:
> Hi, 
> Instead of having a single function what I would suggest in ur case is
a
> session scoped action form
> And each page having same actionform but different action mapping.
Thus
> using this you can specify approiate page as the input page.
> For code examples refer to struts documentation of using action
scopped
> action form.
> Please revert in case of any problems.
> 
> Thanks,
> Satish Kataria
> 
> -Original Message-
> From: teknokrat [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, August 10, 2004 8:11 PM
> To: [EMAIL PROTECTED]
> Subject: I have a form spread over several pages. The user fills out
> each section in progression. I am using a dispatch action and each
page
> calls the same function i.e. processForm. I want struts to validate
each
> submission but I cannot change the input page in t
> 
> 
> I have a form spread over several pages. The user fills out each
section
> 
> in progression. I am using a dispatch action and each page calls the 
> same function i.e. processForm. I want struts to validate each 
> submission but I cannot change the input page in the action ( I get 
> configuration frozen thrown). I don't want to send the user back to
the 
> beginning page if they've only made a mistake in the last page so what

> am I to do?
> 
> thanks
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

I am interested in this too, but do not understand the suggestion. Are 
you saying that if you have a 10-page input process you should define 10

separate actions? Is there no way to dynamically change the input page 
in struts?

thanks


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

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



Re: I have a form spread over several pages. The user fills out each section in progression. I am using a dispatch action and each page calls the same function i.e. processForm. I want struts to validate each submission but I cannot change the input page

2004-08-11 Thread teknokrat
Kataria, Satish wrote:
Hi, 
Instead of having a single function what I would suggest in ur case is a
session scoped action form
And each page having same actionform but different action mapping. Thus
using this you can specify approiate page as the input page.
For code examples refer to struts documentation of using action scopped
action form.
Please revert in case of any problems.

Thanks,
Satish Kataria
-Original Message-
From: teknokrat [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 10, 2004 8:11 PM
To: [EMAIL PROTECTED]
Subject: I have a form spread over several pages. The user fills out
each section in progression. I am using a dispatch action and each page
calls the same function i.e. processForm. I want struts to validate each
submission but I cannot change the input page in t

I have a form spread over several pages. The user fills out each section
in progression. I am using a dispatch action and each page calls the 
same function i.e. processForm. I want struts to validate each 
submission but I cannot change the input page in the action ( I get 
configuration frozen thrown). I don't want to send the user back to the 
beginning page if they've only made a mistake in the last page so what 
am I to do?

thanks
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I am interested in this too, but do not understand the suggestion. Are 
you saying that if you have a 10-page input process you should define 10 
separate actions? Is there no way to dynamically change the input page 
in struts?

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


HTTP Compression (Struts)

2004-08-11 Thread Shailender Jain
Hi,

Has anybody used Http Compression technique for a web application
developed using Struts Framework.

Please provide the information

Shailender Jain


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



RE: I have a form spread over several pages. The user fills out each section in progression. I am using a dispatch action and each page calls the same function i.e. processForm. I want struts to validate each submission but I cannot change the input page

2004-08-11 Thread Kataria, Satish
Hi, 
Instead of having a single function what I would suggest in ur case is a
session scoped action form
And each page having same actionform but different action mapping. Thus
using this you can specify approiate page as the input page.
For code examples refer to struts documentation of using action scopped
action form.
Please revert in case of any problems.

Thanks,
Satish Kataria

-Original Message-
From: teknokrat [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 10, 2004 8:11 PM
To: [EMAIL PROTECTED]
Subject: I have a form spread over several pages. The user fills out
each section in progression. I am using a dispatch action and each page
calls the same function i.e. processForm. I want struts to validate each
submission but I cannot change the input page in t


I have a form spread over several pages. The user fills out each section

in progression. I am using a dispatch action and each page calls the 
same function i.e. processForm. I want struts to validate each 
submission but I cannot change the input page in the action ( I get 
configuration frozen thrown). I don't want to send the user back to the 
beginning page if they've only made a mistake in the last page so what 
am I to do?

thanks


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

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



Re: using tiles with dynamic links

2004-08-11 Thread David Stevenson
On 11/8/04 6:18, "Michael McGrady" <[EMAIL PROTECTED]> wrote:

> I loved those competitions in perl that tried to
> be the hardest to understand.

Competitions? I've seen C ones (the 12 days of Xmas one is a classic), but
truly idiomatic Perl is self-obfuscating!

Let's not get into language wars, eh?  I did Perl then, I do Java now, I
want to keep legacy content, but integrate it with the tiles-based
templating if possible.

Still, got a few ideas out of this thread, and I'm looking at scrape right
now.

Cheers


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



  1   2   >