RE: EJB references

2000-12-06 Thread Alix Jermyn


Jim is quite right, you should be able to remove references to EJB
structures, even from the the Action Servlets themselves.  I have had some
EJB experience, but am new to struts, but one of the nice things about
struts is its abilty to isolate most of the presentation logic from the
business and backend logic.  You should be able to design the struts sides
of things without knowing about how your data will be managed in the
backend, allowing you to plug in an EJB solution, direct JDBC calls, LDAP
etc modules.   

Most of the backend logic should be accessed within the Action classes,
which will have generic data methods, which in turn access the actual data
access classes you decide to go with.  You will have a few(one)
application/session/request context web tier controller classes which know
how to deal with the EJB tier objects. I have found it cleaner/easier to
have the web tier controller(s) talk to a sesssion bean controller object in
the EJB tier which in turn deals with the necessary session and entity beans
needed to actually manipulate your data, and like Jim, would be wary of
using too many entity beans, which have a relatively heavy overhead.



--Original Message-
-From: Jim Richards [mailto:[EMAIL PROTECTED]]
-
-I'll be using ELB's for my application when I start building it
-in a few weeks time (still in the design stage). I expect to
-be using only EJBs from a action servlet, that are session
-beans, and those session beans use entity beans. From previous
-work I found there was too much overhead using the entity beans
-directly in the generation of a html page, and you rarely
-needed that direct conncetion to the database anyway.
-
-As for the references, I'm not sure what you mean. I'll be putting
-things like the JNDI and connection information into to web.xml
-as startup parameters.
-
-"Boulatian, Misak" wrote:
- 
- Hi all,
- 
- The application we design is quite large. I am still trying 
-to figure out
- the question on EJB references. From the Craig Mcc.'s 
-comment I could put
- those in one startup servlet. Is it a viable solution? I am 
-going to have
- many session references. Where am I going to store those 
-references (in
- servlet context)? How can I make those available to action 
-classes? Or I can
- put only the handle in the servlet context and call lookup 
-in every action
- class (any scalability problems with this approach?). I 
-cannot believe that
- none of you worked in large applications and will not be 
-using EJBs for
- business logic and did not go over this kind of issue.
- 
- I appreciate response,
- Misak Boulatian
-



A form with valiable number of beans

2000-12-06 Thread Lars

I am trying to use Struts to create a page where I am editing an Entity
(e.g. an order) and a variable number of sub-entities (e.g. order lines). I
have corresponding beans in my session (an Order bean with a vector holding
a number of OrderLine beans).

I would like to have certain properties of all sub-entities open for editing
and the page being recreated with all the values if it is submitted and the
displayed again.

How could I use the ActionForm and the tag-library to be able to use the
automatic population of the properties of the form bean?

I have tried to use the logic:iterate tag to build the list of order lines
but stumbled on the naming of each text field. For example, the quantities
field would have to be named "quantity1", quantity2", etc. If I use the
form:text tag I can specify the bean and the property, but this gives me an
identical name for all "quantity" fields. Even if I manage to uniquely name
the fields, how can I create an ActionForm with corresponding properties to
be set by the framework.

Maybe I have to do this manually? Any suggestions how?

If this has been discussed before, please point me to an approximate time
frame.

Regards,
Lars Andersson







Struts+Weblogic+WARs

2000-12-06 Thread Andre Wittenburg

Hi!

I'm using weblogic(sp6) with Struts and the WebAppStartup class, which was
posted in the struts-user list.

My problem is, that i want to use the weblogic property
"weblogic.httpd.defaultWebApp", so my problems with the context path would
vanish (and i would like to have this webApp in the root of the server). But
unfortunately the WebAppStartup.class needs as a parameter the virtualName
of the webApp, which does not exist...

The source of WebAppStartup uses "ServletContextImpl servletcontextimpl =
servletcontextmanager.getContext(s1);" to find the jsp pages which should be
precompiled. Unfortunately the servletcontexmanager is not documented in the
API-Doc, so i need some advise here

Any hints? Sorry, if this is wrong mailing list, but i found the source of
WebAppStartup here and it seems that there more weblogic users.

Thanx
Andre




RE: Article on JavaWorld

2000-12-06 Thread Malcolm Davis

Just a Note:
Open-source aside, making medications (patches) to
code for work around in libraries, frameworks,
even compilers and os, has always been part of software development.

