Re: Want to know abt patterns in Struts.

2005-02-04 Thread listed
You can find an UML-Diagramm about Struts here: 
http://rollerjm.free.fr/pro/Struts11.html

Greets Felixx
Joe Germuska wrote:
At 1:15 PM +0530 2/4/05, Akshay Pandit wrote:
Hi to all,
I would like to know how many j2ee patterns does struts framework 
make use of.

As far as I know, no one sat down with the book and said let's use 
this one.   I'll leave cataloging any which are in there as the 
result of good design practices up to someone else.

And also one more thing, I want to insert  UNICODE data in Database,
I've created the database with unicode support, what changes are
needed on struts end to make the application in UNICODE .

There should be nothing specific to Struts about this.  Take control 
of the encoding with which client pages submit requests (most 
consistently done by delivering the page with the same encoding that 
you want used for the form submission) and make sure your Servlet 
container knows the encoding (probably best done with a ServletFilter 
which calls request.setCharacterEncoding(...) before anything else 
happens).  Besides dealing with the serialization of user request data 
into bytes, everything is Java, and therefore fundamentally Unicode.

Joe

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


Re: Want to know abt patterns in Struts.

2005-02-04 Thread listed
You can find an UML-Diagramm about Struts here: 
http://rollerjm.free.fr/pro/Struts11.html

Greets Felixx
Joe Germuska wrote:
At 1:15 PM +0530 2/4/05, Akshay Pandit wrote:
Hi to all,
I would like to know how many j2ee patterns does struts framework 
make use of.

As far as I know, no one sat down with the book and said let's use 
this one.   I'll leave cataloging any which are in there as the 
result of good design practices up to someone else.

And also one more thing, I want to insert  UNICODE data in Database,
I've created the database with unicode support, what changes are
needed on struts end to make the application in UNICODE .

There should be nothing specific to Struts about this.  Take control 
of the encoding with which client pages submit requests (most 
consistently done by delivering the page with the same encoding that 
you want used for the form submission) and make sure your Servlet 
container knows the encoding (probably best done with a ServletFilter 
which calls request.setCharacterEncoding(...) before anything else 
happens).  Besides dealing with the serialization of user request data 
into bytes, everything is Java, and therefore fundamentally Unicode.

Joe


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


general Thread disscussion

2005-02-01 Thread listed
I had yesterday a general discussion about Threads running in the 
Servlet-Engine Tomcat.

What i would like to do is to start a Thread over the Struts-Plugin. The 
Thread self is running in a infinite 
http://dict.leo.org/se?lp=endep=/Mn4k.search=infinite loop 
http://dict.leo.org/se?lp=endep=/Mn4k.search=loop to do something 
and to sleep for 30sec.

Does anyone have expiriences with this?
I think it shoudn't be a problem when i start the Thread and terminate 
it when the Application is terminating. But i heard that isn't a best 
practise to run a thread in Tomcat. But i don't know where...

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


Re: general Thread disscussion

2005-02-01 Thread listed
Excuse me for the bad formatting!
##
I had yesterday a general discussion about Threads running in the 
Servlet-Engine Tomcat.

What i would like to do is to start a Thread over the Struts-Plugin. The 
Thread self is running in a infinite loop to do something and to sleep 
for 30sec.

Does anyone have expiriences with this?
I think it shoudn't be a problem when i start the Thread and terminate 
it when the Application is terminating. But i heard that isn't a best 
practise to run a thread in Tomcat. But i don't know where...

Greets
Felix Klieber

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


Re: general Thread disscussion

2005-02-01 Thread listed
Thank you for your detailed reply. Its really helpfull but i had two 
questions:

[...]
... and it may even be forbidden by J2EE, but... doing it is OK if you are 
careful a
[...]
I had a look in the J2EE-Specification but i can't found the point where 
this Topic is handled. Do you know where?

