Re: [OT] struts/hibernate in Oracle mag

2003-03-23 Thread Jeff Caddel


Why does no one use Jakarta's own OJB for persistence?

Tons of people do!

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


error starting my struts app in tomcat

2003-03-23 Thread Richard Raquepo
i have a web-app that works fine in resin but does not work in tomcat. i always get 
this error:
Mar 24, 2003 3:32:00 PM org.apache.commons.digester.Digester startElement
SEVERE: Begin event threw exception
java.lang.NoSuchMethodException: Bean has no property named loginRequired
at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.jav
a:193)
at org.apache.commons.digester.Rule.begin(Rule.java:200)
at org.apache.commons.digester.Digester.startElement(Digester.java:1268)

at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXP
arser.java:459)
at org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Abst
ractXMLDocumentParser.java:221)
at org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNames
paceBinder.java:874)
at org.apache.xerces.impl.XMLNamespaceBinder.emptyElement(XMLNamespaceBi
nder.java:591)
at org.apache.xerces.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidat
or.java:748)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElemen
t(XMLDocumentFragmentScannerImpl.java:747)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContent
Dispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XM
LDocumentFragmentScannerImpl.java:329)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.jav
a:525)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.jav
a:581)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.j
ava:1175)
at org.apache.commons.digester.Digester.parse(Digester.java:1543)
at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet
.java:944)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:468)
at javax.servlet.GenericServlet.init(GenericServlet.java:256)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.
java:934)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:82
1)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContex
t.java:3420)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
608)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347
)
at org.apache.catalina.core.StandardService.start(StandardService.java:4
97)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:218
9)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)

===
my web.xml looks like this:


http://java.sun.com/j2ee/dtds/web-app_2_3.dtd";>



  
action
org.apache.struts.action.ActionServlet

  debug
  1


  config
  
   /WEB-INF/struts-config.xml
   


  application
  ApplicationResources


  mapping
  com.fltic.crm.UserActionMapping


1
  

  
action
*.do
  

  
login.jsp
  
  
  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  
  


and part of my struts-config.xml is
/data-sources>
 
 
  
  
  
  
  
  
  
  
  
 

 
  
 

 
 
   
   
   
  

  
   
  

 
 
 
  
   
   
  

the error is in loginRequired property which is already defined in my web.xml in the 
file UserActionMapping
here's the java file:
package com.fltic.crm;

import org.apache.struts.action.ActionMapping;

public class UserActionMapping extends ActionMapping {

  protected boolean loginRequired = false;

  public UserActionMapping() {

super();
  }

  public void setLoginRequired(boolean loginRequired) {

this.loginRequired = loginRequired;
  }

  public boolean isLoginRequired() {

return loginRequired;
  }
}

what do i need to let my struts app works because it do wo

Re: Nesting tile definitions

2003-03-23 Thread Kevin Cramer

I don't think I explained it very well.  As I understand it I would do
the following using the method you mentioned below:


  
  
  
  



  
  
  
  


This allows me to change the values of left and right at the
highest/page level.  In my application the value of right and left is
usually a certain value and in a few cases they are overriden.  That
is why I was wondering if there is anyway I could have this work:


  
  



  
  
  



  
  
  


In the above, I only specify the right and left in the page
definitions where it differs from the usual values which are defined
in .standardPage.header.  Is it possible to do this?  I had no luck
messing around with the tiles:put tags and the logic tags.  I thought
I could conditionally do the tiles:put using the logic:present tag to
see if right and left were set.  This is what I tried but it didn't
work:










I tried various settings and changing the scope on the logic:present
but I could not figure out how to detect if the tile definition
included the attribute right or left.

Thanks,
Kevin

On Mon, Mar 24, 2003 at 12:45:21AM -0500, Tai Nguyen wrote:
> Kevin,
> 
> I'm pretty sure that once you have the attribute inheritance set up, it
> won't be possible to override the attribute at a lower level.  However, if I
> get you right, you could simply define a child definition for page2 which
> extends .standardPage.  In short, it shouldn't matter at what level you
> override an attribute.
> 
> Tai
> 
> -Original Message-
> From: Kevin Cramer [mailto:[EMAIL PROTECTED]
> Sent: Sunday, March 23, 2003 9:48 PM
> To: Struts Users Mailing List
> Subject: Re: Nesting tile definitions
> 
> 
> 
> Thank you.  I have this working.  The side effect is that it would
> require me to define all the attributes at the highest level.  What if
> I would like to define the attributes at a lower level and then
> override it when it changes for a certain page?  In my example I would
> like to define "right" at the .standardPage.header or
> .standardPage.header.bar level and override it for page2.
> 
> I tried using  tags around the tiles:put
> you specified below but that didn't help.  It seems that when you use
> the tiles:put it overrides that attribute in the subtiles.  If the
> attribute is not defined at the highest level then you don't get the
> setting at lower levels.
> 
> Thanks,
> Kevin
> 
> On Sat, Mar 22, 2003 at 06:42:10PM -0500, Tai Nguyen wrote:
> > Kevin,
> > 
> > To make an attribute available to a nested tile you need to pass it along
> > when you call the tile.  For example:
> > 
> > 
> > 
> > 
> > 
> > 
> > Where beanName is the name of the attribute you want to pass and name is
> > what you want to pass it as and scope is tile context.  In your case, you
> > would also need to add a similar declaration in your .standardPage.header
> > tile since you need to pass it along twice.  Once you've done all that,
> you
> > would actually specify the tiles attribute values in the parent
> definition.
> > This can be very helpful in keeping all the attributes for a given "view"
> in
> > one definition instead of scattered all over your tiles-def.xml.
> > 
> > Tai
> > 
> > -Original Message-
> > From: Kevin Cramer [mailto:[EMAIL PROTECTED]
> > Sent: Thursday, March 20, 2003 6:19 PM
> > To: Struts Users Mailing List
> > Subject: Re: Nesting tile definitions
> > 
> > 
> > 
> > I got it working.  It was a problem with something else.  I didn't
> > catch it.  It can be hard to find problems with the lack of debug
> > messages that come back from the server.
> > 
> > My next question was how do I use attributes from supertiles?  I want
> > to take a page and split it into tiles, one of which is the header.  I
> > also wanted to further divide the header into subtiles.  In particular
> > there is a part of a subtile in the header tile which can vary
> > depending on which page you are on.  I'm wondering what is the easiest
> > way to deal with it.
> > 
> > I'm doing all of this using the XML Tile definitions.  I put an
> > example below with just the relevant parts.  If I want page1 to use
> > one value for the "right" and page2 to use another value for "right"
> > how do I do that?  "right" is defined 2 levels down from the standard
> > page tile.  It would be nice to override it at the highest level.
> > Perhaps I am doing things wrong.  It seems wrong to define multiple
> > intermediate tiles for the different combinations.
> > 
> > 
> >>   path="/WEB-INF/common/layouts/standardLayout.jsp">
> >  
> >  
> >  
> >  
> >   
> > 
> >>   path="/WEB-INF/common/header.jsp">
> > 
> >   
> > 
> >>   path="/WEB-INF/common/bar.jsp">
> > 
> > 
> >   
> > 
> >>   extends=".standardPage">
> > 
> > 
> >   
> > 
> >>   extends=".standardPage">
> > 
> > 
> >   
> > 
> > 
> > 
> > 
> > Kev

error in my struts config

2003-03-23 Thread Richard Raquepo
My web-app is working fine in resin but when i switched to tomcat i got this error.

2003-03-24 14:13:57 StandardContext[/]: Servlet / threw load() exception
javax.servlet.UnavailableException: Parsing error processing resource path 
/WEB-INF/struts-config-tm.xml,/WEB-INF/struts-config-manager.xml
 at org.apache.struts.action.ActionServlet.initModuleConfig(ActionServlet.java:952)
 at org.apache.struts.action.ActionServlet.init(ActionServlet.java:468)
 at javax.servlet.GenericServlet.init(GenericServlet.java:256)
 at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:934)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
 at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:3608)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
 at org.apache.catalina.core.StandardService.start(StandardService.java:497)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)


