Help on installing struts-el

2003-07-06 Thread Richard Mixon
Where can I find instructions on how to use the struts-el version of struts
instead of the standard struts lib files? The README does not cover this
and that seems to be all there is in the way of doc.

I'm laboring under the assumption that struts-el is a super-set of struts. I
should be able to move my existing application over and have it use the
struts-el jar files. I can then selectively change from, for example an
html:text tag to an html-el:text tag assuming I've setup the TLD's
correctly for my taglibs.

I had a document that explained it well - but tossed it the other day,
thinking I was not going to need it for a while. Guess what, I need it now
:-). I remember that it said you needed to first use the standard struts
lib files and then selectively replace them with the files in the
contrib lib directory. I've been Googling for hours and searching the
archive - cannot find anything substantiative.

I tried just using the contrib/struts-el/lib directory files, but end up
getting errors from the validation javascripts issued by my
html:javascript tags (cannot find the required validation).

Any pointers or advice are appreciated.

Thanks - Richard



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



Re: Help on installing struts-el

2003-07-06 Thread David M. Karr
 Richard == Richard Mixon [EMAIL PROTECTED] writes:

Richard Where can I find instructions on how to use the struts-el version of 
struts
Richard instead of the standard struts lib files? The README does not cover this
Richard and that seems to be all there is in the way of doc.

Richard I'm laboring under the assumption that struts-el is a super-set of 
struts. I
Richard should be able to move my existing application over and have it use the
Richard struts-el jar files. I can then selectively change from, for example an
Richard html:text tag to an html-el:text tag assuming I've setup the TLD's
Richard correctly for my taglibs.

Richard I had a document that explained it well - but tossed it the other day,
Richard thinking I was not going to need it for a while. Guess what, I need it now
Richard :-). I remember that it said you needed to first use the standard struts
Richard lib files and then selectively replace them with the files in the
Richard contrib lib directory. I've been Googling for hours and searching the
Richard archive - cannot find anything substantiative.

Richard I tried just using the contrib/struts-el/lib directory files, but end up
Richard getting errors from the validation javascripts issued by my
Richard html:javascript tags (cannot find the required validation).

You need both the Struts-EL and Struts jars.  If you look in the struts-el
distribution, you'll see a strutsel-exercise-taglib application.  You can
inspect that application to see the jars that you'll need.  If you're getting
errors from the validation javascripts, I'm not sure what is happening there.

-- 
===
David M. Karr  ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]   ; SCJP; SCWCD




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



logic:iterate question

2003-07-06 Thread Marco.Mistroni
hi all,
i have a Map-backed action Form which contains an HashMap

the ActionForm is as follows

public MapActionForm extends ActionForm {
HashMap table = new HashMap();


public void setValue(String key, String value) {
  ...
  }

public Object getValue(String key) {
..
  }

  public HashMap getTable() {
return table;
  }

}


in one of jsp i have to display a textfield for each key contained in the HashMap.

i have written following code (name of the bean is DisplayKeys)

logic:iterate id=params collection=%= displayKeys.getTable() %
  tr
tdbean:write name=params//td
tdhtml:text property=value(bean:write 
name=params/)//td
  /tr
/logic:iterate

but when i get into the page (after populating the bean) i got following exception:

org.apache.jasper.JasperException: /callservice.jsp(53,79) equal symbol expected

the hashmap contains parameter names.
in the jps i want to display the name of the parameter (done with bean:write 
name=params)
and i want to display close to teh name an input text with the name of the parameter..

Example:
in the map i have following values

param1, 
param2, 


and in the jsp i want to display

param1 : input type=text name=param1/


anyone can give me some help?

regards
marco   



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



Re: javascipt error in IE

2003-07-06 Thread Adam Hardy
Well, I just upgraded to IE6 (SP1) and I don't get any errors for credit 
card nor required, nor in fact any errors at all. I just checked to make 
sure javascript errors were notified.

I seem to have wiped out IE5.5, which I wanted to keep for testing. I 
installed IE6 in a different directory, but if I launch IE5 with the 
iexplore.exe from the original directory, I still get IE6. Is there some 
trick to doing this?