Maybe we should have a Struts offramp.
- Malcolm

 -Original Message-
 From: Lacerda, Wellington (AFIS) [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 06, 2000 3:00 AM
 To: '[EMAIL PROTECTED]'
 Subject: RE: Article on JavaWorld


 I agree 100% with you. I've had some bitter experiences with that myself
 (and that's why I'm writing a book on tag libraries right now - AND Struts
 !). But you must concede that, as in my case,  there are
 environments where
 life is not made to be that easy.

 But you must to concede that, even with tag libraries life don't
 become that
 easier. Reuse is a tricky thing to acquire. You can't reuse too
 much neither
 too few. There are other risks with tags, while components, like component
 super overloading (too few tags that make too MANY things) or component
 superabundancy (too many of them doing ALMOST the same things). Or, as I
 commented, what if the tags just aren't adequate ?

 What I was trying to say there is that the argument must be based
 in all the
 shades of gray, and there's no such thing as "THE TRUE POWER" of Struts in
 rigid application models. As far as I'm concerned, I see the true power of
 Struts in its ability to accommodate all those situations and still
 providing a sound and elegant alternative for each case. It is that what
 seduced me into the project.

 Regarding the article, I see it providing some interesting ideas for a
 problem Struts has: excess of beans we have to code for LARGE
 applications.
 There's no technical argument to break the resistance against a BORING
 procedure (culture ALWAYS breaks technique - we must remember that). I
 provided once a tentative solution creating some tool (FBBuilder - form
 beans builder) to try to figure the beans out automatically.
 Didn't get much
 response (I can understand that). This is another approach,
 generalising the
 bean concept. We will have to figure out something about that problem, and
 this seems to be a good candidate. Regarding the idea of changing
 BeanUtils,
 ok, why not sub-classing it with an AutoBeanUtils class instead ?

 Wellington

   -Original Message-
   From:   Dave Harms [mailto:[EMAIL PROTECTED]]
   Sent:   06 December 2000 03:26
   To: [EMAIL PROTECTED]; Dave Harms
   Subject:Re: Article on JavaWorld

   Wellington,

but...what if the company has only Java programmers as
JSP designers ? Most of these arguments are based on
 cultural more than
technical reasons.

   There are still problems with, for example, scriptlets even
 in a
   situation like this. JSPs are not a particularly
 code-friendly
   environment. And re-use is more difficult. So I think even
 if the Java
   programmers are designing the pages, using scriptlets will
 tend to make
   life more difficult. I think these are sound technical
 objections.

   Dave

   Dave Harms
   [EMAIL PROTECTED]




RE: org.apache.struts.action.MESSAGE exception with orion 1.4

2000-12-06 Thread Douma, Ate

For Orion perform the following steps 

1. remove the org/apache/struts/resources/struts-config_1_0.dtd from the
struts.jar
2. put the dtd under /WEB-INF/classes/org/apache/struts/resources.

Ate Douma

 -Original Message-
 From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 06, 2000 11:05 AM
 To: [EMAIL PROTECTED]; Orion-Interest
 Subject: Re: org.apache.struts.action.MESSAGE exception with orion 1.4
 
 
 Juan Gargiulo wrote:
 
  Did somebody found a work-around for the "Missing 
 resources" problem in
  Orion 1.4?
  I tried several different potential solutions but none of 
 them worked. I
  really need to get struts 1.0 working with Orion 1.4 ASAP.
 
 Me too, please!
 
 klaus
 
 
  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 21, 2000 9:53 AM
  To: [EMAIL PROTECTED]
  Subject: Re: org.apache.struts.action.MESSAGE exception 
 with orion 1.4
  
  
  "Douma, Ate" wrote:
  
  
  The two problems preventing the Struts example (build 
 20001120) to work on
  Orion (1.4.0) can be solved as follows:
  
  1. javax.servlet.jsp.JspException: Missing resources attribute
  org.apache.struts.action.MESSAGE error
  
  The problem is caused by Orion not allowing access on 
 resources (in this
  case a resourcebundle property file) in the 
 WEB-INF/classes folder. It
  
  seems
  
  that the Servlet 2.2 spec. doesn't states clearly if this 
 is allowed or
  
  not;
  
  the Orion team decided to not allow access.
  A simple solution is making the resources available through the
  
  (application
  
  its) classpath.
  By jarring the resources (e.g. the WEB-INF/classes 
 folders) and putting
  
  this
  
  jar in the WEB-INF/lib folder the resources can be found.
  
  I would suggest the Stuts team to implement this solution 
 for the struts
  example as Orion is probably not going to change its 
 behavior in this.
  
  
  
  I would suggest instead that Orion fix their buggy 
 classloader.  This
  particular
  issue has nothing to do with the servlet specification -- 
 Orion is not
  implementing the getResource() method of 
 java.lang.ClassLoader, which is
  used by
  the ResourceBundle classes of the JDK, correctly.
  
  
  2. java.net.MalformedURLException: unknown protocol: jndi
  
  The solution to this problem is given by Olli Pyry yesterday in the
  
  message
  
  with subject: Strugs  Orion  JNDI
  
 From:   Olli Pöyry[SMTP:[EMAIL PROTECTED]]
 Sent:   Tuesday, November 21, 2000 9:51:08 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject:Strugs  Orion  JNDI

 The following error that occurs in ActionServlet's 
 startup with the
  newest
 Struts nightly build and Orion:

 register('-//Apache Software Foundation//DTD Struts 
 Configuration
  1.0//EN',

  
  
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache
 /struts/resour
  
 ces/struts-config_1_0.dtd'
 resolveEntity('-//Apache Software Foundation//DTD 
 Struts Configuration
 1.0//EN',
  
  'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
  
  Resolving to alternate DTD

  
  
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache
 /struts/resour
  
 ces/struts-config_1_0.dtd'

 seems be caused from the following line in 
 ActionServlet.java (about
  line
 881):

 URL url = 
 this.getClass().getResource(registrations[i+1]);

 when this is replaced with:

 URL url =
  getServletContext().getResource(registrations[i+1]);

 the dtd is found and everything works.
 However you have to rebuild struts.jar - but that is easy ant.

 Hope this helps!

 Olli Pyry, Essaim Oy, Helsinki, Finland
  
  As this requires changing the source, I kindly request 
 that the Struts
  development team could fix this also.
  
  
  
  This statement again depends on the container correctly 
 implementing the
  class
  loader they are using for web applications.
  
  My understanding is that Struts has been working fine with 
 previous versions
  of
  Orion.  It sounds like they changed something in the latest 
 code.  If so,
  they
  should change it back.
  
  
  Ate Douma
  
  
  
  Craig McClanahan
  
  
  
  -Original Message-
  From: Kevin Wang [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 20, 2000 6:32 PM
  To: '[EMAIL PROTECTED]'
  Subject: RE: org.apache.struts.action.MESSAGE exception 
 with orion 1.4
  
  Struts 1.0 example (11/15 nightly) is not working on Orion 
 (1.2.9) either.
  It seems something is wrong with 'jndi' as it use jndi to resolve
  'struts-config_1_0.dtd'.
  
  Here is a common exception ...
  
  java.net.MalformedURLException: unknown protocol: jndi
  at
  
 org.apache.struts.digester.Digester.resolveEntity(Digester.java:619)
  at
  
 com.sun.xml.parser.ExternalEntity.getInputSource(ExternalEntit
 y.java:46)
 

RE: form:text hangs, cpu-busy ...

2000-12-06 Thread NESTORS Andris (AC-Creation)

To answer my own question 

This all starts working like magic with Tomcat 3.2 and Sun JDK 1.3.0.

Thanks to all those who helped ...

Andris

# -Original Message-
# From: NESTORS Andris (AC-Creation) 
# Sent: Tuesday, December 05, 2000 4:18 PM
# To: '[EMAIL PROTECTED]'
# Subject: RE: form:text hangs, cpu-busy ...
# 
# 
# Michael, thanks for your help.  Using /form:html under 
# Tomcat 3.1 made no
# difference.  However when I switched from Tomcat 3.1 to 
# Tomcat 3.2, just in
# case, the JSP Compiler complained about exactly this same 
# point.  So ending
# the page with /form:html made the compiler happy.
# 
# Sadly with Tomcat 3.2, after the struts controller servlet 
# has returned a
# valid ActionForward but before I actually get any output from 
# the first line
# of my JSP,  I get a runtime error "java.lang.InternalError: 
# internal error:
# SeedGenerator thread generated an exception".  I am guessing 
# this is to do
# with some combination of my mistake/bug interacting with 
# Tomcat 3.2 and
# Structs.  So I don't yet know if the original form:text 
# problem has gone
# away.  
# 
# Cheers
# Andris
# 
# 
# # -Original Message-
# # From: Michael Gerdau [mailto:[EMAIL PROTECTED]]
# # Sent: Tuesday, December 05, 2000 11:37 AM
# # To: '[EMAIL PROTECTED]'; NESTORS Andris (AC-Creation)
# # Subject: Re: form:text hangs, cpu-busy ...
# # 
# # 
# # Hi Andris !
# # 
# # A bit late (read: you may have found the solution yourself) but
# # I'll write it anyway.
# # 
# # After looking at your code I realize you use
# # form:html
# # 
# # and end it with
# # /html
# # 
# # I'm pretty sure that's not correct.
# # 
# # HTH, best,
# # Michael
# # 
# 



1.0 readiness?

2000-12-06 Thread Laird Nelson

Does anyone (Craig) know when 1.0 will be released?  Craig, are you
holding off for bugfixes or some other piece of functionality?

I'm trying to plan some architectural stuff and want to know whether I
should base my efforts off the head of the trunk or the 0.5 release.

Thanks in advance.

Cheers,
Laird

--
W: [EMAIL PROTECTED] / P: [EMAIL PROTECTED]
http://www.amherst.edu/~ljnelson/
Good, cheap, fast: pick two.



RE: org.apache.struts.action.MESSAGE exception with orion 1.4

2000-12-06 Thread Eyassu, Daniel

FYI:

This approach doesn't work for BEA's Weblogic 5.1.0 server.

-Original Message-
From: Douma, Ate [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 9:11 AM
To: '[EMAIL PROTECTED]'
Subject: RE: org.apache.struts.action.MESSAGE exception with orion 1.4


For Orion perform the following steps 

1. remove the org/apache/struts/resources/struts-config_1_0.dtd from the
struts.jar
2. put the dtd under /WEB-INF/classes/org/apache/struts/resources.

Ate Douma

 -Original Message-
 From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 06, 2000 11:05 AM
 To: [EMAIL PROTECTED]; Orion-Interest
 Subject: Re: org.apache.struts.action.MESSAGE exception with orion 1.4
 
 
 Juan Gargiulo wrote:
 
  Did somebody found a work-around for the "Missing 
 resources" problem in
  Orion 1.4?
  I tried several different potential solutions but none of 
 them worked. I
  really need to get struts 1.0 working with Orion 1.4 ASAP.
 
 Me too, please!
 
 klaus
 
 
  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 21, 2000 9:53 AM
  To: [EMAIL PROTECTED]
  Subject: Re: org.apache.struts.action.MESSAGE exception 
 with orion 1.4
  
  
  "Douma, Ate" wrote:
  
  
  The two problems preventing the Struts example (build 
 20001120) to work on
  Orion (1.4.0) can be solved as follows:
  
  1. javax.servlet.jsp.JspException: Missing resources attribute
  org.apache.struts.action.MESSAGE error
  
  The problem is caused by Orion not allowing access on 
 resources (in this
  case a resourcebundle property file) in the 
 WEB-INF/classes folder. It
  
  seems
  
  that the Servlet 2.2 spec. doesn't states clearly if this 
 is allowed or
  
  not;
  
  the Orion team decided to not allow access.
  A simple solution is making the resources available through the
  
  (application
  
  its) classpath.
  By jarring the resources (e.g. the WEB-INF/classes 
 folders) and putting
  
  this
  
  jar in the WEB-INF/lib folder the resources can be found.
  
  I would suggest the Stuts team to implement this solution 
 for the struts
  example as Orion is probably not going to change its 
 behavior in this.
  
  
  
  I would suggest instead that Orion fix their buggy 
 classloader.  This
  particular
  issue has nothing to do with the servlet specification -- 
 Orion is not
  implementing the getResource() method of 
 java.lang.ClassLoader, which is
  used by
  the ResourceBundle classes of the JDK, correctly.
  
  
  2. java.net.MalformedURLException: unknown protocol: jndi
  
  The solution to this problem is given by Olli Pyry yesterday in the
  
  message
  
  with subject: Strugs  Orion  JNDI
  
 From:   Olli Pöyry[SMTP:[EMAIL PROTECTED]]
 Sent:   Tuesday, November 21, 2000 9:51:08 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject:Strugs  Orion  JNDI

 The following error that occurs in ActionServlet's 
 startup with the
  newest
 Struts nightly build and Orion:

 register('-//Apache Software Foundation//DTD Struts 
 Configuration
  1.0//EN',

  
  
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache
 /struts/resour
  
 ces/struts-config_1_0.dtd'
 resolveEntity('-//Apache Software Foundation//DTD 
 Struts Configuration
 1.0//EN',
  
  'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
  
  Resolving to alternate DTD

  
  
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache
 /struts/resour
  
 ces/struts-config_1_0.dtd'

 seems be caused from the following line in 
 ActionServlet.java (about
  line
 881):

 URL url = 
 this.getClass().getResource(registrations[i+1]);

 when this is replaced with:

 URL url =
  getServletContext().getResource(registrations[i+1]);

 the dtd is found and everything works.
 However you have to rebuild struts.jar - but that is easy ant.

 Hope this helps!

 Olli Pyry, Essaim Oy, Helsinki, Finland
  
  As this requires changing the source, I kindly request 
 that the Struts
  development team could fix this also.
  
  
  
  This statement again depends on the container correctly 
 implementing the
  class
  loader they are using for web applications.
  
  My understanding is that Struts has been working fine with 
 previous versions
  of
  Orion.  It sounds like they changed something in the latest 
 code.  If so,
  they
  should change it back.
  
  
  Ate Douma
  
  
  
  Craig McClanahan
  
  
  
  -Original Message-
  From: Kevin Wang [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 20, 2000 6:32 PM
  To: '[EMAIL PROTECTED]'
  Subject: RE: org.apache.struts.action.MESSAGE exception 
 with orion 1.4
  
  Struts 1.0 example (11/15 nightly) is not working on Orion 
 (1.2.9) either.
  It seems something is wrong with 'jndi' as it use jndi to resolve
  'struts-config_1_0.dtd'.
 

Re: CommandToken

2000-12-06 Thread Robert Leland


William Jaynes wrote:

 If anyone has implemented this I'd like to know how you did it.

This was my first cut at it. I believe I incorrectly tied the
command token and the hidden field for button presses
together. This was written for struts 0.5 but I am sure it will
work with struts 1.0.

I know that Craig is playing around with it and I hope that
at least a simple form of it will appear in struts 1.0 soon.


--
Rob Leland [EMAIL PROTECTED] (+01-202-544-0533)






EJB references

2000-12-06 Thread Boulatian, Misak

Hi Jim and Alex,

I think both of you understood me wrong. I am not planning to access EJBs
from JSP pages at all. I will have a lot of session EJBs to manipulate
Entity EJBs. But, the suggested approach accessing them from servlets was:
- Declare EJB references as private member variables
- in init() of servlet: initialize enterprise naming context, use that
context to call lookup to obtain reference, use reference to call portable
remote object's narrow method (see an example below)

BEGIN EXAMPLE
public class myservlet extends HttpServlet throws ... {
private CustomerHome m_home;

public void init() ... {
try {
  Properties p = new Properties();
  // ... specify some JNDI properties specific to the vendor
  Context jndicontext = new javax.naming.InitialContext (p);
  Object ref = jndicontext.lookup("CustomerHome");
   m_home = (CustomerHome) PortableRemoteObject.narrow(ref,
CustomerHome.class);
   
} catch ... {
}
END EXAMPLE

Then you hold on to m_home reference and reuse it in each thread that
accesses your servlet. So, my question was, since I am going to have many
m_home(s) like this what should I do? If I put those in each action class
then every single time I am going to do above procedure (very resource
consuming). Or, should I create private member variables in action classes
and hold on to those home references? As Craig recommended, to create a
startup servlet and initialize those in there. But, how am I going to make
all of those availbe to action classes (If this is very simple, pardon my
knowledge. I am new to using EJBs)? 

If you can give me some more ideas I really appreciated it.
Thanks,
Misak

--Original Message-
-From: Alix Jermyn

Jim is quite right, you should be able to remove references to EJB
structures, even from the the Action Servlets themselves.  I have had some
EJB experience, but am new to struts, but one of the nice things about
struts is its abilty to isolate most of the presentation logic from the
business and backend logic.  You should be able to design the struts sides
of things without knowing about how your data will be managed in the
backend, allowing you to plug in an EJB solution, direct JDBC calls, LDAP
etc modules.   

Most of the backend logic should be accessed within the Action classes,
which will have generic data methods, which in turn access the actual data
access classes you decide to go with.  You will have a few(one)
application/session/request context web tier controller classes which know
how to deal with the EJB tier objects. I have found it cleaner/easier to
have the web tier controller(s) talk to a sesssion bean controller object in
the EJB tier which in turn deals with the necessary session and entity beans
needed to actually manipulate your data, and like Jim, would be wary of
using too many entity beans, which have a relatively heavy overhead.



--Original Message-
-From: Jim Richards [mailto:[EMAIL PROTECTED]]
-
-I'll be using ELB's for my application when I start building it
-in a few weeks time (still in the design stage). I expect to
-be using only EJBs from a action servlet, that are session
-beans, and those session beans use entity beans. From previous
-work I found there was too much overhead using the entity beans
-directly in the generation of a html page, and you rarely
-needed that direct conncetion to the database anyway.
-
-As for the references, I'm not sure what you mean. I'll be putting
-things like the JNDI and connection information into to web.xml
-as startup parameters.
-
-"Boulatian, Misak" wrote:
- 
- Hi all,
- 
- The application we design is quite large. I am still trying 
-to figure out
- the question on EJB references. From the Craig Mcc.'s 
-comment I could put
- those in one startup servlet. Is it a viable solution? I am 
-going to have
- many session references. Where am I going to store those 
-references (in
- servlet context)? How can I make those available to action 
-classes? Or I can
- put only the handle in the servlet context and call lookup 
-in every action
- class (any scalability problems with this approach?). I 
-cannot believe that
- none of you worked in large applications and will not be 
-using EJBs for
- business logic and did not go over this kind of issue.
- 
- I appreciate response,
- Misak Boulatian
-






Example for Internationalization

2000-12-06 Thread Aditya Kapur

Hi All,
I was building some prototype for my company and I have modified the Struts
out-of-box example to add a language drop down on the Login page (which just
displays English and German) and if the user logs in after selecting the
language as German all the screens are in German.

If anybody is interested I can post the modified example and the code.

Aditya Kapur
Office (248) 699 3275






Sruts Mailing List Archive

2000-12-06 Thread Evan Vaala

Is there a Struts Mailing List Archive somewhere?

Thanks!

Evan Vaala



RE: Example for Internationalization

2000-12-06 Thread Vilavanh Messien

Hi,
I'm quite interested in your example.
Can you post me your code ?

Thanks

-Message d'origine-
De : Aditya Kapur [mailto:[EMAIL PROTECTED]]
Envoyé : 6 décembre, 2000 12:22
À : Struts-User (E-mail)
Objet : Example for Internationalization


Hi All,
I was building some prototype for my company and I have modified the Struts
out-of-box example to add a language drop down on the Login page (which just
displays English and German) and if the user logs in after selecting the
language as German all the screens are in German.

If anybody is interested I can post the modified example and the code.

Aditya Kapur
Office (248) 699 3275






Re: Sruts Mailing List Archive

2000-12-06 Thread Jeff Winkler

http://archive.covalent.net/ has struts-dev, struts-user and many more.
Jeff

- Original Message - 
From: "Evan Vaala" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, December 06, 2000 12:38 PM
Subject: Sruts Mailing List Archive


 Is there a Struts Mailing List Archive somewhere?
 
 Thanks!
 
 Evan Vaala




Re: Example for Internationalization

2000-12-06 Thread Deping Chian

Aditya Kapur,

Please do post your example, as least to my email account if you prefer. I
have tried this i18n issue and was stuck somewhere, and regreted that I
don't see an adequate  example to start with.

Thanks,

Deping


- Original Message -
From: "Aditya Kapur" [EMAIL PROTECTED]
To: "Struts-User (E-mail)" [EMAIL PROTECTED]
Sent: Wednesday, December 06, 2000 3:21 PM
Subject: Example for Internationalization


 Hi All,
 I was building some prototype for my company and I have modified the
Struts
 out-of-box example to add a language drop down on the Login page (which
just
 displays English and German) and if the user logs in after selecting the
 language as German all the screens are in German.

 If anybody is interested I can post the modified example and the code.

 Aditya Kapur
 Office (248) 699 3275








Rewriting the URL in a form:form action

2000-12-06 Thread Erik Horstkotte

I've got a system with a large number of JSPs that I'm developing
using Tomcat 3.2 and Struts 1.0 (12/4 nightly build). Because of the
large number of files, I've started organizing the them in
subdirectories. This has caused me to run into a problem, however.
There doesn't appear to be any way to cause the URL in a form:form
tag's "action" parameter to be rewritten using the webapp's context
path. As a result, if I use an action="x", it directs the action to
x in the current directory, which in my case isn't what I want. If I
use an action="/x", it directs the action to the x in the web server's
root directory - not the root of my webapp context, which is what I
want.

I tried embedding form:rewrite page="x" inside the action= of the
form:form, but predictably that does not make jasper happy at all:
"Attribute  has no value" - note the empty attribute name in the
message.

Does anyone have ideas on how to make this fly, or do I simply have to
go back to a flat directory structure?

-- Erik





Struts and JRun

2000-12-06 Thread Matthew Heaton

What are peoples experiences running Struts on the JRun application server?
Does it work, is there any major bugs?

-Matt



RE: Struts+Weblogic+WARs

2000-12-06 Thread Jeff Klein

Andre,

I am running into the exact same situation as you described in your original
post, so I was excited to see the solution.  However, when I tried it, I get
a NullPointerException when I startup weblogic.

Wed Dec 06 12:13:12 PST 2000:E WebLogicServer Failed to invoke startup
class strutsAppStartup=WebAppStartup
java.lang.NullPointerException
at WebAppStartup.startup(WebAppStartup.java, Compiled Code)
at weblogic.t3.srvr.StartupThread.runStartup(StartupThread.java:182)
at weblogic.t3.srvr.StartupThread.doWork(StartupThread.java,
Compiled Code)
at
weblogic.t3.srvr.PropertyExecuteThread.run(PropertyExecuteThread.java:62)

My properties files has these properties:
weblogic.system.startupClass.strutsAppStartup=WebAppStartup
weblogic.system.startupArgs.strutsAppStartup=webAppContext= 

It acts as if WebAppStartup cannot live without the context path.  Did you
experience this?

TIA,
Jeff



-Original Message-
From: Andre Wittenburg [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 6:12 AM
To: '[EMAIL PROTECTED]'
Subject: AW: Struts+Weblogic+WARs


Sorry, for this question...

the solution is: 
weblogic.system.startupClass.myStartup=WebAppStartup
weblogic.system.startupArgs.myStartup=webAppContext=

Just leave the argument empty stupid ...

Sorry
Andre


 -Ursprüngliche Nachricht-
 Von:  Andre Wittenburg [SMTP:[EMAIL PROTECTED]]
 Gesendet am:  Mittwoch, 6. Dezember 2000 13:45
 An:   '[EMAIL PROTECTED]'
 Betreff:  Struts+Weblogic+WARs
 
 Hi!
 
 I'm using weblogic(sp6) with Struts and the WebAppStartup class, which was
 posted in the struts-user list.
 
 My problem is, that i want to use the weblogic property
 "weblogic.httpd.defaultWebApp", so my problems with the context path would
 vanish (and i would like to have this webApp in the root of the server).
 But
 unfortunately the WebAppStartup.class needs as a parameter the virtualName
 of the webApp, which does not exist...
 
 The source of WebAppStartup uses "ServletContextImpl servletcontextimpl =
 servletcontextmanager.getContext(s1);" to find the jsp pages which should
 be
 precompiled. Unfortunately the servletcontexmanager is not documented in
 the
 API-Doc, so i need some advise here
 
 Any hints? Sorry, if this is wrong mailing list, but i found the source of
 WebAppStartup here and it seems that there more weblogic users.
 
 Thanx
 Andre



RE: Example for Internationalization

2000-12-06 Thread Boulatian, Misak

Hi,
I am interested as well.
Can you post it to my email?
Thanks
Misak Boulatian
[EMAIL PROTECTED]

-Original Message-
From: Aditya Kapur [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 9:22 AM
To: Struts-User (E-mail)
Subject: Example for Internationalization


Hi All,
I was building some prototype for my company and I have modified the Struts
out-of-box example to add a language drop down on the Login page (which just
displays English and German) and if the user logs in after selecting the
language as German all the screens are in German.

If anybody is interested I can post the modified example and the code.

Aditya Kapur
Office (248) 699 3275





RE: org.apache.struts.action.MESSAGE exception

2000-12-06 Thread Boulatian, Misak

FYI:

I am using Persistence PowerTier 6.51 I also get the same problem. If
somebody have any answers please let me know.

thanks,
misak

FYI:

This approach doesn't work for BEA's Weblogic 5.1.0 server.

-Original Message-
From: Douma, Ate [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 06, 2000 9:11 AM
To: '[EMAIL PROTECTED]'
Subject: RE: org.apache.struts.action.MESSAGE exception with orion 1.4


For Orion perform the following steps 

1. remove the org/apache/struts/resources/struts-config_1_0.dtd from the
struts.jar
2. put the dtd under /WEB-INF/classes/org/apache/struts/resources.

Ate Douma

 -Original Message-
 From: Klaus Thiele [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 06, 2000 11:05 AM
 To: [EMAIL PROTECTED]; Orion-Interest
 Subject: Re: org.apache.struts.action.MESSAGE exception with orion 1.4
 
 
 Juan Gargiulo wrote:
 
  Did somebody found a work-around for the "Missing 
 resources" problem in
  Orion 1.4?
  I tried several different potential solutions but none of 
 them worked. I
  really need to get struts 1.0 working with Orion 1.4 ASAP.
 
 Me too, please!
 
 klaus
 
 
  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 21, 2000 9:53 AM
  To: [EMAIL PROTECTED]
  Subject: Re: org.apache.struts.action.MESSAGE exception 
 with orion 1.4
  
  
  "Douma, Ate" wrote:
  
  
  The two problems preventing the Struts example (build 
 20001120) to work on
  Orion (1.4.0) can be solved as follows:
  
  1. javax.servlet.jsp.JspException: Missing resources attribute
  org.apache.struts.action.MESSAGE error
  
  The problem is caused by Orion not allowing access on 
 resources (in this
  case a resourcebundle property file) in the 
 WEB-INF/classes folder. It
  
  seems
  
  that the Servlet 2.2 spec. doesn't states clearly if this 
 is allowed or
  
  not;
  
  the Orion team decided to not allow access.
  A simple solution is making the resources available through the
  
  (application
  
  its) classpath.
  By jarring the resources (e.g. the WEB-INF/classes 
 folders) and putting
  
  this
  
  jar in the WEB-INF/lib folder the resources can be found.
  
  I would suggest the Stuts team to implement this solution 
 for the struts
  example as Orion is probably not going to change its 
 behavior in this.
  
  
  
  I would suggest instead that Orion fix their buggy 
 classloader.  This
  particular
  issue has nothing to do with the servlet specification -- 
 Orion is not
  implementing the getResource() method of 
 java.lang.ClassLoader, which is
  used by
  the ResourceBundle classes of the JDK, correctly.
  
  
  2. java.net.MalformedURLException: unknown protocol: jndi
  
  The solution to this problem is given by Olli Pyry yesterday in the
  
  message
  
  with subject: Strugs  Orion  JNDI
  
 From:   Olli Pöyry[SMTP:[EMAIL PROTECTED]]
 Sent:   Tuesday, November 21, 2000 9:51:08 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject:Strugs  Orion  JNDI

 The following error that occurs in ActionServlet's 
 startup with the
  newest
 Struts nightly build and Orion:

 register('-//Apache Software Foundation//DTD Struts 
 Configuration
  1.0//EN',

  
  
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache
 /struts/resour
  
 ces/struts-config_1_0.dtd'
 resolveEntity('-//Apache Software Foundation//DTD 
 Struts Configuration
 1.0//EN',
  
  'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
  
  Resolving to alternate DTD

  
  
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache
 /struts/resour
  
 ces/struts-config_1_0.dtd'

 seems be caused from the following line in 
 ActionServlet.java (about
  line
 881):

 URL url = 
 this.getClass().getResource(registrations[i+1]);

 when this is replaced with:

 URL url =
  getServletContext().getResource(registrations[i+1]);

 the dtd is found and everything works.
 However you have to rebuild struts.jar - but that is easy ant.

 Hope this helps!

 Olli Pyry, Essaim Oy, Helsinki, Finland
  
  As this requires changing the source, I kindly request 
 that the Struts
  development team could fix this also.
  
  
  
  This statement again depends on the container correctly 
 implementing the
  class
  loader they are using for web applications.
  
  My understanding is that Struts has been working fine with 
 previous versions
  of
  Orion.  It sounds like they changed something in the latest 
 code.  If so,
  they
  should change it back.
  
  
  Ate Douma
  
  
  
  Craig McClanahan
  
  
  
  -Original Message-
  From: Kevin Wang [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 20, 2000 6:32 PM
  To: '[EMAIL PROTECTED]'
  Subject: RE: org.apache.struts.action.MESSAGE exception 
 with orion 1.4
  
  Struts 1.0 example (11/15 nightly) 

RE: Rewriting the URL in a form:form action

2000-12-06 Thread Colin Sampaleanu

The action parameter can handle a runtime expression, so you should be able
to build a custom value in there that includes the context path...

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 Sent: December 6, 2000 2:48 PM
 To: [EMAIL PROTECTED]
 Subject: Rewriting the URL in a form:form action
 
 I've got a system with a large number of JSPs that I'm developing
 using Tomcat 3.2 and Struts 1.0 (12/4 nightly build). Because of the
 large number of files, I've started organizing the them in
 subdirectories. This has caused me to run into a problem, however.
 There doesn't appear to be any way to cause the URL in a form:form
 tag's "action" parameter to be rewritten using the webapp's context
 path. As a result, if I use an action="x", it directs the action to
 x in the current directory, which in my case isn't what I want. If I
 use an action="/x", it directs the action to the x in the web server's
 root directory - not the root of my webapp context, which is what I
 want.
 
 I tried embedding form:rewrite page="x" inside the action= of the
 form:form, but predictably that does not make jasper happy at all:
 "Attribute  has no value" - note the empty attribute name in the
 message.
 
 Does anyone have ideas on how to make this fly, or do I simply have to
 go back to a flat directory structure?
 
 -- Erik
 
 



Re: EJB references

2000-12-06 Thread Jim Richards


You probably need to create a helper class that does all this work, 
keeps the references as public variables and create it as a singleton in
the init of the servlet, and store it as an application wide variable
so you can access it easily and have references to all the session beans.

I can't remember the deal though with synchronisation and EJBs, you
had better check on that as there will be a high possibility of 
multiple threads (servlets) accessing it at the same time.

At 08:37 AM 6/12/00 -0800, you wrote:
Hi Jim and Alex,

I think both of you understood me wrong. I am not planning to access EJBs
from JSP pages at all. I will have a lot of session EJBs to manipulate
Entity EJBs. But, the suggested approach accessing them from servlets was:

[snip ...]
--
Kumera - a new Open Source Content Management System
for small to medium web sites written in Perl and using XML
http://www.cyber4.org/kumera/index.html



Re: Example for Internationalization

2000-12-06 Thread Michael Westbay

Kapur-san wrote:

 I was building some prototype for my company and I have modified the Struts
 out-of-box example to add a language drop down on the Login page (which just
 displays English and German) and if the user logs in after selecting the
 language as German all the screens are in German.
 
 If anybody is interested I can post the modified example and the code.

I think a lot of people are interested.  Perhaps it would be best to put the
.war file up on a web site that it can be downloaded from, then send the
URL to the list.  Anyone who wants it can get it from there.  Those who don't
won't lose the bandwidth.

If you don't have an extronet site to place it on, I'd be more than happy to
put it up for you.

--
Michael Westbay
Work: Beacon-IT http://www.beacon-it.co.jp/
Home:   http://www.seaple.icc.ne.jp/~westbay
Commentary: http://www.japanesebaseball.com/



RE: A form with valiable number of beans

2000-12-06 Thread Oliphant, Geoff
Title: RE: A form with valiable number of beans





Lars,


I assume you're trying to generate unique text names for each object of your 
bean that you are iterating through.


We haven't used the struts:text tags because of this, we use the normal html
input tag but use the struts htmlProperty tag to get the data out:


struts:iterate id=order name=currentOrderBean property=orderLines
input type=text 
 name=TXTstruts:htmlProperty name=order property=orderNumber/ 
 maxlength=6 
 size=6 
 value=struts:htmlProperty name=order property=orderValue/


/struts:iterate


This will replace the values of the orderNumber and orderValue in the 
JSP when it is generated and voila - uniquely named text boxes.


If you submit the form then you just have to get the parameters out of
the request that start with TXT and you've got your primary keys.


Hope this helps.


Geoff


-Original Message-
From: Lars [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, 6 December 2000 17:55
To: [EMAIL PROTECTED]
Subject: A form with valiable number of beans



I am trying to use Struts to create a page where I am editing an Entity
(e.g. an order) and a variable number of sub-entities (e.g. order lines). I
have corresponding beans in my session (an Order bean with a vector holding
a number of OrderLine beans).


I would like to have certain properties of all sub-entities open for editing
and the page being recreated with all the values if it is submitted and the
displayed again.


How could I use the ActionForm and the tag-library to be able to use the
automatic population of the properties of the form bean?


I have tried to use the logic:iterate tag to build the list of order lines
but stumbled on the naming of each text field. For example, the quantities
field would have to be named quantity1, quantity2, etc. If I use the
form:text tag I can specify the bean and the property, but this gives me an
identical name for all quantity fields. Even if I manage to uniquely name
the fields, how can I create an ActionForm with corresponding properties to
be set by the framework.


Maybe I have to do this manually? Any suggestions how?


If this has been discussed before, please point me to an approximate time
frame.


Regards,
Lars Andersson







 IMPORTANT INFORMATION

This message and any files transmitted with it are confidential and should be read only by those
persons to whom it is addressed.   
If you have received this message in error, please notify us immediately by way of reply. Please
also destroy and delete the message from your computer. Any unauthorised form of reproduction
of this message is strictly prohibited.

It is the duty of the recipient to virus scan and otherwise test the information provided before
loading onto any computer system.  
SEALCORP does not warrant that the information is free of a virus or any other defect or error.

SEALCORP is not liable for the proper and complete transmission of the information contained in
this communication, nor for any delay in its receipt.

Any views expressed in this message are those of the individual sender, except where the sender
specifically states them to be the views of SEALCORP.





Java Report Struts Article (was Re: Article on JavaWorld)

2000-12-06 Thread David Geary

Ted Husted wrote:

 Anyone have other struts article or powered by references?

The November issue of Java Report has an article on Struts that focuses
on Struts MVC.

The article's code is a little out of date, due to all of the changes that
have
occurred since the article was written.


david




Mildly complex bean:message situation

2000-12-06 Thread Erik Horstkotte

Hi all.

I'm working on a moderately large webapp based on Struts 1.0 (nightly
build from 12/4), and I've run into a situation I can't figure out how
to handle cleanly using bean:message.

What I have is a sentance in which only some words are hyperlinked to
other pages within the app. The sentance has to be localizable, and
the hyperlink potentially needs to be rewritten to include the webapp
context path and session id.

The problem, of course, is that

bean:message key="foo" arg="uri"

won't work, because I can't use form:rewrite for the uri arg.

Any ideas?

Also, how do you experts handle the issue of localizable messages
involving a count, as in

  There are {0} messages waiting.

If {0} is zero, I'd like it to read

  There are 0 messages waiting.

If {0} is one, I'd like it to read

  There is 1 message waiting.

If {0} is two or greater, I'd like it to read

  There are n messages waiting.

Do I *have* to break down and use a scriplet just to pick the right
message from the bundle, one for n=1 and one for the other cases? Are
there going to be problems with that approach in other languages (I
would think so)? Should I be constructing this particular piece of text
in the preceding Action class, and passing it as a session or request
attribute?

What's your approach to this cases?

-- Erik





Re: Mildly complex bean:message situation

2000-12-06 Thread Pierre Mtras

Hi Erik,

 Also, how do you experts handle the issue of localizable messages
 involving a count, as in

   There are {0} messages waiting.

 If {0} is zero, I'd like it to read

   There are 0 messages waiting.

 If {0} is one, I'd like it to read

   There is 1 message waiting.

 If {0} is two or greater, I'd like it to read

   There are n messages waiting.

 Do I *have* to break down and use a scriplet just to pick the right
 message from the bundle, one for n=1 and one for the other cases? Are
 there going to be problems with that approach in other languages (I
 would think so)? Should I be constructing this particular piece of text
 in the preceding Action class, and passing it as a session or request
 attribute?

Message formatting goes through java.text.MessageFormat calls. You gain
access to all the formatting power of messages resources, like conditional
formats...
Instead of a cut and paste from the javadoc, have a look at
http://java.sun.com/j2se/1.3/docs/api/java/text/MessageFormat.html where
there's an example that you can apply to your problem. And perhaps you'll be
able to solve the first one, too.

Pierre Métras






I18n In Struts

2000-12-06 Thread Greg Murray

Greetings,

I am relatively new to this alias but not to the struts paradigm. I did much of the 
work on the Java Petstore Demo web tier
where
we in the past have used a very similar architecture. Prior to doing the Java Petstore 
I working in the Sun Global Products
engineering
group where I wrote internationalization tools.

Regarding Internationalization. I believe much of this can be done through a 
templating mechanism. In Petstore we use a very
similar
templating mechanism to struts which allows us to define virtual screen names which 
are mapped to xml based screen definitions

in separate files (one per language).  In struts this would be mapping the forward 
page to a forward screen name (a screen is
composed of all the elements (JSP pages and included text) which make up a single view 
that a user would see. The screen
definitions are  defined in xml and is encoded in Unicode which allows us to do much 
of the localization by either including a
separate file or including the localized text directly. In this model we have one 
screen definitions for each language. To add
another language the developer need only add another screen definition file along with 
the JSP pages that require full
translation. Each language will also have its own template which is specified in the 
screen definitions file. This model also
supports partial localization in that you can translate individual elements that make 
up a page. The user can change language
on the fly using an action.

We have a working localized version of this in the Java Petstore Demo 1.1.1 located at 
http://java.sun.com/j2ee/download.html.

Though the demo is not pure struts (yet) I believe this same methodology may be 
beneficial in struts. I encourage feedback and
comments on this method of internationalization/localization using templates.

regards,

greg




Re: Rewriting the URL in a form:form action

2000-12-06 Thread Michael Westbay

I had suggested:

 form:form action="%= request.getContextPath() %/x"

as a possible solution to the form URI getting the context
problem.  But in another thread, Richards-san pointed out
(asked?):

 And although we can so things within % % tags, it is not
 preferred?

So, I guess that the politically correct way would be to
extend the form tag to take an attribute like:

form:form action="/x" usecontextpath="true"

Wasn't something like this brought up with another tag ealier?

--
Michael Westbay
Work: Beacon-IT http://www.beacon-it.co.jp/
Home:   http://www.seaple.icc.ne.jp/~westbay
Commentary: http://www.japanesebaseball.com/



Re: design question

2000-12-06 Thread David Geary

Jim Richards wrote:

 As I understand it, is the basic design of struts generally to avoid
 any direct java code in the .jsp files, and do everything through tags?

Tags and beans, yes.

 And although we can so things within % % tags, it is not
 preferred?

That's the conventional wisdom; however, IMHO it's sometimes
permissible to use scriplets. Consider this JSP page:

%
   java.util.Enumeration e = request.getParameterNames();
   boolean hasParams = false;

   while(e.hasMoreElements()) {
  String name = (String)e.nextElement();
  String[] values = request.getParameterValues(name);

  hasParams = true;

  for(int i=0; i  values.length; ++i) {
 String next = values[i];
 if(i == 0) { %
b%= name %:/b %= next %
%   }
 else { %
, %= next %
%   }
   } %
% }
   if(!hasParams) { %
  iNo parameters with this request/i
% } %

The JSP page listed above prints request parameters, which is useful for
debugging. I refer to JSP pages that are mostly scriptlets with a small
amount of HTML sprinkled throughout as JSP components, for lack of a better
term. In such cases, I believe scriptlets are just fine.

Of course, the functionality in the JSP page listed above could be
implemented as a custom tag. Whether you implement JSP pages or custom tags
is largely a matter of taste. Custom tags are a little more difficult to
develop, but they are easier for page authors to use. JSP components are
easier to develop, but they are a little more difficult for page authors to
use because they must be included.

 Just wondering before I embark on my project, if it's worth including the
 design of any extra tags, or just doing the things I want in % % ...

The bottom line is twofold: reuse and division of labor. You can't reuse
scriptlets buried in a JSP page, but you can reuse custom tags or JSP
components. If you're on a large project with software developers and page
authors, ideally you'd like the page authors to use tags implemented by
developers. This helps maintain a division of labor where software developers
and page authors can work in parallel, with few dependencies.


david




Re: design question

2000-12-06 Thread Wong Kok Wai

One issue not really discussed is the performance
aspect of using tags. Looking at the generated Java
source from a JSP, a single tag can be expanded into 5
or more lines of Java code. For a simple tag like
"ifNull", I would think using scriptlets with a if
statement will lead to better performance (although
I've NOT done any timing measurement).

Just my two cents.

--- David Geary [EMAIL PROTECTED] wrote:
 Of course, the functionality in the JSP page listed
 above could be
 implemented as a custom tag. Whether you implement
 JSP pages or custom tags
 is largely a matter of taste. Custom tags are a
 little more difficult to
 develop, but they are easier for page authors to
 use. JSP components are
 easier to develop, but they are a little more
 difficult for page authors to
 use because they must be included.
 
  Just wondering before I embark on my project, if
 it's worth including the
  design of any extra tags, or just doing the things
 I want in % % ...
 
 The bottom line is twofold: reuse and division of
 labor. You can't reuse
 scriptlets buried in a JSP page, but you can reuse
 custom tags or JSP
 components. If you're on a large project with
 software developers and page
 authors, ideally you'd like the page authors to use
 tags implemented by
 developers. This helps maintain a division of labor
 where software developers
 and page authors can work in parallel, with few
 dependencies.
 
 
 david
 


__
Do You Yahoo!?
Yahoo! Shopping - Thousands of Stores. Millions of Products.
http://shopping.yahoo.com/



Re: org.apache.struts.action.MESSAGE exception with orion 1.4

2000-12-06 Thread MacGill

G'Day

I am also working with Struts 1.0 and Orion 1.4 and having problems.

The main thing that I have realised is that
org.apache.struts.action.MESSAGE is the default web browser error for struts.

To know what is going on in more detail I suggest studying
orion\log\global-application.log

So far I have over come some of the errors by placing struts.jar in orion\lib
and the ApplicationResources.properties file in orion\lib under the directory
set in struts-config.xml

My current stumbling block in reading the struts-config_1_0.dtd
I have tried all the suggestions on this mailing list but so far have had no
success.

MacGill

Juan Gargiulo wrote:

 Did somebody found a work-around for the "Missing resources" problem in
 Orion 1.4?
 I tried several different potential solutions but none of them worked. I
 really need to get struts 1.0 working with Orion 1.4 ASAP.

 Thank you in advance,

 juan

 -Original Message-
 From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 21, 2000 9:53 AM
 To: [EMAIL PROTECTED]
 Subject: Re: org.apache.struts.action.MESSAGE exception with orion 1.4

 "Douma, Ate" wrote:

  The two problems preventing the Struts example (build 20001120) to work on
  Orion (1.4.0) can be solved as follows:
 
  1. javax.servlet.jsp.JspException: Missing resources attribute
  org.apache.struts.action.MESSAGE error
 
  The problem is caused by Orion not allowing access on resources (in this
  case a resourcebundle property file) in the WEB-INF/classes folder. It
 seems
  that the Servlet 2.2 spec. doesn't states clearly if this is allowed or
 not;
  the Orion team decided to not allow access.
  A simple solution is making the resources available through the
 (application
  its) classpath.
  By jarring the resources (e.g. the WEB-INF/classes folders) and putting
 this
  jar in the WEB-INF/lib folder the resources can be found.
 
  I would suggest the Stuts team to implement this solution for the struts
  example as Orion is probably not going to change its behavior in this.
 

 I would suggest instead that Orion fix their buggy classloader.  This
 particular
 issue has nothing to do with the servlet specification -- Orion is not
 implementing the getResource() method of java.lang.ClassLoader, which is
 used by
 the ResourceBundle classes of the JDK, correctly.

 
  2. java.net.MalformedURLException: unknown protocol: jndi
 
  The solution to this problem is given by Olli Pyry yesterday in the
 message
  with subject: Strugs  Orion  JNDI
 
 From:   Olli Pöyry[SMTP:[EMAIL PROTECTED]]
 Sent:   Tuesday, November 21, 2000 9:51:08 AM
 To: [EMAIL PROTECTED]
 Cc: [EMAIL PROTECTED]
 Subject:Strugs  Orion  JNDI

 The following error that occurs in ActionServlet's startup with the
  newest
 Struts nightly build and Orion:

 register('-//Apache Software Foundation//DTD Struts Configuration
  1.0//EN',

 
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache/struts/resour
 ces/struts-config_1_0.dtd'
 resolveEntity('-//Apache Software Foundation//DTD Struts Configuration
 1.0//EN',
 'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
  Resolving to alternate DTD

 
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache/struts/resour
 ces/struts-config_1_0.dtd'

 seems be caused from the following line in ActionServlet.java (about
  line
 881):

 URL url = this.getClass().getResource(registrations[i+1]);

 when this is replaced with:

 URL url =
  getServletContext().getResource(registrations[i+1]);

 the dtd is found and everything works.
 However you have to rebuild struts.jar - but that is easy ant.

 Hope this helps!

 Olli Pyry, Essaim Oy, Helsinki, Finland
 
  As this requires changing the source, I kindly request that the Struts
  development team could fix this also.
 

 This statement again depends on the container correctly implementing the
 class
 loader they are using for web applications.

 My understanding is that Struts has been working fine with previous versions
 of
 Orion.  It sounds like they changed something in the latest code.  If so,
 they
 should change it back.

 
  Ate Douma
 

 Craig McClanahan

 
  -Original Message-
  From: Kevin Wang [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 20, 2000 6:32 PM
  To: '[EMAIL PROTECTED]'
  Subject: RE: org.apache.struts.action.MESSAGE exception with orion 1.4
 
  Struts 1.0 example (11/15 nightly) is not working on Orion (1.2.9) either.
  It seems something is wrong with 'jndi' as it use jndi to resolve
  'struts-config_1_0.dtd'.
 
  Here is a common exception ...
 
  java.net.MalformedURLException: unknown protocol: jndi
  at
  org.apache.struts.digester.Digester.resolveEntity(Digester.java:619)
  at
  com.sun.xml.parser.ExternalEntity.getInputSource(ExternalEntity.java:46)

Struts Articles

2000-12-06 Thread Ted Husted

Here's more about the other Struts article on InformIT. 

"In this seven-part series, Java expert Maneesh Sahu explores how to
use Apache Software Foundation's Struts framework to develop a
Web-based message board"


http://www.informit.com/content/index.asp?product_id={912CB006-A3CE-4CCF
-B994-7ECFFD04E9D6} 

Thanks to Jeff Wrinkler for pointing me to the InformIT article! (More
than a little hard to find)



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





RE: org.apache.struts.action.MESSAGE exception with orion 1.4

2000-12-06 Thread Juan Gargiulo

I finally got it working by removing struts-config_1_0.dtd from the
struts.jar file. And locating this file under:
\WEB-INF\classes\org\apache\struts\resources\

Also, instead of placing the ApplicationResources.properties file under
orion\lib, you can jar it and place it under \WEB-INF\lib

hope this helps,

juan

 -Original Message-
 From: MacGill [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, December 06, 2000 10:04 PM
 To: [EMAIL PROTECTED]
 Subject: Re: org.apache.struts.action.MESSAGE exception with orion 1.4


 G'Day

 I am also working with Struts 1.0 and Orion 1.4 and having problems.

 The main thing that I have realised is that
 org.apache.struts.action.MESSAGE is the default web browser error
 for struts.

 To know what is going on in more detail I suggest studying
 orion\log\global-application.log

 So far I have over come some of the errors by placing struts.jar
 in orion\lib
 and the ApplicationResources.properties file in orion\lib under
 the directory
 set in struts-config.xml

 My current stumbling block in reading the struts-config_1_0.dtd
 I have tried all the suggestions on this mailing list but so far
 have had no
 success.

 MacGill

 Juan Gargiulo wrote:

  Did somebody found a work-around for the "Missing resources" problem in
  Orion 1.4?
  I tried several different potential solutions but none of them worked. I
  really need to get struts 1.0 working with Orion 1.4 ASAP.
 
  Thank you in advance,
 
  juan
 
  -Original Message-
  From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 21, 2000 9:53 AM
  To: [EMAIL PROTECTED]
  Subject: Re: org.apache.struts.action.MESSAGE exception with orion 1.4
 
  "Douma, Ate" wrote:
 
   The two problems preventing the Struts example (build
 20001120) to work on
   Orion (1.4.0) can be solved as follows:
  
   1. javax.servlet.jsp.JspException: Missing resources attribute
   org.apache.struts.action.MESSAGE error
  
   The problem is caused by Orion not allowing access on
 resources (in this
   case a resourcebundle property file) in the WEB-INF/classes folder. It
  seems
   that the Servlet 2.2 spec. doesn't states clearly if this is
 allowed or
  not;
   the Orion team decided to not allow access.
   A simple solution is making the resources available through the
  (application
   its) classpath.
   By jarring the resources (e.g. the WEB-INF/classes folders)
 and putting
  this
   jar in the WEB-INF/lib folder the resources can be found.
  
   I would suggest the Stuts team to implement this solution for
 the struts
   example as Orion is probably not going to change its behavior in this.
  
 
  I would suggest instead that Orion fix their buggy classloader.  This
  particular
  issue has nothing to do with the servlet specification -- Orion is not
  implementing the getResource() method of java.lang.ClassLoader, which is
  used by
  the ResourceBundle classes of the JDK, correctly.
 
  
   2. java.net.MalformedURLException: unknown protocol: jndi
  
   The solution to this problem is given by Olli Pyry yesterday in the
  message
   with subject: Strugs  Orion  JNDI
  
  From:   Olli Pöyry[SMTP:[EMAIL PROTECTED]]
  Sent:   Tuesday, November 21, 2000 9:51:08 AM
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject:Strugs  Orion  JNDI
 
  The following error that occurs in ActionServlet's
 startup with the
   newest
  Struts nightly build and Orion:
 
  register('-//Apache Software Foundation//DTD Struts Configuration
   1.0//EN',
 
  
 
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache/str
 uts/resour
  ces/struts-config_1_0.dtd'
  resolveEntity('-//Apache Software Foundation//DTD Struts
 Configuration
  1.0//EN',
  'http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd')
   Resolving to alternate DTD
 
  
 
 'jndi:/home/jblum/web/struts/WEB-INF/lib/struts.jar/org/apache/str
 uts/resour
  ces/struts-config_1_0.dtd'
 
  seems be caused from the following line in
 ActionServlet.java (about
   line
  881):
 
  URL url =
 this.getClass().getResource(registrations[i+1]);
 
  when this is replaced with:
 
  URL url =
   getServletContext().getResource(registrations[i+1]);
 
  the dtd is found and everything works.
  However you have to rebuild struts.jar - but that is easy ant.
 
  Hope this helps!
 
  Olli Pyry, Essaim Oy, Helsinki, Finland
  
   As this requires changing the source, I kindly request that the Struts
   development team could fix this also.
  
 
  This statement again depends on the container correctly implementing the
  class
  loader they are using for web applications.
 
  My understanding is that Struts has been working fine with
 previous versions
  of
  Orion.  It sounds like they changed something in the latest
 code.  If so,
  they
  should change it back.
 
  
   Ate Douma