my web.xml looks like this
.

  config
  
   
/WEB-INF/struts-config.xml,/WEB-INF/struts-config-tm.xml,/WEB-INF/struts-config-manager.xml
   


it works fine in resin but this seems not allowed in tomcat...

guys, what do you think is the error.

thanks a lot...

RE: Nesting tile definitions

2003-03-23 Thread Tai Nguyen
Kevin,

I'm pretty sure that once you have the attribute inheritance set up, it
won't be possible to override the attribute at a lower level.  However, if I
get you right, you could simply define a child definition for page2 which
extends .standardPage.  In short, it shouldn't matter at what level you
override an attribute.

Tai

-Original Message-
From: Kevin Cramer [mailto:[EMAIL PROTECTED]
Sent: Sunday, March 23, 2003 9:48 PM
To: Struts Users Mailing List
Subject: Re: Nesting tile definitions



Thank you.  I have this working.  The side effect is that it would
require me to define all the attributes at the highest level.  What if
I would like to define the attributes at a lower level and then
override it when it changes for a certain page?  In my example I would
like to define "right" at the .standardPage.header or
.standardPage.header.bar level and override it for page2.

I tried using  tags around the tiles:put
you specified below but that didn't help.  It seems that when you use
the tiles:put it overrides that attribute in the subtiles.  If the
attribute is not defined at the highest level then you don't get the
setting at lower levels.

Thanks,
Kevin

On Sat, Mar 22, 2003 at 06:42:10PM -0500, Tai Nguyen wrote:
> Kevin,
> 
> To make an attribute available to a nested tile you need to pass it along
> when you call the tile.  For example:
> 
> 
>   
>   
> 
> 
> Where beanName is the name of the attribute you want to pass and name is
> what you want to pass it as and scope is tile context.  In your case, you
> would also need to add a similar declaration in your .standardPage.header
> tile since you need to pass it along twice.  Once you've done all that,
you
> would actually specify the tiles attribute values in the parent
definition.
> This can be very helpful in keeping all the attributes for a given "view"
in
> one definition instead of scattered all over your tiles-def.xml.
> 
> Tai
> 
> -Original Message-
> From: Kevin Cramer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 20, 2003 6:19 PM
> To: Struts Users Mailing List
> Subject: Re: Nesting tile definitions
> 
> 
> 
> I got it working.  It was a problem with something else.  I didn't
> catch it.  It can be hard to find problems with the lack of debug
> messages that come back from the server.
> 
> My next question was how do I use attributes from supertiles?  I want
> to take a page and split it into tiles, one of which is the header.  I
> also wanted to further divide the header into subtiles.  In particular
> there is a part of a subtile in the header tile which can vary
> depending on which page you are on.  I'm wondering what is the easiest
> way to deal with it.
> 
> I'm doing all of this using the XML Tile definitions.  I put an
> example below with just the relevant parts.  If I want page1 to use
> one value for the "right" and page2 to use another value for "right"
> how do I do that?  "right" is defined 2 levels down from the standard
> page tile.  It would be nice to override it at the highest level.
> Perhaps I am doing things wrong.  It seems wrong to define multiple
> intermediate tiles for the different combinations.
> 
> 
>  path="/WEB-INF/common/layouts/standardLayout.jsp">
>  
>  
>  
>  
>   
> 
>  path="/WEB-INF/common/header.jsp">
> 
>   
> 
>  path="/WEB-INF/common/bar.jsp">
> 
> 
>   
> 
>  extends=".standardPage">
> 
> 
>   
> 
>  extends=".standardPage">
> 
> 
>   
> 
> 
> 
> 
> Kevin
> 
> On Wed, Mar 19, 2003 at 05:07:04PM -0500, Tai Nguyen wrote:
> > Kevin,
> > 
> > First if all, it is possible to use attributes from supertiles, but
that's
> > another issue.  The definitions you have posted look fine, so I would
> guess
> > that it's a problem with your header.jsp file.  Can you post that so we
> can
> > look at it, as well as the full error message you are getting?
> > 
> > Thanks,
> > Tai
> > 
> > -Original Message-
> > From: Kevin Cramer [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 19, 2003 4:43 PM
> > To: [EMAIL PROTECTED]
> > Subject: Nesting tile definitions
> > 
> > 
> > 
> > I am trying to have a tile definition include another definition but
> > it doesn't seem to be working.  Can I do this and if so then how do I
> > do it?
> > 
> > Here is an example of what I am trying to do.  I would like the header
> > of a standard page to be another tile so I can further divide it into
> > pieces.  However, when I try to create a definition that extends the
> > .standardPage I get an error at the top of the page.  It just says
> > that there has been a ServletException in
> > /WEB-INF/common/layouts/header.jsp.  I understand that a tile cannot
> > use attributes from subtiles or supertiles and I don't think that is
> > the problem.
> > 
> > 
> >>   path="/WEB-INF/common/layouts/standardLayout.jsp">
> >  
> >  
> >  
> >  
>

RE: [OT] struts/hibernate in Oracle mag

2003-03-23 Thread harish krishnaswamy
When it comes to OR mapping JDO is definitely the best
midlle ground available for Java IMO. OJB supports
both JDO and ODMG specs although a fully JDO compliant
version is on its way. So my vote is for OJB.

-Harish

--- "Hookom, Jacob John" <[EMAIL PROTECTED]> wrote:
> Why does no one use Jakarta's own OJB for
> persistence?  I think it's the most wonderful thing
> in the world, and the caching options with OJB are
> unbelievable.
>  
> -Jacob
> 
>   -Original Message- 
>   From: Dan Allen [mailto:[EMAIL PROTECTED] 
>   Sent: Sun 3/23/2003 4:31 PM 
>   To: Struts-User List 
>   Cc: 
>   Subject: [OT] struts/hibernate in Oracle mag
>   
>   
> 
>   This mail is really like a [FRIDAY] coming on
> Sunday.  I just
>   couldn't wait until next Friday to talk about it. 
> I recommend all
>   business conscious or just curious struts
> developers/users to check
>   out the Jan/Feb 2003 edition of Oracle magazine for
> a horde of
>   articles on Struts.  Sure, most of them just skim
> the surface with
>   HelloWorld type examples and boasting how Oracle
> supports it (I
>   personally use Eclipse as my IDE).  Anyway, it is
> neat to see all
>   the support for Struts.
>   
>   My question comes regarding an article entitled
> "Advances in Java's
>   Relationship to Data".  The article covers how JDBC
> is "hard-coded"
>   SQL and Entity EJB are heavy and very much
> abstracted from the data.
>   Then, it presents a middle ground which the article
> refers to as
>   "Java Objects" or persistent objects.  From what I
> read about
>   Hibernate compared to the discussion in this
> article, it seems that
>   this is what Hibernate is all about.  Am I right? 
> The equivalent
>   Oracle product is called TopLink.  If Hibernate is
> indeed what they
>   are talking about, I am going with it.  Right now I
> use Torque,
>   which I definitely like, but Hibernate has more
> activity and examples
>   and seems to be a little bit more well thought out.
>  But that isn't
>   to say Torque isn't good at all.  Anyway, getting
> off topic.
>   
>   Now for my honoring of the guard.  Thank you Struts
>   developers/users and congratulations.  Everyone
> here deserves it!
>   
>   Check it out.
>   
>   Dan
>   
>   --
>   - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - -
>   Daniel Allen, <[EMAIL PROTECTED]>
>   http://www.mojavelinux.com/
>   - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - -
>   "If you still don't like it, that's ok: that's why
> I'm boss. I
>   simply know better than you do."
>-- Linus Torvalds
>   - - - - - - - - - - - - - - - - - - - - - - - - - -
> - - - - -
>   
> 
>
-
>   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]


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



RE: Problem in invoking Action Class

2003-03-23 Thread Divyanand_Gupta
No , It is going to other jsp based on the selection , I am now able to find
problem . What I was doing , I was using  and In jsp I was taking conversationMap , beacuse of
this diffrence it was not able to invoke the jsp.
New problem is , I am having one FormBean which I am setting in the Action
.This FB is being used in the rest of Action ,but I am not able to access
the form bean .It's giving FileNotFoundException ...RootCause is
java.lang.ExceptionInitializationError.
If I remove input attribute from action element  it easly gose to Action
class . Any help ?

the error is 

Thanks
For Reply

-Original Message-
From: Sri Sankaran [mailto:[EMAIL PROTECTED]
Sent: Monday, March 24, 2003 1:41 AM
To: Struts Users Mailing List
Subject: RE: Problem in invoking Action Class


Is your input attribute value (/OrderMediaMain.jsp) refer to the same
location as you are trying to submit?  

Look at the "Root Cause" portion of your stack trace; it reads:

Can't find bundle for base name etc.ebusiness, locale en_US

Does "etc.business" mean anything to you?

Sri

-Original Message-
From: Divyanand_Gupta [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 22, 2003 9:40 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Problem in invoking Action Class


Hi All ,
 I am getting problem in instantiating FormBean.
My UI is having one select box and when user select somthing and press
continue it invoke an action . But it is not going to action . 
Here is my struts-config.xml setting .











Error is 
2003-03-22 19:26:47 StandardWrapperValve[action]: Servlet.service() for
servlet action threw exception
javax.servlet.ServletException: Servlet execution threw an exception
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:386)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:530)
at java.lang.Thread.run(Thread.java:479)
- Root Cause -
java.lang.ExceptionInInitializerError: java.util.MissingResourceException:
Can't find bundle for base name etc.ebusiness, locale en_US
at
java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:7
07)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:678)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:541)
at
com.silknet.ebiz.util.SafeProperties.loadKanaProperties(SafeProperties.

RE: [OT] struts/hibernate in Oracle mag

2003-03-23 Thread Hookom, Jacob John
Why does no one use Jakarta's own OJB for persistence?  I think it's the most 
wonderful thing in the world, and the caching options with OJB are unbelievable.
 
-Jacob

-Original Message- 
From: Dan Allen [mailto:[EMAIL PROTECTED] 
Sent: Sun 3/23/2003 4:31 PM 
To: Struts-User List 
Cc: 
Subject: [OT] struts/hibernate in Oracle mag



This mail is really like a [FRIDAY] coming on Sunday.  I just
couldn't wait until next Friday to talk about it.  I recommend all
business conscious or just curious struts developers/users to check
out the Jan/Feb 2003 edition of Oracle magazine for a horde of
articles on Struts.  Sure, most of them just skim the surface with
HelloWorld type examples and boasting how Oracle supports it (I
personally use Eclipse as my IDE).  Anyway, it is neat to see all
the support for Struts.

My question comes regarding an article entitled "Advances in Java's
Relationship to Data".  The article covers how JDBC is "hard-coded"
SQL and Entity EJB are heavy and very much abstracted from the data.
Then, it presents a middle ground which the article refers to as
"Java Objects" or persistent objects.  From what I read about
Hibernate compared to the discussion in this article, it seems that
this is what Hibernate is all about.  Am I right?  The equivalent
Oracle product is called TopLink.  If Hibernate is indeed what they
are talking about, I am going with it.  Right now I use Torque,
which I definitely like, but Hibernate has more activity and examples
and seems to be a little bit more well thought out.  But that isn't
to say Torque isn't good at all.  Anyway, getting off topic.

Now for my honoring of the guard.  Thank you Struts
developers/users and congratulations.  Everyone here deserves it!

Check it out.

Dan

--
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"If you still don't like it, that's ok: that's why I'm boss. I
simply know better than you do."
 -- Linus Torvalds
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

-
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: Nesting tile definitions

2003-03-23 Thread Kevin Cramer

Thank you.  I have this working.  The side effect is that it would
require me to define all the attributes at the highest level.  What if
I would like to define the attributes at a lower level and then
override it when it changes for a certain page?  In my example I would
like to define "right" at the .standardPage.header or
.standardPage.header.bar level and override it for page2.

I tried using  tags around the tiles:put
you specified below but that didn't help.  It seems that when you use
the tiles:put it overrides that attribute in the subtiles.  If the
attribute is not defined at the highest level then you don't get the
setting at lower levels.

Thanks,
Kevin

On Sat, Mar 22, 2003 at 06:42:10PM -0500, Tai Nguyen wrote:
> Kevin,
> 
> To make an attribute available to a nested tile you need to pass it along
> when you call the tile.  For example:
> 
> 
>   
>   
> 
> 
> Where beanName is the name of the attribute you want to pass and name is
> what you want to pass it as and scope is tile context.  In your case, you
> would also need to add a similar declaration in your .standardPage.header
> tile since you need to pass it along twice.  Once you've done all that, you
> would actually specify the tiles attribute values in the parent definition.
> This can be very helpful in keeping all the attributes for a given "view" in
> one definition instead of scattered all over your tiles-def.xml.
> 
> Tai
> 
> -Original Message-
> From: Kevin Cramer [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 20, 2003 6:19 PM
> To: Struts Users Mailing List
> Subject: Re: Nesting tile definitions
> 
> 
> 
> I got it working.  It was a problem with something else.  I didn't
> catch it.  It can be hard to find problems with the lack of debug
> messages that come back from the server.
> 
> My next question was how do I use attributes from supertiles?  I want
> to take a page and split it into tiles, one of which is the header.  I
> also wanted to further divide the header into subtiles.  In particular
> there is a part of a subtile in the header tile which can vary
> depending on which page you are on.  I'm wondering what is the easiest
> way to deal with it.
> 
> I'm doing all of this using the XML Tile definitions.  I put an
> example below with just the relevant parts.  If I want page1 to use
> one value for the "right" and page2 to use another value for "right"
> how do I do that?  "right" is defined 2 levels down from the standard
> page tile.  It would be nice to override it at the highest level.
> Perhaps I am doing things wrong.  It seems wrong to define multiple
> intermediate tiles for the different combinations.
> 
> 
>  path="/WEB-INF/common/layouts/standardLayout.jsp">
>  
>  
>  
>  
>   
> 
>  path="/WEB-INF/common/header.jsp">
> 
>   
> 
>  path="/WEB-INF/common/bar.jsp">
> 
> 
>   
> 
>  extends=".standardPage">
> 
> 
>   
> 
>  extends=".standardPage">
> 
> 
>   
> 
> 
> 
> 
> Kevin
> 
> On Wed, Mar 19, 2003 at 05:07:04PM -0500, Tai Nguyen wrote:
> > Kevin,
> > 
> > First if all, it is possible to use attributes from supertiles, but that's
> > another issue.  The definitions you have posted look fine, so I would
> guess
> > that it's a problem with your header.jsp file.  Can you post that so we
> can
> > look at it, as well as the full error message you are getting?
> > 
> > Thanks,
> > Tai
> > 
> > -Original Message-
> > From: Kevin Cramer [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, March 19, 2003 4:43 PM
> > To: [EMAIL PROTECTED]
> > Subject: Nesting tile definitions
> > 
> > 
> > 
> > I am trying to have a tile definition include another definition but
> > it doesn't seem to be working.  Can I do this and if so then how do I
> > do it?
> > 
> > Here is an example of what I am trying to do.  I would like the header
> > of a standard page to be another tile so I can further divide it into
> > pieces.  However, when I try to create a definition that extends the
> > .standardPage I get an error at the top of the page.  It just says
> > that there has been a ServletException in
> > /WEB-INF/common/layouts/header.jsp.  I understand that a tile cannot
> > use attributes from subtiles or supertiles and I don't think that is
> > the problem.
> > 
> > 
> >>   path="/WEB-INF/common/layouts/standardLayout.jsp">
> >  
> >  
> >  
> >  
> >  
> >   
> > 
> >>   path="/WEB-INF/common/layouts/header.jsp">
> >
> >
> >  
> > 
> > 
> > Thanks,
> > Kevin
> > 
> > -
> > 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: Populating form fields (more)

2003-03-23 Thread Karl Stenerud
Hi, thanks for the reply, but I'm looking for something a little different 
(Bfrom this...
(B
(BI'm not sure if I am missing some fundamental concept of struts, but it 
(Bappears to be missing the ability to have the action class provide a form 
(Bbean for presentation that is different from the form bean passed in for the 
(Bbusiness logic to act upon.
(B
(BBasically I wanted to have the following use case:
(B
(B- User is on page tuna in their browser.
(B- User fills out the form and hits submit.
(B- Struts gets the request and fills out a TunaForm object, and then passes it 
(Bto TunaAction.
(B- TunaAction acts upon the request, and then prepares SwordfishForm.
(B- Struts then gets swordfish.jsp and fills out some default values from the 
(BSwordFishForm that TunaAction made and filled out.
(B- Struts sends the resulting HTML back, and it reaches the user's browser.
(B- User makes some modifications and/or additions and hits submit.
(B- Struts gets the request and fills out a SwordfishForm object, and then 
(Bpasses it to SwordfishAction.
(B- SwordfishAction acts upon the request and does whatever.
(B
(BAs far as I can tell, inside TunaAction I need to make a SwordfishForm and 
(Bthen save it on the request:
(B
(Bpublic ActionForward perform(
(B  ActionMapping mapping,
(B  ActionForm form,
(B  HttpServletRequest request,
(B  HttpServletResponse response) {
(B
(BTunaForm workForm = (TunaForm)form;
(B// ... do something with workForm
(B
(B// Now we've done our business logic so make the form for our next view
(BSwordfishForm outForm = new SwordfishForm();
(B// ... fill out data pieces here
(B// Now set into the request
(Brequest.setAttribute("swordfishForm", outForm);
(B
(B// All done
(Breturn (mapping.findForward("success"));
(B}
(B
(B
(BI thought at this point I could just let Struts fill out swordfish.jsp 
(Bautomatically from SwordfishForm like this:
(B
(B
(B
(B
(B
(BName
(B
(B
(B
(B
(B
(BColor
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(BBut if I do this, the data doesn't get filled out (the form I put into the 
(Brequest is different from the one associated in the struts config file I 
(Bguess?)
(B
(BIf I do this:
(B
(B
(B
(B
(B
(BName
(B
(B
(B
(B
(B
(BColor
(B
(B
(B
(B
(B
(B
(B
(B
(B
(B
(BIt will fill out name and color, but the hidden property causes it to throw an 
(Bexception.
(B
(B/home/projects/tomcat/work/Standalone/localhost/tuna/swordfish_jsp.java:153: 
(BCannot resolve symbol
(BSymbol   : Method setValue (int)
(BLocation : Class org.apache.struts.taglib.html.HiddenTag
(B  _jspx_th_html_hidden_0.setValue(swordfishForm.getId());
(B
(BThis is also kind of ugly because now I have to mix java code and html, 
(Bsomething I'd rather avoid if possible.
(B
(BThat's where I'd gotten the idea to do this:
(B
(B
(B
(B
(B
(B
(B
(BName
(B
(B"/>
(B
(B
(B
(BColor
(B
(B"/>
(B
(B
(B
(B
(B"/>
(B
(B
(B
(B
(BUnfortunately, this doesn't work either since the taglibs don't appear to 
(Ballow embedded taglib tags...
(B
(B
(B
(B2003 3$B7n(B 20 $BLZMKF|(B 19:24$B!"([EMAIL PROTECTED] $B$5$s$O=q$-$^$7$?(B:
(B> Hi,
(B> There was some similar question on the mailing list a long back and i am
(B> reaending the answers i had given...Let me know if u have any doubts.. But
(B> please be a  bit patient and go through the mails ..MAy be first have a
(B> look at the jsp i have given at the end first and then go through the rest
(B> of the mails..
(B>
(B> Hope this helps..
(B>
(B> regards,
(B> Shirish
(B
(B
(B-
(BTo unsubscribe, e-mail: [EMAIL PROTECTED]
(BFor additional commands, e-mail: [EMAIL PROTECTED]

RE: case study with security

2003-03-23 Thread Mike Duffy
It is not necessary to create a specialty tag.  

If you are using container managed security and your users are set in
specific roles you can use the logic:present tag with the role
attribute.

I do think the right way to do this is have the view conditional
based on roles.

Mike

--- Marco Tedone <[EMAIL PROTECTED]> wrote:
> I hope to give my 2 cents here. What I'm going to do (therefore
> what I would
> suggest you to do) is to create a custom tag like
>  which I'll use in my JSP to
> present
> the user some contents instead of some others. The background is
> that I had
> to create an application specific User authentication service,
> based on XML
> configuration file and commons-digester parsing to validate user's
> login
> information with the information contained in the XML configuration
> file. 
> 
> The process looks like the following:
> 
> 1) XML user's configuration file: -> XML file, containing user's
> login info,
> like username, password and role
> 2) User Service -> A Business Service which, given the user's login
> credentials, returns true if those match the XML configuration file
> info,
> otherwise returns false;
> Login Action -> Uses the User Service and if user has the right
> credentials,
> CREATE a session attribute with the user details stating that user
> has the
> right credentials;
> Tag library -> Retrieves session attribute for user(not the
> container one,
> but the application one, from the Form declared in session scope!);
> if it
> doesn't exists(meaning that user hasn't logged in succesfully)
> returns
> something like SKIP_BODY or EVAL_BODY.
> 
> I had the need for that because I didn't want to bind, let's say, a
> Tomcat
> user with my application user. Now, thinking to put this custom tag
> at the
> beginning and at the end of what is crucial to your application it
> could
> work fine, in your case:
> 
> 
> 
>   
> 
> 
> 
> 
>   
> 
> 
> Or something similar...I haven't implemented the model yet, so
> these are
> only ideas.
> 
> Regards,
> 
> Marco
> 
> > -Original Message-
> > From: Dan Allen [mailto:[EMAIL PROTECTED] 
> > Sent: Sunday, March 23, 2003 7:04 PM
> > To: Struts-User List
> > Subject: case study with security
> > 
> > 
> > There have been several discussions on this list about how 
> > security should be loosely coupled with the ActionServlet 
> > itself (a filter on top of the application), but I am curious 
> > to know the best practicing for handling the following type of
> case.
> > 
> > Assume I have an action with a path of /EditAccount.  
> > Naturally if a user is not logged in, this path should be 
> > protected via filtering. However, /EditAccount has two 
> > purposes, one for the regular user to edit his/her own 
> > account, but also for the administrator to edit any user 
> > account via the query string ?user=username.  In this case, I 
> > have to check in the action class if the user is allowed to 
> > take on the role of another user in which case the form is 
> > populated with that user's data or, if not, the form should 
> > populate with the user's own data.
> > 
> > Is this something that is reasonable to do in the action, or 
> > should I create another action path 
> > /EditUserAccount?user=username and filter that to only admins 
> > and then forward to the /EditAccount once the proper 
> > credientials have been established, hence relieving the 
> > action behind /EditAccount from looking at any roles?
> > 
> > Dan
> > 
> > -- 
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> > Daniel Allen, <[EMAIL PROTECTED]>
> > http://www.mojavelinux.com/
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> > "If you are going to play the game of trial and error, 
> > don't be surprised when the results are revealing. -- me"
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> > 
> 
>
-
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



RE: case study with security

2003-03-23 Thread Marco Tedone
I hope to give my 2 cents here. What I'm going to do (therefore what I would
suggest you to do) is to create a custom tag like
 which I'll use in my JSP to present
the user some contents instead of some others. The background is that I had
to create an application specific User authentication service, based on XML
configuration file and commons-digester parsing to validate user's login
information with the information contained in the XML configuration file. 

The process looks like the following:

1) XML user's configuration file: -> XML file, containing user's login info,
like username, password and role
2) User Service -> A Business Service which, given the user's login
credentials, returns true if those match the XML configuration file info,
otherwise returns false;
Login Action -> Uses the User Service and if user has the right credentials,
CREATE a session attribute with the user details stating that user has the
right credentials;
Tag library -> Retrieves session attribute for user(not the container one,
but the application one, from the Form declared in session scope!); if it
doesn't exists(meaning that user hasn't logged in succesfully) returns
something like SKIP_BODY or EVAL_BODY.

I had the need for that because I didn't want to bind, let's say, a Tomcat
user with my application user. Now, thinking to put this custom tag at the
beginning and at the end of what is crucial to your application it could
work fine, in your case:



  




  


Or something similar...I haven't implemented the model yet, so these are
only ideas.

Regards,

Marco

> -Original Message-
> From: Dan Allen [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, March 23, 2003 7:04 PM
> To: Struts-User List
> Subject: case study with security
> 
> 
> There have been several discussions on this list about how 
> security should be loosely coupled with the ActionServlet 
> itself (a filter on top of the application), but I am curious 
> to know the best practicing for handling the following type of case.
> 
> Assume I have an action with a path of /EditAccount.  
> Naturally if a user is not logged in, this path should be 
> protected via filtering. However, /EditAccount has two 
> purposes, one for the regular user to edit his/her own 
> account, but also for the administrator to edit any user 
> account via the query string ?user=username.  In this case, I 
> have to check in the action class if the user is allowed to 
> take on the role of another user in which case the form is 
> populated with that user's data or, if not, the form should 
> populate with the user's own data.
> 
> Is this something that is reasonable to do in the action, or 
> should I create another action path 
> /EditUserAccount?user=username and filter that to only admins 
> and then forward to the /EditAccount once the proper 
> credientials have been established, hence relieving the 
> action behind /EditAccount from looking at any roles?
> 
> Dan
> 
> -- 
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> Daniel Allen, <[EMAIL PROTECTED]>
> http://www.mojavelinux.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> "If you are going to play the game of trial and error, 
> don't be surprised when the results are revealing. -- me"
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> 

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



Re: case study with security

2003-03-23 Thread Dan Allen
> Looks like a good solution to me.
Excellent, I am starting to get this ;)

> Note, btw, that I did not mean to recommend "desk phone" as a generic 
> identifier.
Naturally, I will use what is specific to my app.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Hey, somebody, sometime, somewhere, said something I think that 
just maybe might have been true but I think that I maybe 
didn't like it. 
 
F^CK IT, I'm suing everybody. 
 -- slashdot member in response to 
petswarehouse.com sueing google.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



binding data to the JSP

2003-03-23 Thread Dan Allen
At some point the action class has to pass data onto the JSP for
displaying, such as a list of items.  This data can either be placed
in the session or the request, depending on how long it needs to
persist.  So in essence, the JSP has to work with what I view as
"magical" data, since the JSP just assumes that data will be there
when it needs it (checking for empty naturally to handle cases where
it is not).

I was wondering if there are any best practices for dealing with
the names of these variables and how to communicate which ones will
exist to the JSP developer.  For instance, one a page that displays
the member profile, I pass the data to the request in an attribute
called "profile" which I make a public constant in my action
class called PROFILE_KEY.  Does anyone do anything special for
documentation to communicate this data transfer (like what the
variable name is and what it holds and maybe how to handle it?)  It
just seems like a lot of effort goes into abstracting the
configuration only to leave this part very fuzzy.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
It is not enough to succeed.  Others must fail.  
 -- Gore Vidal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: case study with security

2003-03-23 Thread Phil Steitz
Dan Allen wrote:
After reading the suggestions, I am going to go with two different
actions for setting up the form.  In order to use container managed
security most effectively, I am going to prefix paths with admin
restrictions with admin/ for ease of filter matching.
So 

/EditAccount

/admin/EditAccount?user=username

Then I will make a common abstract Action class for editing an
account which both actions will extend to make use of the common
routines.  The /EditAccount will not listen to any query params but
rather use the current session data as the data to populate the form
with, whereas the /admin/EditAccount will use the user parameter to
lookup the user using the DeskPhone as suggested.  This way, all the
security is controlled by the container, but the logic is left in
the action for simply setting it up as instructed (with no checks
for security).
Thanks for the input and append anywhere I have deviated from the
suggestion.
Dan

Looks like a good solution to me.  I agree that it is best to keep all 
of the security policies declaratively defined. I also like to keep the 
link between the logged in user and his/her account "automatic" (i.e., 
determined by the system and looked up as close as possible to the model 
updates) whenever possible.  Your solution does both of these things.

Note, btw, that I did not mean to recommend "desk phone" as a generic 
identifier.  Obviously, a) the "lookup" key best for your admins to use 
depends on your application and b) whatever you use, it has to be 
unique. The app that I took the example from enforces this.

Phil

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


[OT] struts/hibernate in Oracle mag

2003-03-23 Thread Dan Allen
This mail is really like a [FRIDAY] coming on Sunday.  I just
couldn't wait until next Friday to talk about it.  I recommend all
business conscious or just curious struts developers/users to check
out the Jan/Feb 2003 edition of Oracle magazine for a horde of
articles on Struts.  Sure, most of them just skim the surface with
HelloWorld type examples and boasting how Oracle supports it (I
personally use Eclipse as my IDE).  Anyway, it is neat to see all
the support for Struts.

My question comes regarding an article entitled "Advances in Java's
Relationship to Data".  The article covers how JDBC is "hard-coded"
SQL and Entity EJB are heavy and very much abstracted from the data.
Then, it presents a middle ground which the article refers to as
"Java Objects" or persistent objects.  From what I read about
Hibernate compared to the discussion in this article, it seems that
this is what Hibernate is all about.  Am I right?  The equivalent
Oracle product is called TopLink.  If Hibernate is indeed what they
are talking about, I am going with it.  Right now I use Torque,
which I definitely like, but Hibernate has more activity and examples
and seems to be a little bit more well thought out.  But that isn't
to say Torque isn't good at all.  Anyway, getting off topic.

Now for my honoring of the guard.  Thank you Struts
developers/users and congratulations.  Everyone here deserves it!

Check it out.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"If you still don't like it, that's ok: that's why I'm boss. I 
simply know better than you do." 
 -- Linus Torvalds
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: case study with security

2003-03-23 Thread Dan Allen
After reading the suggestions, I am going to go with two different
actions for setting up the form.  In order to use container managed
security most effectively, I am going to prefix paths with admin
restrictions with admin/ for ease of filter matching.

So 

/EditAccount

/admin/EditAccount?user=username

Then I will make a common abstract Action class for editing an
account which both actions will extend to make use of the common
routines.  The /EditAccount will not listen to any query params but
rather use the current session data as the data to populate the form
with, whereas the /admin/EditAccount will use the user parameter to
lookup the user using the DeskPhone as suggested.  This way, all the
security is controlled by the container, but the logic is left in
the action for simply setting it up as instructed (with no checks
for security).

Thanks for the input and append anywhere I have deviated from the
suggestion.

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"I am the GOD.the GOD...of house!" 
 -- Leeloo
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Re: case study with security

2003-03-23 Thread Phil Steitz
Dan Allen wrote:
There have been several discussions on this list about how security
should be loosely coupled with the ActionServlet itself (a filter on
top of the application), but I am curious to know the best
practicing for handling the following type of case.
Assume I have an action with a path of /EditAccount.  Naturally if a
user is not logged in, this path should be protected via filtering.
However, /EditAccount has two purposes, one for the regular user to
edit his/her own account, but also for the administrator to edit any
user account via the query string ?user=username.  In this case, I
have to check in the action class if the user is allowed to take on
the role of another user in which case the form is populated with
that user's data or, if not, the form should populate with the
user's own data.
Is this something that is reasonable to do in the action, or should
I create another action path /EditUserAccount?user=username and
filter that to only admins and then forward to the /EditAccount once
the proper credientials have been established, hence relieving the
action behind /EditAccount from looking at any roles?
Assuming that you are using container-managed security and roles, you 
can do it with one action by having the action ignore the user parameter 
unless the user is an administrator. You can check if the user is an 
administrator using
if (request.isUserInRole("whatever-you-named-the-admin-role")).
If the user is not an administrator, you can use request.getRemoteUser() 
to get the user id and then populate the form based on the user's own 
data.  Here is a similar example:

if ((frm.getDeskPhone() != null) &&
   (request.isUserInRole(Constants.ADMINISTRATOR))) {
rd.setDeskPhone(frm.getDeskPhone());
rd.retrieveByPhone();
} else {
rd.setUid(request.getRemoteUser());
rd.retrieveByUid();
}
...use rd to populate current profile data onto frm...

In this example, the "deskPhone" parameter is what the admin uses to 
loookup a user.  The rd object is an entity-like bean that represents a 
user.

If you decide to use separate Actions for admins and users -- 
eliminating the need for the conditional logic above -- you should make 
sure NOT to leave the user parameter in the queryString for the 
non-administrators or to add a check in the non-admin action to make 
sure that the user is editing his/her own profile.  In this case, you 
should also encapsulate the common elements that both "editAccount" 
actions will share.

Which approach is best depends on the complexity of the application and 
how you expect it to evolve over time. The second approach -- different 
actions for admins -- is more flexible but a little more work to implement.

hth,

Phil



Dan





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


RE: Problem in invoking Action Class

2003-03-23 Thread Sri Sankaran
Is your input attribute value (/OrderMediaMain.jsp) refer to the same location as you 
are trying to submit?  

Look at the "Root Cause" portion of your stack trace; it reads:

Can't find bundle for base name etc.ebusiness, locale en_US

Does "etc.business" mean anything to you?

Sri

-Original Message-
From: Divyanand_Gupta [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 22, 2003 9:40 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: Problem in invoking Action Class


Hi All ,
 I am getting problem in instantiating FormBean.
My UI is having one select box and when user select somthing and press continue it 
invoke an action . But it is not going to action . 
Here is my struts-config.xml setting .











Error is 
2003-03-22 19:26:47 StandardWrapperValve[action]: Servlet.service() for servlet action 
threw exception
javax.servlet.ServletException: Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:386)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:530)
at java.lang.Thread.run(Thread.java:479)
- Root Cause -
java.lang.ExceptionInInitializerError: java.util.MissingResourceException:
Can't find bundle for base name etc.ebusiness, locale en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:7
07)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:678)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:541)
at
com.silknet.ebiz.util.SafeProperties.loadKanaProperties(SafeProperties.java:
150)
at
com.silknet.ebiz.util.SafeProperties.(SafeProperties.java:33)
at
com.silknet.ebiz.util.SilkProperties.(SilkProperties.java:67)
at
com.silknet.ebiz.silkrequest.client.Environment.(Environment.java:35)
at com.gecs.apollo.common.action.ActionContext.getEnvironment(ActionContext.jav
a:302)
at com.gecs.apollo.common.action.ActionContext.populateCommonData(ActionContext
.java:260)
at
com.gecs.apollo.common.action.ActionContext.(ActionContext.java:396)
at com.gecs.apollo.common.action.ApolloBaseAction.perform(ApolloBaseAction.java
:76)
at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.ja
va:1787)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
 

Re: case study with security

2003-03-23 Thread Vic Cekvenich
A good practice is to use decelrative Container Managed Security.
This kind of implies you set it up in web.xml (via a /securePath/*) or 
via action mapping in struts config.

(writing you own security is not a good parctice, IMO)
hth,
V
(do not cofuse that with the non container based filter implementation 
of above available from sf.net)

Dan Allen wrote:
There have been several discussions on this list about how security
should be loosely coupled with the ActionServlet itself (a filter on
top of the application), but I am curious to know the best
practicing for handling the following type of case.
Assume I have an action with a path of /EditAccount.  Naturally if a
user is not logged in, this path should be protected via filtering.
However, /EditAccount has two purposes, one for the regular user to
edit his/her own account, but also for the administrator to edit any
user account via the query string ?user=username.  In this case, I
have to check in the action class if the user is allowed to take on
the role of another user in which case the form is populated with
that user's data or, if not, the form should populate with the
user's own data.
Is this something that is reasonable to do in the action, or should
I create another action path /EditUserAccount?user=username and
filter that to only admins and then forward to the /EditAccount once
the proper credientials have been established, hence relieving the
action behind /EditAccount from looking at any roles?
Dan



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


Re: case study with security

2003-03-23 Thread Dan Tran
BTW,the current login user can only change his/her own login/acount profile

-D
- Original Message -
From: "Dan Tran" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2003 11:16 AM
Subject: Re: case study with security


> In your case, you can make administrator is a 'user' itself so that
> /EditAccount.do works for both roles. However,
> I strongly suspect your action/view you have to do lots of if else block
to
> determine what to do and what to display.
>
> Encapsulation is the key here, I would provide 2 separate actions, one for
> the normal current login user and one for administrator to edit any user
> account.
>
> -Dan
>
> - Original Message -
> From: "Dan Allen" <[EMAIL PROTECTED]>
> To: "Struts-User List" <[EMAIL PROTECTED]>
> Sent: Sunday, March 23, 2003 11:03 AM
> Subject: case study with security
>
>
> > There have been several discussions on this list about how security
> > should be loosely coupled with the ActionServlet itself (a filter on
> > top of the application), but I am curious to know the best
> > practicing for handling the following type of case.
> >
> > Assume I have an action with a path of /EditAccount.  Naturally if a
> > user is not logged in, this path should be protected via filtering.
> > However, /EditAccount has two purposes, one for the regular user to
> > edit his/her own account, but also for the administrator to edit any
> > user account via the query string ?user=username.  In this case, I
> > have to check in the action class if the user is allowed to take on
> > the role of another user in which case the form is populated with
> > that user's data or, if not, the form should populate with the
> > user's own data.
> >
> > Is this something that is reasonable to do in the action, or should
> > I create another action path /EditUserAccount?user=username and
> > filter that to only admins and then forward to the /EditAccount once
> > the proper credientials have been established, hence relieving the
> > action behind /EditAccount from looking at any roles?
> >
> > Dan
> >
> > --
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > Daniel Allen, <[EMAIL PROTECTED]>
> > http://www.mojavelinux.com/
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> > "If you are going to play the game of trial and error,
> > don't be surprised when the results are revealing. -- me"
> > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> >
> > -
> > 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: case study with security

2003-03-23 Thread Dan Tran
In your case, you can make administrator is a 'user' itself so that
/EditAccount.do works for both roles. However,
I strongly suspect your action/view you have to do lots of if else block to
determine what to do and what to display.

Encapsulation is the key here, I would provide 2 separate actions, one for
the normal current login user and one for administrator to edit any user
account.

-Dan

- Original Message -
From: "Dan Allen" <[EMAIL PROTECTED]>
To: "Struts-User List" <[EMAIL PROTECTED]>
Sent: Sunday, March 23, 2003 11:03 AM
Subject: case study with security


> There have been several discussions on this list about how security
> should be loosely coupled with the ActionServlet itself (a filter on
> top of the application), but I am curious to know the best
> practicing for handling the following type of case.
>
> Assume I have an action with a path of /EditAccount.  Naturally if a
> user is not logged in, this path should be protected via filtering.
> However, /EditAccount has two purposes, one for the regular user to
> edit his/her own account, but also for the administrator to edit any
> user account via the query string ?user=username.  In this case, I
> have to check in the action class if the user is allowed to take on
> the role of another user in which case the form is populated with
> that user's data or, if not, the form should populate with the
> user's own data.
>
> Is this something that is reasonable to do in the action, or should
> I create another action path /EditUserAccount?user=username and
> filter that to only admins and then forward to the /EditAccount once
> the proper credientials have been established, hence relieving the
> action behind /EditAccount from looking at any roles?
>
> Dan
>
> --
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> Daniel Allen, <[EMAIL PROTECTED]>
> http://www.mojavelinux.com/
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> "If you are going to play the game of trial and error,
> don't be surprised when the results are revealing. -- me"
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>
> -
> 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]



case study with security

2003-03-23 Thread Dan Allen
There have been several discussions on this list about how security
should be loosely coupled with the ActionServlet itself (a filter on
top of the application), but I am curious to know the best
practicing for handling the following type of case.

Assume I have an action with a path of /EditAccount.  Naturally if a
user is not logged in, this path should be protected via filtering.
However, /EditAccount has two purposes, one for the regular user to
edit his/her own account, but also for the administrator to edit any
user account via the query string ?user=username.  In this case, I
have to check in the action class if the user is allowed to take on
the role of another user in which case the form is populated with
that user's data or, if not, the form should populate with the
user's own data.

Is this something that is reasonable to do in the action, or should
I create another action path /EditUserAccount?user=username and
filter that to only admins and then forward to the /EditAccount once
the proper credientials have been established, hence relieving the
action behind /EditAccount from looking at any roles?

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, <[EMAIL PROTECTED]>
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
"If you are going to play the game of trial and error, 
don't be surprised when the results are revealing. -- me"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

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



Bookmarking the Login Page - Container Managed Security

2003-03-23 Thread Mike Duffy
Does anyone know of a Struts work around for the problem with Tomact
in bookmarking the login page for container managed security?

There was a brief thread on this issue about a month ago
[http://www.mail-archive.com/[EMAIL PROTECTED]/msg59734.html]

There is a SourceForge project called SecurityFilter that can be used
to replace Tomcat's container managed security, but it would be nice
to be able to work with Tomcat.

Has anyone tried to call "j_security_check" directly from an Action
class?  Once you can authenticate a user you would be able to get the
roles for that user.

Is there a way to set up a JDBC Realm purely in Struts? I did not see
any information on this in a quick scan of the documentation.

Hopefully, the good people working on Tomcat see this as a bug that
needs to be fixed.

Quote from a recent thread in the Tomcat news group:  "I wish that
there was a legitimate configuration change to enable you to bookmark
a login.jsp page--such as a j_success_url parameter which instructs
Tomcat where to send users if not doing an automated login process."

Another user stated, "...I simply just can't believe that there are
Tomcat instances out there in a live production environment with
configured realms that suffer from this problem. Surely there must be
something"
http://www.mail-archive.com/[EMAIL PROTECTED]/msg77974.html

Thanks.

Mike


__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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