Huang, Andy wrote:
No, this error happen for all form validations I used, including required,
credit card, and zip code validator.
Althought the problem is not fatal, since if I turn off
Display a notification about every script error in advanced tab of
IE internet options, the pop-up error message will just be silent, 
and proper error message still display for user input (which I thought
shouldn't went thru, because of the javascript error)

But this not acceptable for production use.

Any ideas?

-Original Message-
From: Adam Hardy
To: Struts Users Mailing List
Sent: 7/4/2003 5:43 AM
Subject: Re: javascipt error in IE
You mean the error comes from the email-validation?

Richard Mixon wrote:

Andy, I too would like to know how to fix this when using the
validator

Javascripts. In most cases it appears to be benign, but irritating.
I've got

on or two forms that it really does break though.

Hope someone has an clue.

- Richard

-Original Message-
From: Huang, Andy [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 03, 2003 2:19 PM
To: '[EMAIL PROTECTED]'
Subject: RE: javascipt error in IE
No one experience this problem???

-Original Message-
From: Huang, Andy
Sent: Thursday, July 03, 2003 1:46 PM
To: '[EMAIL PROTECTED]'
Subject: javascipt error in IE
I got an Error: Object Expected in IE 6, but run without any problem
in

Netscape or Opera.

I have a login form with onsubmit=return validateLoginForm(this);
to validate the login email address and password (I have included the
html

souce code snippet below)

My guess is that the IE browser having problem to read
staticJavascript.jsp

when it load the page.

Any help will be appreciated

form name=loginForm method=post action=/Login.do
onsubmit=return

validateLoginForm(this);
table border=0 width=100%
 tr
   th align=right
 Email Address:
   /th
   td align=left
 input type=text name=email maxlength=27 size=25
value=

   /td
 /tr
 tr
   th align=right
 Password:
   /th
   td align=left
 input type=password name=password maxlength=18 size=16
value=
   /td
 /tr
 tr
   td align=right
 input type=submit value=Submit
   /td
   td align=left
 input type=reset value=Reset
   /td
 /tr
/table
/form
script type=text/javascript language=JavaScript
 !--
 var focusControl = document.forms[loginForm].elements[email];
 if (focusControl.type != hidden) {
focusControl.focus();
 }
 // --
/script


script type=text/javascript language=Javascript1.1
!-- Begin
var bCancel = false;

   function validateLoginForm(form) {

   if (bCancel)
 return true;
   else
  return validateEmail(form)  validateMaxLength(form) 
validateMinLength(form);
  }
   function email () {
this.aa = new Array(email, liEmail Address is an invalid
e-mail

address./li, new Function (varName,  return this[varName];));
   }
   function maxlength () {
this.aa = new Array(password, liPassword cannot be greater
than 16

characters./li, new Function (varName, this.maxlength='16';
this.minlength='3';  return this[varName];));
   }
   function minlength () {
this.aa = new Array(password, liPassword cannot be less than
3

characters./li, new Function (varName, this.maxlength='16';
this.minlength='3';  return this[varName];));
   }
//End --
/script
script language=Javascript1.1 src=staticJavascript.jsp/script







-
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]


ActionForms and errors?

2003-07-06 Thread Terje Hopsø
Hello,
 
I am trying to figure out how ActionForm and validate()-function work. If I
returns an error (ActionErrors) from my ActionForm it fail (se below for
output). Returning null everything works fine. I thought that when returning
an error I would return to my loginpage automatically. But I dont. Anyone
who can explain to me hwo this works og give me a link with a fully
functioning example? I have looked at examples but they are for the most
parts of an example.
 
- Terje
 
Error when pressing submit in login.jsp
type Status report

message No input attribute for mapping path /struts/authenticate

description The server encountered an internal error (No input attribute for
mapping path /struts/authenticate) that prevented it from fulfilling this
request.

 
WEB.XML
?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
 filter
  filter-nameaccessControl/filter-name
  filter-classcom.teho.servlets.AccessControlFilter/filter-class
  init-param
   param-nameloginPage/param-name
   param-value/login.jsp/param-value
  /init-param
 /filter
 filter-mapping
  filter-nameaccessControl/filter-name
  url-pattern/internal/*/url-pattern
 /filter-mapping
 servlet
  servlet-nameaction/servlet-name
  servlet-classorg.apache.struts.action.ActionServlet/servlet-class
  init-param
   param-nameapplication/param-name
   param-valuecom.teho.servlets.ApplicationResources/param-value
  /init-param
 /servlet
 servlet-mapping
  servlet-nameaction/servlet-name
  url-pattern*.do/url-pattern
 /servlet-mapping
/web-app

STRUTS-CONFIG.XML:
?xml version=1.0 encoding=UTF-8?
!DOCTYPE struts-config PUBLIC -//Apache Software Foundation//DTD Struts
Configuration 1.1//EN
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;
struts-config
 form-beans
  form-bean name=loginForm type=com.teho.servlets.LoginForm /
 /form-beans
 action-mappings
  action name=loginForm type=com.teho.servlets.AuthenticateAction
path=/struts/authenticate /
 /action-mappings
/struts-config

login.jsp
...
form name=login method=post action=c:url
value=/struts/authenticate.do /
...
 


How can I set the defualt selection?

2003-07-06 Thread leon
I am a beginner of struts. I can't use the 'selected' property of the select
tag in struts to set the default selection like I used it in a normal html.
It's happened in 'checked' property of struts radio tag. Could you tell me
how to set a defualt selection.




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



Action forward to another action without form

2003-07-06 Thread Benjamin Stewart
Greetings,
I have a form that submits values. From the Action class I would (in 
some circumstances) like to go directly to another action class and then 
forward to a view. Is this possible ?

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


Do any one send me the simplest validate strut for me?

2003-07-06 Thread MaFai
Hello, struts-user,

I have read the strut example again and again.Attempt to use the simple 
validate in my validateform.But it failed,I still 
can not find the reason,so do any one send me the example which is only need 
to validate the field required.
Thanks!

Best regards. 

MaFai
[EMAIL PROTECTED]
2003-07-07

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

Re: Action forward to another action without form

2003-07-06 Thread Dan Tran
Yes;)


- Original Message - 
From: Benjamin Stewart [EMAIL PROTECTED]
Newsgroups: Struts
Sent: Sunday, July 06, 2003 6:59 PM
Subject: Action forward to another action without form


 Greetings,
  I have a form that submits values. From the Action class I would (in 
 some circumstances) like to go directly to another action class and then 
 forward to a view. Is this possible ?
 
 Thanks
 Ben

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



Re: Action forward to another action without form

2003-07-06 Thread Benjamin Stewart
Can you point me in the right direction, none of my books talk about it, 
cant find examples etc.

Ben

Dan Tran wrote:

Yes;)

- Original Message - 
From: Benjamin Stewart [EMAIL PROTECTED]
Newsgroups: Struts
Sent: Sunday, July 06, 2003 6:59 PM
Subject: Action forward to another action without form

 

Greetings,
I have a form that submits values. From the Action class I would (in 
some circumstances) like to go directly to another action class and then 
forward to a view. Is this possible ?

Thanks
Ben
   

-
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: Action forward to another action without form

2003-07-06 Thread Frances Aleah Z. de Guzman
you can define it to your forward in your struts-config, instead of forwarding 
it to a page, forward it to an action. but this is not a good practice 
though.

On Monday 07 July 2003 10:31 am, Benjamin Stewart wrote:
 Can you point me in the right direction, none of my books talk about it,
 cant find examples etc.

 Ben

 Dan Tran wrote:
 Yes;)
 
 
 - Original Message -

 From: Benjamin Stewart [EMAIL PROTECTED]

 Newsgroups: Struts
 Sent: Sunday, July 06, 2003 6:59 PM
 Subject: Action forward to another action without form
 
 Greetings,
  I have a form that submits values. From the Action class I would (in
 some circumstances) like to go directly to another action class and then
 forward to a view. Is this possible ?
 
 Thanks
 Ben
 
 -
 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]

-- 
Frances Aleah Z. De Guzman
SA/Programmer
Ingenium Technology, Inc.
http://www.ingenium.com.ph

Disclaimer :
This message is intended only for the named recipient. If you are not the
intended recipient you are notified that disclosing, copying, distributing
or taking any action in reliance on the contents of this information is
strictly prohibited.



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



Re: How can I set the defualt selection?

2003-07-06 Thread leonZ
I make it more clear here:

A normal html:
select name=select1
  option value=1first/option
  option value=2 SELECTEDsecond/option
  option value=3third/option
/select

how can I use the 'SELECTED' to set a defualt option with struts tags.
html:select property=select1
html:option
...
/html:select

leon [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am a beginner of struts. I can't use the 'selected' property of the
select
 tag in struts to set the default selection like I used it in a normal
html.
 It's happened in 'checked' property of struts radio tag. Could you tell me
 how to set a defualt selection.




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



Re: How can I set the defualt selection?

2003-07-06 Thread Caroline Jen
I have similar questions.  What is the syntax of the
html:option tag?

Just take the example given by you, are the codes
shown below correct?  Will the default selection
shown?

html:select property=select1
 html:option property=1 labelProperty=first
 html:option property=2 labelProperty=second
 html:option property=3 labelProperty=third
/html:select

JPJ

--- leonZ [EMAIL PROTECTED] wrote:
 I make it more clear here:
 
 A normal html:
 select name=select1
   option value=1first/option
   option value=2 SELECTEDsecond/option
   option value=3third/option
 /select
 
 how can I use the 'SELECTED' to set a defualt option
 with struts tags.
 html:select property=select1
 html:option
 ...
 /html:select
 
 leon [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  I am a beginner of struts. I can't use the
 'selected' property of the
 select
  tag in struts to set the default selection like I
 used it in a normal
 html.
  It's happened in 'checked' property of struts
 radio tag. Could you tell me
  how to set a defualt selection.
 
 
 
 

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


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: extending Action problems

2003-07-06 Thread Andrew Hill
1.) Probably not ;-)
2.) Yes.

Ive never tried my hacky way - I only thought it up while I was thinking
about your problem, so there is a good chance that it wont work as expected.
(And worse = if it fails its likely to fail in a subtle way that is hard to
reproduce consistently as it will probably be some kind of threading
issue...)

Id strongly discourage you from using this technique, but if you do let me
know how it goes.


-Original Message-
From: Billy Ng [mailto:[EMAIL PROTECTED]
Sent: Saturday, 5 July 2003 02:58
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: extending Action problems


Hey, I like your last hacky way.  but I am just so worried if:

1) I can trust the thread.hashCode() as key?
2) If I guess it right, I think I need to remove the ac from the Map when
the thread exits perform().  Memory leak may cause if it fails to remove.

But I still love it.  Do you have any running application that is using this
method?

Thanks Andrew!

Billy Ng

- Original Message -
From: Andrew Hill [EMAIL PROTECTED]
To: Struts [EMAIL PROTECTED]
Sent: Friday, July 04, 2003 3:49 AM
Subject: RE: extending Action problems


 Almost - but the getRequest(ac) is redundant - you would just call
 ac.getRequest() when you needed the request as youve passed in ac as a
 method parameter.

 You will note though that you still have to pass the ac parameter to any
 method that needs access to the stuff it wraps.

 ie:
 public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest req,
  HttpServletResponse resp) {

  ActionContext ac = new ActionContext(mapping, form, req, resp);
  process(ac);
 etc..
 }

 private void process(ActionContext ac)
 {
   String bob = ac.getRequest().getParameter(bob);
   etc
 }

 What you really really want to be able to do is:
 private void process()
 {
   String bob = getRequest().getParameter(bob);
 }
 isnt it? ;-)

 but as you saw already that simply wont work with a singleton Action -
only
 way you can deal with this is either passing one or more parameters to
 methods in Action that need them OR modifying the RequestProcessor to
return
 new instances of your Action for each request - that wouldnt need much
code
 to achieve, but if your cautious Id suggest you stick with a parameter
 passing methodology.

 Well, I suppose there is one way I can think of to do it without having to
 pass around the ac as a param - but its an evil hack and Im including it
 more for your amusement than for your education!

 evil disclaimer=dont try this at home kids tested=no
 Put your ActionContext instance into the servlet context in perform()
keyed
 by the threads hashcode. Provide a method getActionContext() in your base
 action to retrieve it. Now you can get it from any method in your action
 just by calling getActionContext() without having to pass it around in a
 param.
 /evil

 -Original Message-
 From: Billy Ng [mailto:[EMAIL PROTECTED]
 Sent: Friday, 4 July 2003 18:19
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: Re: extending Action problems


 Sorry, Andrew!  I am a little bit slow.  Please review it if I understand
 what you told me with the following code.

 public abstract class ActionBase extends Action {

 protected abstract void process()  throws Exception;

 public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest req,
  HttpServletResponse resp) {

  ActionContext ac = new ActionContext(mapping, form, req, resp);
  process(ac);
 }

 public HttpServletRequest getRequest(ActionContext ac)  {
return ac.getRequest();
 }

 
 }




 - Original Message -
 From: Andrew Hill [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, July 04, 2003 2:42 AM
 Subject: RE: extending Action problems


  Yes, this is a quite annoying feature of the singleton nature of Actions
  (and given the efficiency of modern JVMs at instantiating and garbage
  collecting there is jolly good argument for changing the
RequestProcessor
 to
  instantiate new instances of Action for each request (and do feel free
to
  try this at home kids!) - though Im getting off topic here).
 
  One way of dealing with this is to create a bean (or bean like object)
 that
  has the getters and setters you need, and to pass this to any method in
 your
  action that needs it. You instantiate the object at the start of
perform()
  (or execute() method in struts1.1) and then pass the reference to
methods.
 
  In my app I have an object for this task which I named ActionContext -
 this
  basically just wrapped a Hashmap into which I could insert/retrieve
stuff
  with ActionContext.setAttribute, getAttribute, and I also has 

Re: javascipt error in IE

2003-07-06 Thread David Graham
--- Adam Hardy [EMAIL PROTECTED] wrote:
 Well, I just upgraded to IE6 (SP1) and I don't get any errors for credit
 
 card nor required, nor in fact any errors at all. I just checked to make
 
 sure javascript errors were notified.
 
 I seem to have wiped out IE5.5, which I wanted to keep for testing. I 
 installed IE6 in a different directory, but if I launch IE5 with the 
 iexplore.exe from the original directory, I still get IE6. Is there some
 
 trick to doing this?

AFAIK, it's fairly impossible to have multiple IE versions on the same
box.  MS apparently doesn't care about web developers testing on multiple
versions of their browser.

David

 
 Huang, Andy wrote:
  No, this error happen for all form validations I used, including
 required,
  credit card, and zip code validator.
  
  Althought the problem is not fatal, since if I turn off
  Display a notification about every script error in advanced tab of
  IE internet options, the pop-up error message will just be silent, 
  and proper error message still display for user input (which I thought
  shouldn't went thru, because of the javascript error)
  
  But this not acceptable for production use.
  
  Any ideas?
  
  
  -Original Message-
  From: Adam Hardy
  To: Struts Users Mailing List
  Sent: 7/4/2003 5:43 AM
  Subject: Re: javascipt error in IE
  
  You mean the error comes from the email-validation?
  
  Richard Mixon wrote:
  
 Andy, I too would like to know how to fix this when using the
  
  validator
  
 Javascripts. In most cases it appears to be benign, but irritating.
  
  I've got
  
 on or two forms that it really does break though.
 
 Hope someone has an clue.
 
 - Richard
 
 -Original Message-
 From: Huang, Andy [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 03, 2003 2:19 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: javascipt error in IE
 
 
 No one experience this problem???
 
 -Original Message-
 From: Huang, Andy
 Sent: Thursday, July 03, 2003 1:46 PM
 To: '[EMAIL PROTECTED]'
 Subject: javascipt error in IE
 
 
 I got an Error: Object Expected in IE 6, but run without any problem
  
  in
  
 Netscape or Opera.
 
 I have a login form with onsubmit=return validateLoginForm(this);
 to validate the login email address and password (I have included the
  
  html
  
 souce code snippet below)
 
 My guess is that the IE browser having problem to read
  
  staticJavascript.jsp
  
 when it load the page.
 
 Any help will be appreciated
 
 
 form name=loginForm method=post action=/Login.do
  
  onsubmit=return
  
 validateLoginForm(this);
 table border=0 width=100%
   tr
 th align=right
   Email Address:
 /th
 td align=left
   input type=text name=email maxlength=27 size=25
  
  value=
  
 /td
   /tr
 
   tr
 th align=right
   Password:
 /th
 td align=left
   input type=password name=password maxlength=18 size=16
 value=
 /td
   /tr
 
   tr
 td align=right
   input type=submit value=Submit
 /td
 td align=left
   input type=reset value=Reset
 /td
   /tr
 /table
 /form
 
 script type=text/javascript language=JavaScript
   !--
   var focusControl = document.forms[loginForm].elements[email];
 
   if (focusControl.type != hidden) {
  focusControl.focus();
   }
   // --
 /script
 
 
 
 script type=text/javascript language=Javascript1.1
 !-- Begin
 
  var bCancel = false;
 
 function validateLoginForm(form) {
 
 if (bCancel)
   return true;
 else
return validateEmail(form)  validateMaxLength(form) 
 validateMinLength(form);
}
 
 function email () {
  this.aa = new Array(email, liEmail Address is an invalid
  
  e-mail
  
 address./li, new Function (varName,  return this[varName];));
 }
 
 function maxlength () {
  this.aa = new Array(password, liPassword cannot be greater
  
  than 16
  
 characters./li, new Function (varName, this.maxlength='16';
 this.minlength='3';  return this[varName];));
 }
 
 function minlength () {
  this.aa = new Array(password, liPassword cannot be less than
  
  3
  
 characters./li, new Function (varName, this.maxlength='16';
 this.minlength='3';  return this[varName];));
 }
 
 //End --
 /script
 
 script language=Javascript1.1 src=staticJavascript.jsp/script
 
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  
  
  
 
=== message truncated ===


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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



RE: javascipt error in IE

2003-07-06 Thread Andrew Hill
Yes. Its a big nuisance.

Ive had to stick with IE5 and hope if it works in 5 it works in 6. Not
always the case , but more so than the other way round!

Glad to say Ive had no trouble running NS6 and Mozilla together on the same
machine - at the same time too.


-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED]
Sent: Monday, 7 July 2003 12:05
To: Struts Users Mailing List
Subject: Re: javascipt error in IE


--- Adam Hardy [EMAIL PROTECTED] wrote:
 Well, I just upgraded to IE6 (SP1) and I don't get any errors for credit

 card nor required, nor in fact any errors at all. I just checked to make

 sure javascript errors were notified.

 I seem to have wiped out IE5.5, which I wanted to keep for testing. I
 installed IE6 in a different directory, but if I launch IE5 with the
 iexplore.exe from the original directory, I still get IE6. Is there some

 trick to doing this?

AFAIK, it's fairly impossible to have multiple IE versions on the same
box.  MS apparently doesn't care about web developers testing on multiple
versions of their browser.

David


 Huang, Andy wrote:
  No, this error happen for all form validations I used, including
 required,
  credit card, and zip code validator.
 
  Althought the problem is not fatal, since if I turn off
  Display a notification about every script error in advanced tab of
  IE internet options, the pop-up error message will just be silent,
  and proper error message still display for user input (which I thought
  shouldn't went thru, because of the javascript error)
 
  But this not acceptable for production use.
 
  Any ideas?
 
 
  -Original Message-
  From: Adam Hardy
  To: Struts Users Mailing List
  Sent: 7/4/2003 5:43 AM
  Subject: Re: javascipt error in IE
 
  You mean the error comes from the email-validation?
 
  Richard Mixon wrote:
 
 Andy, I too would like to know how to fix this when using the
 
  validator
 
 Javascripts. In most cases it appears to be benign, but irritating.
 
  I've got
 
 on or two forms that it really does break though.
 
 Hope someone has an clue.
 
 - Richard
 
 -Original Message-
 From: Huang, Andy [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 03, 2003 2:19 PM
 To: '[EMAIL PROTECTED]'
 Subject: RE: javascipt error in IE
 
 
 No one experience this problem???
 
 -Original Message-
 From: Huang, Andy
 Sent: Thursday, July 03, 2003 1:46 PM
 To: '[EMAIL PROTECTED]'
 Subject: javascipt error in IE
 
 
 I got an Error: Object Expected in IE 6, but run without any problem
 
  in
 
 Netscape or Opera.
 
 I have a login form with onsubmit=return validateLoginForm(this);
 to validate the login email address and password (I have included the
 
  html
 
 souce code snippet below)
 
 My guess is that the IE browser having problem to read
 
  staticJavascript.jsp
 
 when it load the page.
 
 Any help will be appreciated
 
 
 form name=loginForm method=post action=/Login.do
 
  onsubmit=return
 
 validateLoginForm(this);
 table border=0 width=100%
   tr
 th align=right
   Email Address:
 /th
 td align=left
   input type=text name=email maxlength=27 size=25
 
  value=
 
 /td
   /tr
 
   tr
 th align=right
   Password:
 /th
 td align=left
   input type=password name=password maxlength=18 size=16
 value=
 /td
   /tr
 
   tr
 td align=right
   input type=submit value=Submit
 /td
 td align=left
   input type=reset value=Reset
 /td
   /tr
 /table
 /form
 
 script type=text/javascript language=JavaScript
   !--
   var focusControl = document.forms[loginForm].elements[email];
 
   if (focusControl.type != hidden) {
  focusControl.focus();
   }
   // --
 /script
 
 
 
 script type=text/javascript language=Javascript1.1
 !-- Begin
 
  var bCancel = false;
 
 function validateLoginForm(form) {
 
 if (bCancel)
   return true;
 else
return validateEmail(form)  validateMaxLength(form) 
 validateMinLength(form);
}
 
 function email () {
  this.aa = new Array(email, liEmail Address is an invalid
 
  e-mail
 
 address./li, new Function (varName,  return this[varName];));
 }
 
 function maxlength () {
  this.aa = new Array(password, liPassword cannot be greater
 
  than 16
 
 characters./li, new Function (varName, this.maxlength='16';
 this.minlength='3';  return this[varName];));
 }
 
 function minlength () {
  this.aa = new Array(password, liPassword cannot be less than
 
  3
 
 characters./li, new Function (varName, this.maxlength='16';
 this.minlength='3';  return this[varName];));
 }
 
 //End --
 /script
 
 script language=Javascript1.1 src=staticJavascript.jsp/script
 
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 
 

=== message truncated ===


__
Do you Yahoo!?
SBC Yahoo! DSL - Now only 

Validate() in netscape

2003-07-06 Thread sriram
I'm using Struts 1.0 and I have written some validations in the validate() method in 
ActionForm . For example, some of the fields on the form are mandatory and so if the 
form is submitted with giving input in those fields, appropriate messages are 
displayed. This is working fine in Internet Explorer, but it's not showing any 
messages in Netscape Navigator.

Can somebody please suggest a solution?

Thanks
Sriram


RE: Why html:xxx tags? / Dreamweaver and .do extension

2003-07-06 Thread Andrew Hill
Another plus to the struts tags is the nesting ability, which imho rocks!
(Though Im not actually using JSP so had to render the nesting details the
hard way...)

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Sunday, 6 July 2003 05:02
To: Struts Users Mailing List
Subject: Re: Why html:xxx tags? / Dreamweaver and .do extension


tek1 wrote:
 Sorry for the newbie questions, but...

 [ Why html:xxx tags? ]

 On the .jsp page, why is it necessary to replace the standard html tags
 with the Struts-specific ones (i.e. html:form instead of just form).
 In other words, what special features of Struts requires these specially
 defined tags?

In a dynamic web application there has to be some mechanism for
transfering information from the server-side action into the server
page. One approach is to do this inside the HTML markup with JSP
scriptlets, but that is clumsy and error-prone. Another approach is to
have a custom JSP tag print out both the HTML tag and the dynamic
content, which is what the Struts tags do.

The Struts HTML tags are aware of where the framework stores
information, and so, in practice, become quite easy to use.

The core framework is unaware of the tags and works just as well with
other approaches. There are both XLS and Velocity Template extension for
Struts that work just fine with out the tags. The Velocity Templates
(.vm) work particularly well in visual HTML editors out of the box.


 [ Dreamweaver and .do extension ]

 If there are any Dreamweaver users out there, how do you specify that
 Dreamweaver also open files that end with .do (and .vm)?  I tried adding
 the extensions under Edit - Preferences - File Types / Editors
 Category - Open in Code View, but it didn't work.  I would actually
 prefer to open them in Dreamweaver's visual/GUI editor, but looks like
 that is not an option.

Struts doesn't actually use .do files. These are virtual files that
bundled together a server-side action with one or more output files
(such as JSPs or Velocity Templates).

So the servlet sees the *.do extension and passes the request to the
Struts ActionServlet. The Servlet then passes it along to the
server-side Struts Action class, which does whatever it needs to do,
places any dynamic data that might be needed in the request, and helps
select the server page (of whatever kind) to render that data.

The server page retrieves the dynamic data from the request, using
either Struts tags (origInal, JSTL, or extra crispy), or Velocity Tools,
or from a DOM created by an extension like stxx, or any other
presentation device that can access the Java request object.

-Ted.



-
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]



Missing message Exception

2003-07-06 Thread Saroj Kumar Choudhury
Hi,
 I am new to Struts World. I wanted to do one Login Application, using
DynaValidatorForm. while accessing http://localhost:7001/dynaForm I am
getting the following error message:

  Jul 7, 2003 9:41:08 AM IST Error HTTP
[WebAppServletContext(3512032,dynaF
orm,/dynaForm)] Root cause of ServletException
javax.servlet.jsp.JspException: Missing message for key label.login
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:2
97)
at jsp_servlet.__login._jspService(__login.java:159)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:304)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2546)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2260)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


 It become difficult for me to find out where to keep the
ApplicationResources.properties file .. I have kept that under
WEB-INF/classes/dynaform directory. I am enclosing here my
ApplicationResources.properties, web.xml and struts-config.xml, jsp  file
for your references..


ApplicationResources.properties
# Errors

errors.required={0} is required.
# Label

label.login= User Name
label.password= Password

 web.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-valuedynaform.ApplicationResources/param-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value2/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value2/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping
  welcome-file-list
welcome-filelogin.jsp/welcome-file
  /welcome-file-list
  error-page
error-code404/error-code
location/login.jsp/location
  /error-page
  taglib
taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
taglib-location/WEB-INF/struts-bean.tld/taglib-location
  /taglib
  taglib
taglib-uri/WEB-INF/struts-html.tld/taglib-uri
taglib-location/WEB-INF/struts-html.tld/taglib-location
  /taglib
  taglib
taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
taglib-location/WEB-INF/struts-logic.tld/taglib-location
  /taglib
/web-app


struts-config.xml

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; 
 struts-config
 form-beans
 form-bean
   name=loginForm
   type=org.apache.struts.validator.DynaValidatorForm
  form-property name=userName type=java.lang.String /
  form-property name=passWord type=java.lang.String /
 /form-bean
 /form-beans
 action-mappings
  action
   path=/login
   type=dynaform.LoginAction
   scope=request
   name=loginForm
   validate=true
   input=/login.jsp
forward name=success path=/index.jsp /
  forward name=failure path=/login.jsp /
  /action
 /action-mappings
 message-resources parameter=dynaform.ApplicationResources /
 plug-in
   className=org.apache.struts.validator.ValidatorPlugIn
   set-property
  property=pathnames
  value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml /
 /plug-in
 /struts-config


login.jsp

%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
html:html
 body
 html:errors /
   html:form action=login
 bean:message key=label.login /:html:text property=userName
/br
 bean:message key=label.password /html:text property=passWord
/br
 html:submit value=login /
   /html:form
 /body
/html:html

 I am using Weblogic6.1 Application Server

 Any suggestion will be appreciated
Regards,
Saroj


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



Re: Why html:xxx tags? / Dreamweaver and .do extension

2003-07-06 Thread Denis Baranov
Oh-oh. Another limitation? WYSIWYG HTML anymore? Anybody?

(nesting rocks indeed)

Denis.

Andrew Hill wrote:

Another plus to the struts tags is the nesting ability, which imho rocks!
(Though Im not actually using JSP so had to render the nesting details the
hard way...)
-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED]
Sent: Sunday, 6 July 2003 05:02
To: Struts Users Mailing List
Subject: Re: Why html:xxx tags? / Dreamweaver and .do extension
tek1 wrote:
 

Sorry for the newbie questions, but...

[ Why html:xxx tags? ]

On the .jsp page, why is it necessary to replace the standard html tags
with the Struts-specific ones (i.e. html:form instead of just form).
In other words, what special features of Struts requires these specially
defined tags?
   

In a dynamic web application there has to be some mechanism for
transfering information from the server-side action into the server
page. One approach is to do this inside the HTML markup with JSP
scriptlets, but that is clumsy and error-prone. Another approach is to
have a custom JSP tag print out both the HTML tag and the dynamic
content, which is what the Struts tags do.
The Struts HTML tags are aware of where the framework stores
information, and so, in practice, become quite easy to use.
The core framework is unaware of the tags and works just as well with
other approaches. There are both XLS and Velocity Template extension for
Struts that work just fine with out the tags. The Velocity Templates
(.vm) work particularly well in visual HTML editors out of the box.
 

[ Dreamweaver and .do extension ]

If there are any Dreamweaver users out there, how do you specify that
Dreamweaver also open files that end with .do (and .vm)?  I tried adding
the extensions under Edit - Preferences - File Types / Editors
Category - Open in Code View, but it didn't work.  I would actually
prefer to open them in Dreamweaver's visual/GUI editor, but looks like
that is not an option.
   

Struts doesn't actually use .do files. These are virtual files that
bundled together a server-side action with one or more output files
(such as JSPs or Velocity Templates).
So the servlet sees the *.do extension and passes the request to the
Struts ActionServlet. The Servlet then passes it along to the
server-side Struts Action class, which does whatever it needs to do,
places any dynamic data that might be needed in the request, and helps
select the server page (of whatever kind) to render that data.
The server page retrieves the dynamic data from the request, using
either Struts tags (origInal, JSTL, or extra crispy), or Velocity Tools,
or from a DOM created by an extension like stxx, or any other
presentation device that can access the Java request object.
-Ted.



-
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: Webapp Security?

2003-07-06 Thread Rick Reumann
On Thu, 2003-07-03 at 16:42, Craig R. McClanahan wrote:
  
 
 Why are you trying to mess with the container's implementation of
 authentication at all?  Why not just write a Filter that does an
 RD.forward() to some safe place if it sees that the session does not
 contain the right stuff (because it was timed out and recreated)?
 Remember, a filter is *not* required to call chain.doFilter() to pass the
 request on -- it can forward wherever it wants and then return, and this
 is portable to any Servlet 2.3 container.
 
 Filters are your friend :-).


Well, here's the deal... Basically there are are too many things that
rely on certain objects being in Session scope for this application so I
don't want to have to test every type of action url. So what I did was
write a Servlet Filter that also is called from the urr pattern /*

the relevant filter method looks like :

if (  httpRequest.getUserPrincipal() != null 
session.getAttribute(userBean) == null ) {
RequestDispatcher rd = request.getRequestDispatcher(mainPage);
rd.forward(request, response );
}
else {
 chain.doFilter(request, response);
}


The above seems to work fine- forcing the forward to the mainPage (which
in my case is an index page that then forwards to an Action that sets up
appropriate Session information). 

Throughout the course of the application there are other session objects
(mainly some Lists for reporting that are put in Session scope) so
rather than test for everything and have to figure out what page/action
to bring the user to in oder to make things are set up correctly, I just
want them all back some initial page.

The part I don't like is every request now has to hit both the security
filter and this other filter. Would it maybe be better to maybe just do
this type of check in my base action execute method? (check for the
userBean being null there and if null forward to the appropriate
setUpAction?

Thanks,

-- 
Rick


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



RE: extending Action problems

2003-07-06 Thread Andrew Hill
Ahhh... this might interest you.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5395
Its an enhancement request for struts (to have an ActionContext object) that
Ted apparently logged a while ago and has re-opened to look at now that 1.1
is out the door.

Im wondering though if its worth logging an enhancement request to have the
RP instantiate new action objects everytime. Last time the idea came up it
was shot down, but with 1.1 out now maybe it might be considered?

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Monday, 7 July 2003 11:35
To: Struts Users Mailing List
Subject: RE: extending Action problems


1.) Probably not ;-)
2.) Yes.

Ive never tried my hacky way - I only thought it up while I was thinking
about your problem, so there is a good chance that it wont work as expected.
(And worse = if it fails its likely to fail in a subtle way that is hard to
reproduce consistently as it will probably be some kind of threading
issue...)

Id strongly discourage you from using this technique, but if you do let me
know how it goes.


-Original Message-
From: Billy Ng [mailto:[EMAIL PROTECTED]
Sent: Saturday, 5 July 2003 02:58
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Re: extending Action problems


Hey, I like your last hacky way.  but I am just so worried if:

1) I can trust the thread.hashCode() as key?
2) If I guess it right, I think I need to remove the ac from the Map when
the thread exits perform().  Memory leak may cause if it fails to remove.

But I still love it.  Do you have any running application that is using this
method?

Thanks Andrew!

Billy Ng

- Original Message -
From: Andrew Hill [EMAIL PROTECTED]
To: Struts [EMAIL PROTECTED]
Sent: Friday, July 04, 2003 3:49 AM
Subject: RE: extending Action problems


 Almost - but the getRequest(ac) is redundant - you would just call
 ac.getRequest() when you needed the request as youve passed in ac as a
 method parameter.

 You will note though that you still have to pass the ac parameter to any
 method that needs access to the stuff it wraps.

 ie:
 public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest req,
  HttpServletResponse resp) {

  ActionContext ac = new ActionContext(mapping, form, req, resp);
  process(ac);
 etc..
 }

 private void process(ActionContext ac)
 {
   String bob = ac.getRequest().getParameter(bob);
   etc
 }

 What you really really want to be able to do is:
 private void process()
 {
   String bob = getRequest().getParameter(bob);
 }
 isnt it? ;-)

 but as you saw already that simply wont work with a singleton Action -
only
 way you can deal with this is either passing one or more parameters to
 methods in Action that need them OR modifying the RequestProcessor to
return
 new instances of your Action for each request - that wouldnt need much
code
 to achieve, but if your cautious Id suggest you stick with a parameter
 passing methodology.

 Well, I suppose there is one way I can think of to do it without having to
 pass around the ac as a param - but its an evil hack and Im including it
 more for your amusement than for your education!

 evil disclaimer=dont try this at home kids tested=no
 Put your ActionContext instance into the servlet context in perform()
keyed
 by the threads hashcode. Provide a method getActionContext() in your base
 action to retrieve it. Now you can get it from any method in your action
 just by calling getActionContext() without having to pass it around in a
 param.
 /evil

 -Original Message-
 From: Billy Ng [mailto:[EMAIL PROTECTED]
 Sent: Friday, 4 July 2003 18:19
 To: Struts Users Mailing List; [EMAIL PROTECTED]
 Subject: Re: extending Action problems


 Sorry, Andrew!  I am a little bit slow.  Please review it if I understand
 what you told me with the following code.

 public abstract class ActionBase extends Action {

 protected abstract void process()  throws Exception;

 public ActionForward perform(ActionMapping mapping,
  ActionForm form,
  HttpServletRequest req,
  HttpServletResponse resp) {

  ActionContext ac = new ActionContext(mapping, form, req, resp);
  process(ac);
 }

 public HttpServletRequest getRequest(ActionContext ac)  {
return ac.getRequest();
 }

 
 }




 - Original Message -
 From: Andrew Hill [EMAIL PROTECTED]
 To: Struts Users Mailing List [EMAIL PROTECTED]
 Sent: Friday, July 04, 2003 2:42 AM
 Subject: RE: extending Action problems


  Yes, this is a quite annoying feature of the singleton nature of Actions
  (and given the efficiency of modern JVMs at instantiating and garbage
  collecting there is jolly good argument for changing the
RequestProcessor
 to
  instantiate new 

db connection pooling

2003-07-06 Thread jailani . s
Hi,

Is there any ways to achieve db connection pooling and access of such
pooled connection though jndi in struts action classes.

Regards,
Jailani.S




This e-Mail may contain proprietary and confidential information and is sent for the 
intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you 
are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, 
copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment 
other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

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

RE: [OT] - Realm Security - How to set overlapping constraints?

2003-07-06 Thread Navjot Singh
Thanks Craig,

Reversing the order of constraints does work. I should have RTFM.

But now, there is another problem.
When user is authenticated once, and then i accessed a resource that needs
login to admin. It simply throws 403.
Can't it throw LOGIN PAGE? I can replace the default 403 page with my LOGIN
page but i guess that wouldn't be the right solution.

If i move my role constraints to struts-config, think i can handle that in
my actions then. Am i right?

regards
Navjot Singh


|-Original Message-
|From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
|Sent: Saturday, July 05, 2003 11:37 PM
|To: Struts Users Mailing List
|Subject: Re: [OT] - Realm Security - How to set overlapping constraints?
|
|On Sat, 5 Jul 2003, Navjot Singh wrote:
|
| Date: Sat, 5 Jul 2003 21:39:34 +0530
| From: Navjot Singh [EMAIL PROTECTED]
| Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
| To: Struts Users Mailing List [EMAIL PROTECTED]
| Subject: [OT] - Realm Security - How to set overlapping constraints?
|
| hi,
|
| It may be quite simple but it's not working for me.
|
| I have a set of servlets
| /myapp/p/ab.do
| /myapp/p/groups.do
| /myapp/p/contacts.do
|
| AND I want all of them to be accessible to roles user and admin.
|
| There is 1 more servlet that MUST be accessible ONLY to admin
| /myapp/p/status.do
|
| I am setting config like given below.
| But still, user roles are being able to access status.do
|
| What am i doing wrong?
|
| thanks for any help
| -navjot singh
|
| __My XML Declarations__
|
| security-constraint
|  web-resource-collection
|web-resource-nameProtected/web-resource-name
|url-pattern*.do/url-pattern
|http-methodGET/http-method
|http-methodPOST/http-method
|  /web-resource-collection
|  auth-constraint
|role-nameuser/role-name
|role-nameadmin/role-name
|  /auth-constraint
| /security-constraint
|
|The list of security roles inside an auth-constraint is an *or* list, so
|the container is doing exactly what you told it to do -- allow anyone with
|either user or admin to access all *.do URLs.
|
|
| security-constraint
|  web-resource-collection
|web-resource-nameShow Status/web-resource-name
|url-pattern/p/status.do/url-pattern
|http-methodGET/http-method
|http-methodPOST/http-method
|  /web-resource-collection
|  auth-constraint
|role-nameadmin/role-name
|  /auth-constraint
| /security-constraint
|
|
|The fact that this one is second means that it will never get used,
|because /p/status.do satisfies the matching pattern on the first test.
|Try reversing your constraints.
|
|Another alternative is to do some of the role-based protection on Struts
|actions in struts-config.xml instead, by using the role attribute on the
|action element.  That way, you can have just your first constraint above
|(the one matching *.do) to force people to log on, and then do fine
|grained control at the Struts level.
|
|   security-role
|role-nameadmin/role-name
|   /security-role
|
|   security-role
|role-nameuser/role-name
|   /security-role
|
|
|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: db connection pooling

2003-07-06 Thread Navjot Singh
why not? 
Simply configure one jndi data source in struts-config and you are on.

HTH
-navjot

|-Original Message-
|From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
|Sent: Monday, July 07, 2003 10:09 AM
|To: [EMAIL PROTECTED]
|Subject: db connection pooling
|
|
|Hi,
|
|Is there any ways to achieve db connection pooling and access of such
|pooled connection though jndi in struts action classes.
|
|Regards,
|Jailani.S
|
|
|
|
|

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



RE: db connection pooling

2003-07-06 Thread J, Sadhasivam (Cognizant)
That depends upon the Server Infrastruture. U can implement connection pooling and 
Datasournce throught the strutsconfig
datasournce  seqment.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2003 10:09 AM
To: [EMAIL PROTECTED]
Subject: db connection pooling


Hi,

Is there any ways to achieve db connection pooling and access of such
pooled connection though jndi in struts action classes.

Regards,
Jailani.S





This e-mail and any files transmitted with it are for the sole use of the intended 
recipient(s) and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and 
destroy all copies of the original message. 
Any unauthorised review, use, disclosure, dissemination, forwarding, printing or 
copying of this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

Visit us at http://www.cognizant.com


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

RE: Missing message Exception

2003-07-06 Thread Sinclair, Mark
In web.xml try

param-value/dynaform/ApplicationResources/param-value



-Original Message-
From: Saroj Kumar Choudhury [mailto:[EMAIL PROTECTED]
Sent: Monday, July 07, 2003 7:28 AM
To: Struts Users Mailing List
Subject: Missing message Exception


Hi,
 I am new to Struts World. I wanted to do one Login Application, using
DynaValidatorForm. while accessing http://localhost:7001/dynaForm I am
getting the following error message:

  Jul 7, 2003 9:41:08 AM IST Error HTTP
[WebAppServletContext(3512032,dynaF
orm,/dynaForm)] Root cause of ServletException
javax.servlet.jsp.JspException: Missing message for key label.login
at
org.apache.struts.taglib.bean.MessageTag.doStartTag(MessageTag.java:2
97)
at jsp_servlet.__login._jspService(__login.java:159)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:304)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2546)
at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2260)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


 It become difficult for me to find out where to keep the
ApplicationResources.properties file .. I have kept that under
WEB-INF/classes/dynaform directory. I am enclosing here my
ApplicationResources.properties, web.xml and struts-config.xml, jsp  file
for your references..


ApplicationResources.properties
# Errors

errors.required={0} is required.
# Label

label.login= User Name
label.password= Password

 web.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
  servlet
servlet-nameaction/servlet-name
servlet-classorg.apache.struts.action.ActionServlet/servlet-class
init-param
  param-nameapplication/param-name
  param-valuedynaform.ApplicationResources/param-value
/init-param
init-param
  param-nameconfig/param-name
  param-value/WEB-INF/struts-config.xml/param-value
/init-param
init-param
  param-namedebug/param-name
  param-value2/param-value
/init-param
init-param
  param-namedetail/param-name
  param-value2/param-value
/init-param
load-on-startup1/load-on-startup
  /servlet
  servlet-mapping
servlet-nameaction/servlet-name
url-pattern*.do/url-pattern
  /servlet-mapping
  welcome-file-list
welcome-filelogin.jsp/welcome-file
  /welcome-file-list
  error-page
error-code404/error-code
location/login.jsp/location
  /error-page
  taglib
taglib-uri/WEB-INF/struts-bean.tld/taglib-uri
taglib-location/WEB-INF/struts-bean.tld/taglib-location
  /taglib
  taglib
taglib-uri/WEB-INF/struts-html.tld/taglib-uri
taglib-location/WEB-INF/struts-html.tld/taglib-location
  /taglib
  taglib
taglib-uri/WEB-INF/struts-logic.tld/taglib-uri
taglib-location/WEB-INF/struts-logic.tld/taglib-location
  /taglib
/web-app


struts-config.xml

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd; 
 struts-config
 form-beans
 form-bean
   name=loginForm
   type=org.apache.struts.validator.DynaValidatorForm
  form-property name=userName type=java.lang.String /
  form-property name=passWord type=java.lang.String /
 /form-bean
 /form-beans
 action-mappings
  action
   path=/login
   type=dynaform.LoginAction
   scope=request
   name=loginForm
   validate=true
   input=/login.jsp
forward name=success path=/index.jsp /
  forward name=failure path=/login.jsp /
  /action
 /action-mappings
 message-resources parameter=dynaform.ApplicationResources /
 plug-in
   className=org.apache.struts.validator.ValidatorPlugIn
   set-property
  property=pathnames
  value=/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml /
 /plug-in
 /struts-config


login.jsp

%@ taglib uri=/WEB-INF/struts-bean.tld prefix=bean %
%@ taglib uri=/WEB-INF/struts-html.tld prefix=html %
%@ taglib uri=/WEB-INF/struts-logic.tld prefix=logic %
html:html
 body
 html:errors /
   html:form action=login
 bean:message key=label.login /:html:text property=userName
/br
 bean:message key=label.password /html:text property=passWord
/br
 html:submit value=login /
   /html:form
 /body
/html:html

 I am using Weblogic6.1 Application Server

 Any suggestion will be appreciated
Regards,
Saroj


-
To 

html:img and nested:img problems

2003-07-06 Thread Kornelis Sietsma
I am trying to write some images to a web page, where the image source comes from a
servlet.

The only thing I can get to work reasonably is to use a raw html image tag, with
struts tags to write all the parameters - for example:  (note 'cell' is a bean with
various useful properties including a parameter map for the ShowImage servlet.
Eventually I'll use the nested tags for this, though there doesn't seem to be a
nested:rewrite tag...)

image src=html:rewrite page=/ShowImage name=cell property=displayParmMap/
   width=bean:write name=cell property=width/
   height=bean:write name=cell property=height/
   alt=bean:write name=cell property=caption//

Is there any way to do this with the html:img tag?  I can't seem to find any way to
do it.  It seems that the 'width', 'height', and 'alt' parameters are all unprocessed
by the tag, so there is no way to programmatically set them.

I also looked at the nested:img tag, but discovered a problem - it seems that
nested:img *requires* the 'name' property to be used, in which case it doesn't seem
to have any benefit over the base html:img tag.  (And it also doesn't seem to
interpret the 'width', 'height' or 'alt' parameters).

I guess my question is - is there any value at all to the html:img tag?  Especially
the 'width' and 'height' properties?  In what situation would you want to hard-code
an image width and height, and yet get the image URL from elsewhere?

Or is there something I'm missing?  :)

- Korny
--
Kornelis Sietsma   http://www.sietsma.com/korny  [EMAIL PROTECTED]
goofey: korny  yahoo: kornysietsma  icq: 2039172 ph: 0421 079 693

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



Re: db connection pooling

2003-07-06 Thread Micael
Use a plugin.

At 10:09 AM 7/7/03 +0530, you wrote:
Hi,

Is there any ways to achieve db connection pooling and access of such
pooled connection though jndi in struts action classes.
Regards,
Jailani.S




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


LEGAL NOTICE

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



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