[...]
Also, you NEVER want to hold references to any request-oriented resources (in fact, your thread shouldn't even USE them, shouldn't even be aware that it's running in a servlet container, if possible). 

[...]
Does this include ressources with synchronized-operations?
For example a static HashMap with some Data.
Some Client read of this HashMap (without synchronized) and the thread 
wrote with the synchronized-Expression in the HashMap

Greets Felix

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


Re: general Thread disscussion

2005-02-01 Thread listed

To be honest, I've only heard this in the past few days.  I didn't know that, 
generically, writing files was forbidden by J2EE.  I knew it was something 
you generally want to avoid from a webapp for other reasons, but it's news to me too :)  
So no, I don't have any reference I can point you to.  I'd be interested in such a 
reference myself!
 

[...]
Ok i will inform you, when i found a reference.
[...]
Just want to be sure I follow... Do you mean a case where you have a class 
along these lines:
public class myData {
 public static HashMap data = new HashMap();
}
... and you might be reading and/or writing from this during the course of 
processing a reqeust AS WELL AS from a background thread?  If that's the 
question, the answer is you need to be very careful.  You can synchronize all 
access to the HashMap, but then you are introducing a bottleneck into the 
system at best, and a potential deadlock or any one of the other multitude of 
thread contention issues that confuse the hell out of most of us when they crop 
up!
If your static information is read-only, you have no issue of course.  I do this in that application I was talking about... I have a class almost identical to what you see above except that the HashMap is private and I have a getter/setter pair.  It's never altered during the run of the application though, after startup anyway, so no problem.  If it could be altered though, that would change matters.
 

[...]
Thats excectly what i want. An altered ressource during the run. So i 
have to find another solution for this case.

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


Re: Abstract Bean Processing

2005-01-28 Thread listed
Hi Silvian,
you have to know the propertyname and write accessor-methods. Where 
should struts know, which property to put out?
Have a look at the jstl-core library.

Greets Mark
Sylvain ~ wrote:
Hi,
I wanted to create a Form Bean to represent a list of StorableObjects
with a filter bean nested inside in order to be able to handle
generically list display of Objects.
Here is my ListBean code :
public class ListBean extends ActionForm {
   private ArrayList l;
   private StorableObject filter;
   
   public void setList(ArrayList l){
   this.l = l;
   	}
   
   public ArrayList getList(){
   return l;
   }
   
   public Integer getId() {
   return id;
   }
   public void setId(Integer id) {
   this.id = id;
   }
   
   
   public StorableObject getFilter() {
   return filter;
   }
   public void setFilter(StorableObject filter) {
   this.filter = filter;
   }
}

The objects are stored in the list property of the bean, and filter
parameters are stored in filter property.
The StorableObject Class is abstract, and thus doesn't have any
properties, implementing classes have such properties accessors. Form
population with the right class type is made at runtime by the action.
When submitting the filter form, I get a 
javax.servlet.ServletException: BeanUtils.populate exception, despite
I am able to display values populated by the action.

It seems that in this case Struts tries to populate a bean of type
StorableObject, and since this one is abstract it results in a error.
So, my question, is there a way to make struts use a generic form bean
with any properties names and values and then handle it by hand in the
action ?
Any input would be appreciated.
Sylvain.
-
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: How to Forward out of struts to a URL from an Action

2005-01-27 Thread listed
Hi Michael,
have a look in your struts-config.xml.
   forward  name = Success
  path = /ViewSettings.do
 redirect = true/
Greets Mark
Michael Oliver wrote:
I would like to forward the user out of struts to a URL after an action
executes without additional user input, what is the best way in Struts?
I can use a page that has a redirect javascript in it, but is there a
facility in Struts to do this?

Michael Oliver
CTO
Alarius Systems LLC
3325 N. Nellis Blvd, #1
Las Vegas, NV 89115
Phone:(702)643-7425
Fax:(520)844-1036
*Note new email changed from [EMAIL PROTECTED]

 


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


Problem using plug-in mechanismen

2005-01-15 Thread listed
Hi,
i would like to use my own components to be plugged in and loaded 
dynamically but i get everytime the same exception. The error eccoured 
when the Servlet executes.
I have no idea where the Problem is.

I am happy about every tip.
Thanxx
Greets Jens
##
The Exception:
javax.servlet.ServletException: Servlet.init() for servlet action threw 
exception
   at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:963)
   at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.java:191)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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:2416)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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:601)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
   at java.lang.Thread.run(Thread.java:534)
- Root Cause -
java.lang.AbstractMethodError: 
control.plugin.WatchdogPlugin.init(Lorg/apache/struts/action/ActionServlet;Lorg/apache/struts/config/ApplicationConfig;)V
   at 
org.apache.struts.action.ActionServlet.initApplicationPlugIns(ActionServlet.java:991)
   at 
org.apache.struts.action.ActionServlet.init(ActionServlet.java:458)
   at javax.servlet.GenericServlet.init(GenericServlet.java:256)
   at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:935)
   at 
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.java:191)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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:2416)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
  

Re: Problem using plug-in mechanismen

2005-01-15 Thread listed
Hubert Rabago wrote:
Looks like you're using an obsolete jar.  The spec you implemented is
using ModuleConfig, yet the jar you're deploying is using the
deprecated ApplicationConfig.
Hubert
 

Thank you for the Tip.
I looked for obsolete jar but i could not found anything. I downloaded 
the Version 1.2.4 and changed everything (i think so). The classes 
org.apache.struts.config.ModuleConfig and 
org.apache.struts.config.ModuleConfig are only(!) in the Package 
struts.jar. Is it right?

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


Re: Problem using plug-in mechanismen

2005-01-15 Thread listed
Hubert Rabago wrote:
Yes.  You could've been using a pre-1.1 struts.jar.
 

Ok, i found the old jar. My first Problem is solved ;-).
But the next Error is comming. I don't use tiles and get the following 
Exception. I read in in the mailing-archive that someone had solved the 
Problem.

http://www.mail-archive.com/jetspeed-dev@jakarta.apache.org/msg17041.html
He wrote, that's a problem with the struts-config.xml that comes with 
the struts-blanket.jar.  He modified the struts-config.xml. But how? 
What's wrong?
I tryed with and without to define the tiles-plugin. No success.
I would be happy about a tip.

Thanxx
Mark
###
The Exception:
java.lang.ClassCastException
   at 
org.apache.struts.tiles.TilesRequestProcessor.initDefinitionsMapping(TilesRequestProcessor.java:86)
   at 
org.apache.struts.tiles.TilesRequestProcessor.init(TilesRequestProcessor.java:77)
   at 
org.apache.struts.action.ActionServlet.getRequestProcessor(ActionServlet.java:585)
   at 
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1162)
   at 
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
   at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
   at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
   at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.java:191)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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:2416)
   at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
   at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
   at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
   at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(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.invokeNext(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:601)
   at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
   at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
   at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
   at java.lang.Thread.run(Thread.java:534)

The struts-config.xml
?xml version=1.0 encoding=ISO-8859-1 ?
!DOCTYPE struts-config PUBLIC
 -//Apache Software Foundation//DTD Struts Configuration 1.1//EN
 http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd;

struts-config
!-- == Form Bean Definitions --
   form-beans
   !-- loginForm --
   form-bean
   name=loginForm
   type=control.LoginForm/
   !-- Language --
   form-bean
   name=languageForm
   type=control.LanguageForm/
   !-- Shop Catalog --
   form-bean
   name=shopCatalogForm
   type=control.ShopCatalogForm/
   !-- Shop Category --   
   form-bean
   name=shopCategoryForm
   type=control.ShopCategoryForm/
   !-- Shop Product --   
  

Re: Problem using plug-in mechanismen

2005-01-15 Thread listed
Thank You!
I didn't saw the Controller-Tag.
Now its running :-).
The Happy
Mark
 


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