RE: [jBoss-User] Aaarrgh...

2000-11-17 Thread marc fleury

|Yes, private, no reply yet. I guess he's been busy :-)
|
|Craig, I would very much appreciate your input on the email I sent you.
|Thanks!

You bet he is busy, he and another SUN developer are the only ones working
on Tomcat

marc

|
|regards,
|  Rickard
|
|--
|Rickard Öberg
|
|Email: [EMAIL PROTECTED]
|http://www.telkel.com
|http://www.jboss.org
|http://www.dreambean.com
|
|
|--
|--
|To subscribe:[EMAIL PROTECTED]
|To unsubscribe:  [EMAIL PROTECTED]
|Problems?:   [EMAIL PROTECTED]
|
|



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-17 Thread Rickard Öberg

A bit more..

> If the mapping isn't 1:1, for example you want more actions than 
> form beans, then this seems like it wouldn't be a great idea.  

Another example of how form beans and actions can be used is included in
WebWork (the HelloWorld example). Install webwork.war and surf to
/webwork/helloworld. The form is a JavaBean which is subclassed by an
action JavaBean that "computes" the greeting. Of course the form
JavaBean is also an action; it just doesn't do anything on execute().

/Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Rickard Öberg

> I think at least some of the issue about what is easier or not 
> depends on how java-centric the person speaking is.   We have not 
> found a tag library that will really reach the promise of allowing 
> designers to use them.  None of the design tools even support them well.

Are you saying design tools remove the custom tags, or..?

In the taglib I focused on two tags: iterator and property. I also made
a beaninfo component that you could insert that shows what properties
you have to play with. So, if you're an interface designer with a blank
page you can insert the beaninfo component and see what properties you
have. Then use the "property" or "iterator" tag to "move into" a
specific property. If it is deeper (i.e. an iterator or the property is
a JavaBean) you insert the beaninfo component again to see what
properties you can use. This way you can drill down into the result data
without knowing it beforehand.

> One of the reasons struts uses the xml files is to avoid code changes 
> when the result jsp's name changes, BTW it was definitely an issue 
> of 0.5 that success and cancel were the only two obvious tags for 
> jsps.  If you use the XML file that is one less code change recompile 
> that might be needed.  Granted it is not clear how often you'll 
> be changing the names of the JSPs, but it's there.

And WebWork has the same with it's properties file. Also, in WebWork
there are no limitations on how many possible results are available. The
normal would be "result" or "error" (success/cancel), but this is not
mandated by the framework at all, but is more of a recommendation from
the support classes. You can have as many possible result pages as you
want. 

And how you compute them is up to you. The default *if* you use support
classes is to use a properties file with "action->jsp" mappings, but it
is also possible to feed it in on the request, e.g.
/myapp/foo.MyAction.action?result=myresult.jsp
This way you can change the flow of the application by changing the
JSP's exclusively, and you can also use the actions in different places
in the app with different JSP's as result, e.g. in one place you want to
use the default mapping, but in some other place you just want a compact
version and explicitly pass in the name of the JSP that shows a subset
of the result data.

The possibilities are numerous.

> I don't quite understand what you do Rickard, I plan on considering 
> your framework, but it sounds to me like you have combined 
> the form beans and the actions into the same object.  

Yes and no. Look in EBS for examples. There I have superclasses which
are more like form beans, but then they are *subclassed by all actions
that need them*.

For example, a common thing to do is have an input form JavaBean with
get/set for all inputs. Then, when submit is pressed you invoke an
action that is a subclass of the form JavaBean, which means that you
have access to all the parameters through the superclass. And you can
make as many subclasses as possible. Look in
"com.telkel.ebs.action.view" for examples of this.

> If the 
> mapping isn't 1:1, 

In short: can be, but typically isn't.

> for example you want more actions than form 
> beans, 

Exactly. Agree completely.

> then this seems like it wouldn't be a great idea.  You 
> address reflection, but don't assert whether you use it or not.  

Uses it extensively.

> If you avoid it that is certainly a win.  One thing we all know 
> is that web pages get viewed many more times than they get 
> developed (if things go well :-)

Yes, but there is one important observatin with reflection: getting
methods from classes is expensive, and invoking them is not. Since the
reflection in WebWork uses BeanInfo objects, and (here's the killer)
BeanInfo objects are *cached* by the Introspector, the performance is
ok. This is the same as we do with jBoss reflection, where we cache the
methods, but use reflection to do the invocations.

I hope I have removed at least some of your concerns. But keep 'em
coming, it's good to validate designs of new things as early as
possible!!

regards,
  Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Rickard Öberg

Hi!

(Craig, Struts author, is CC'ed)

(Craig, during a discussion of the WebWork I'm doing I copied in the
email I sent to you as basis for arguments)

Richard Backhouse wrote:
> Are your concerns based on looking at the Struts 0.5 Release or the
> soon to be released 1.0.

0.5, what's at the site.

> I'm not complaining about having another jsp mvc framework to choice
> from but any reason why you don't contribute to struts instead (or as
> well) ?

Yeah, I considered this initially, but then these concerns came up which
was important enough for me to go my own way. The concerns I had was
pretty important design/architecture decisions and it didn't seem likely
that they'd change. So, yes, I made yet-another-framework. And so far
I'm extremely happy with it :-)

> You didn't say if Craig replied to you or not. I am assuming this was
> a private mail as I didn't see it posted to the struts mailing list.

Yes, private, no reply yet. I guess he's been busy :-)

Craig, I would very much appreciate your input on the email I sent you.
Thanks!

regards,
  Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Rickard Öberg

Hi!

Thanks for the nice comments :-)))

Hristo Stoyanov wrote:
> I recently checked the design principles behind
> several web frameworks (Sun's Java PetStore Demo,
> Struts, XMLC ...). I think Rickard's  "webworks" does
> have an edge since:
> - no new API's or over-rated XML/XSLT architectures

Yes, that was one crucial thing to accomplish. AFAICT XML/XSLT is mostly
used for "skinning" applications to have multiple look&feels. I
accomplished that with plain JSP's in WebWork, which I think is a more
attractive solution. A heck of a lot easier to learn at least.

> - it promotes better code reusability (via
> JavaBeans)for the time you grow up and switch to Swing
> GUI to talk to an J2EE server
> - it is simpler and easy to learn, even without docos

Yes, and simple is important these days. People only have so much time.
IMHO, if a framework is too hard they will always go ad hoc instead.

> the other day if I could "steal" some stuff from
> STRUTS, providing it is decoupled from their
> dispacther/action
> framework... For example , STRUTS uses "templates"
> tags which is a much better way than Rickard's
>  if you have many and structured
> screens.
> Actually, I tried blending STRUTS tags + webworks on
> ... Orion server (shame on me!) and it works just
> fine!

Yeah, one of the goals of WebWork was to allow any page mechanism to be
used. The Struts taglibs are cool, so use them if they fit your needs.
For EBS I found that the "property" and "iterator" tags did about 90% of
the job so I'm fine (so far) with just that.

> What webworks need is more docos, contributions and
> more public attention. This will change when it goes
> to SourceForge, I hope.

Yes, agreed. I have registered an account now, and will put it up there
shortly.

regards,
  Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




RE: [jBoss-User] Aaarrgh...

2000-11-16 Thread Jay Walters



I 
think at least some of the issue about what is easier or not depends on how 
java-centric the person speaking is.   We have not found a tag 
library that will really reach the promise of allowing designers to use 
them.  None of the design tools even support them well.
 
One of 
the reasons struts uses the xml files is to avoid code changes when the result 
jsp's name changes, BTW it was definitely an issue of 0.5 that success and 
cancel were the only two obvious tags for jsps.  If you use the XML file 
that is one less code change recompile that might be needed.  Granted it is 
not clear how often you'll be changing the names of the JSPs, but it's 
there.
 
I 
don't quite understand what you do Rickard, I plan on considering your 
framework, but it sounds to me like you have combined the form beans and the 
actions into the same object.  If the mapping isn't 1:1, for example you 
want more actions than form beans, then this seems like it wouldn't be a great 
idea.  You address reflection, but don't assert whether you use it or 
not.  If you avoid it that is certainly a win.  One thing we all know 
is that web pages get viewed many more times than they get developed (if things 
go well :-)
 
I have 
more questions but I'll just "Check the source code" and see what's under the 
hood before continuing on with them.
 
Cheers
Jay 
Walters

   
   -Original 
  Message-From: Richard Backhouse 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, November 16, 2000 5:39 
  PMTo: jBossSubject: Re: [jBoss-User] 
  Aaarrgh...Rickard 
  Are your concerns based on looking at the Struts 0.5 Release or the soon to 
  be released 1.0. 
  I'm not complaining about having another jsp mvc framework to choice from 
  but any reason why you don't contribute to struts instead (or as well) ? 
  You didn't say if Craig replied to you or not. I am assuming this was a 
  private mail as I didn't see it posted to the struts mailing list. 
  Richard Backhouse Oak Grove Software 
  Rickard Öberg wrote: 
  Hi! 
Bill Pfeiffer wrote: > I have been playing with the struts library 
that apache offers through the > jakarta project. Can you explain 
where WebWork would fit in and/or compete > with struts?  It 
also offers a MVC framework with a set of form and utility > cutomer 
jsp tags.  Will WebWork offer the same functionality? 
I have looked at Struts too, and added some stuff to WebWork which it 
does not have. Struts is pretty ok. 
But. I have some concerns. Here is a copy of an email I sent to Craig 
(Struts author) the other day. Whenever it says "you" I am referring to 
Craig. 
 start email - 
I a have a few basic design concerns [with Struts], and I wanted to know 
your opinion on them. 1. Input variables in your framework is 
based on sending in an ActionForm which is reflected upon by the 
dispatcher. In my framework I simply set them on the action itself. This 
requires instantiating a new action JavaBean instance for each request 
but that should not be a problem. It makes the code much easier, since 
it is very similar to normal JavaBeans programming. What would be put in 
bean instances fields in Struts is simply put in static fields in my 
framework. Again much similar to normal JavaBeans since that is what one 
would do there. 
2. Struts actions are explicitly servlet aware. I wanted to make it 
possible to do actions that are completely view agnostic, i.e. they 
don't even know they're being used by servlets! To do this I have an 
interface ServletAware with setRequest/Response that actions may 
implement, but don't have to. The result is that the vast majority of 
beans can easily be reused in a Swing app. 
3. In Struts the dispatcher servlet keeps track of the view mappings. 
This is bad. It is more flexible to let the action keep track of it, and 
provide support classes to make it do so easily. Also, in Struts it 
seems limited to success or error. In mine I don't have any such 
restrictions, since the action  returns the next page and decides 
how to do that. 
These are some of the concerns I have with Struts, and which I have 
solved in my framework. Let me show you an example of what I have done 
so you can compare with Struts. 
A WebWork (the name of my framework) action: public class Test 
   implements Action // Contains the "execute" method, see 
below {   Object result; // Result object - typically name of 
JSP page, but can be Swing component too   int xyzzy; // Input 
parameter - converted to int by PropertyEditor   String foo; // 
Output parameter   public void setResult(Object res) { .. } 
  protected Object getResult(Object res) { .. }   public 
void setXyzzy(int val) { .. }   public int get

RE: [jBoss-User] Aaarrgh... Tapestry

2000-11-16 Thread Ship, Howard



You 
should add Tapestry to the list of competing MVC frameworks.  Tapestry is 
an all-Java component based web application framework.  It's LGPL, hosted 
at http://sourceforge.net/projects/tapestry
 
I've 
been working to integrate Tapestry with Jetty and jBoss (the framework is server 
agnostic, but the tutorials and demos need to be 
server-aware).
 
Tapestry is an alternative to JSPs and a whole lot 
more.  It's a way of building very sophisticated, dynamic web applications 
without concerning yourself with trivialities such as URLs, request parameters, 
session attributes, etc.  It uses templates and components, with absolutely 
no scripting.  
 
I 
looked at most of the competing systems before and during development of 
Tapestry.  Of them, Turbine is somewhat similar, but seemed to require a 
lot more coding to accomplish the same thing as Tapestry (I think your code has 
to be more aware of servlets and URLs).  WebWorks is new to me, and I like 
the idea that actions can work in the web application and in a Swing 
GUI.

  -Original Message-From: Richard Backhouse 
  [mailto:[EMAIL PROTECTED]]Sent: Thursday, November 16, 2000 5:39 
  PMTo: jBossSubject: Re: [jBoss-User] 
  Aaarrgh...Rickard 
  Are your concerns based on looking at the Struts 0.5 Release or the soon to 
  be released 1.0. 
  I'm not complaining about having another jsp mvc framework to choice from 
  but any reason why you don't contribute to struts instead (or as well) ? 
  You didn't say if Craig replied to you or not. I am assuming this was a 
  private mail as I didn't see it posted to the struts mailing list. 
  Richard Backhouse Oak Grove Software 
  Rickard Öberg wrote: 
  Hi! 
Bill Pfeiffer wrote: > I have been playing with the struts library 
that apache offers through the > jakarta project. Can you explain 
where WebWork would fit in and/or compete > with struts?  It 
also offers a MVC framework with a set of form and utility > cutomer 
jsp tags.  Will WebWork offer the same functionality? 
I have looked at Struts too, and added some stuff to WebWork which it 
does not have. Struts is pretty ok. 
But. I have some concerns. Here is a copy of an email I sent to Craig 
(Struts author) the other day. Whenever it says "you" I am referring to 
Craig. 
 start email - 
I a have a few basic design concerns [with Struts], and I wanted to know 
your opinion on them. 1. Input variables in your framework is
based on sending in an ActionForm which is reflected upon by the 
dispatcher. In my framework I simply set them on the action itself. This 
requires instantiating a new action JavaBean instance for each request 
but that should not be a problem. It makes the code much easier, since 
it is very similar to normal JavaBeans programming. What would be put in 
bean instances fields in Struts is simply put in static fields in my 
framework. Again much similar to normal JavaBeans since that is what one 
would do there. 
2. Struts actions are explicitly servlet aware. I wanted to make it 
possible to do actions that are completely view agnostic, i.e. they 
don't even know they're being used by servlets! To do this I have an 
interface ServletAware with setRequest/Response that actions may 
implement, but don't have to. The result is that the vast majority of 
beans can easily be reused in a Swing app. 
3. In Struts the dispatcher servlet keeps track of the view mappings. 
This is bad. It is more flexible to let the action keep track of it, and 
provide support classes to make it do so easily. Also, in Struts it 
seems limited to success or error. In mine I don't have any such 
restrictions, since the action  returns the next page and decides 
how to do that. 
These are some of the concerns I have with Struts, and which I have 
solved in my framework. Let me show you an example of what I have done 
so you can compare with Struts. 
A WebWork (the name of my framework) action: public class Test 
   implements Action // Contains the "execute" method, see 
below {   Object result; // Result object - typically name of 
JSP page, but can be Swing component too   int xyzzy; // Input 
parameter - converted to int by PropertyEditor   String foo; // 
Output parameter   public void setResult(Object res) { .. } 
  protected Object getResult(Object res) { .. }   public 
void setXyzzy(int val) { .. }   public int getXyzzy() { .. } 
  protected String getFoo() { .. } 
  public Object execute() // Return value is next view - JSP or GUI 
component depending on what invoker expects. Action itself don't care 
about the type.  throws Exception   
{     foo = (xyzzy > 10) ? "big" : "small" // Logic to 
perform -> create result 

Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Hristo Stoyanov

Hi-,
I recently checked the design principles behind
several web frameworks (Sun's Java PetStore Demo,
Struts, XMLC ...). I think Rickard's  "webworks" does
have an edge since:
- no new API's or over-rated XML/XSLT architectures
- it promotes better code reusability (via
JavaBeans)for the time you grow up and switch to Swing
GUI to talk to an J2EE server
- it is simpler and easy to learn, even without docos
- it is JavaBeans compliant, u can use the beans in
both JSP and Swing GUI apps!

Webworks, STRUTS and Java Pet Store Demo are all build
around this Model-2 design where there is single entry
poin to the webapp (a servlet dispatcher). STRUTS and
Java Pet Store Demo encode the screen switching logic
in xml "map files" which can actually be done in a
simpler way - see webworks. However, there
are some tags in STRUTS which are nice. I was thinking

the other day if I could "steal" some stuff from
STRUTS, providing it is decoupled from their
dispacther/action
framework... For example , STRUTS uses "templates"
tags which is a much better way than Rickard's
 if you have many and structured
screens.
Actually, I tried blending STRUTS tags + webworks on
... Orion server (shame on me!) and it works just
fine!

What webworks need is more docos, contributions and
more public attention. This will change when it goes
to SourceForge, I hope.

Regards,
Hristo

__
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Richard Backhouse


Rickard
Are your concerns based on looking at the Struts 0.5 Release or the
soon to be released 1.0.
I'm not complaining about having another jsp mvc framework to choice
from but any reason why you don't contribute to struts instead (or as well)
?
You didn't say if Craig replied to you or not. I am assuming this was
a private mail as I didn't see it posted to the struts mailing list.
Richard Backhouse
Oak Grove Software
Rickard Öberg wrote:
Hi!
Bill Pfeiffer wrote:
> I have been playing with the struts library that apache offers through
the
> jakarta project. Can you explain where WebWork would fit in and/or
compete
> with struts?  It also offers a MVC framework with a set of form
and utility
> cutomer jsp tags.  Will WebWork offer the same functionality?
I have looked at Struts too, and added some stuff to WebWork which it
does not have. Struts is pretty ok.
But. I have some concerns. Here is a copy of an email I sent to Craig
(Struts author) the other day. Whenever it says "you" I am referring
to
Craig.
 start email -
I a have a few basic design concerns [with Struts], and I wanted to
know
your opinion
on them.
1. Input variables in your framework is based on sending in an
ActionForm which is reflected upon by the dispatcher. In my framework
I
simply set them on the action itself. This requires instantiating a
new
action JavaBean instance for each request but that should not be a
problem. It makes the code much easier, since it is very similar to
normal JavaBeans programming. What would be put in bean instances fields
in Struts is simply put in static fields in my framework. Again much
similar to normal JavaBeans since that is what one would do there.
2. Struts actions are explicitly servlet aware. I wanted to make it
possible to do actions that are completely view agnostic, i.e. they
don't even know they're being used by servlets! To do this I have an
interface ServletAware with setRequest/Response that actions may
implement, but don't have to. The result is that the vast majority
of
beans can easily be reused in a Swing app.
3. In Struts the dispatcher servlet keeps track of the view mappings.
This is bad. It is more flexible to let the action keep track of it,
and
provide support classes to make it do so easily. Also, in Struts it
seems limited to success or error. In mine I don't have any such
restrictions, since the action  returns the next page and decides
how to
do that.
These are some of the concerns I have with Struts, and which I have
solved in my framework. Let me show you an example of what I have done
so you can compare with Struts.
A WebWork (the name of my framework) action:
public class Test
   implements Action // Contains the "execute" method, see
below
{
  Object result; // Result object - typically name of JSP page,
but can
be Swing component too
  int xyzzy; // Input parameter - converted to int by PropertyEditor
  String foo; // Output parameter
  public void setResult(Object res) { .. }
  protected Object getResult(Object res) { .. }
  public void setXyzzy(int val) { .. }
  public int getXyzzy() { .. }
  protected String getFoo() { .. }
  public Object execute() // Return value is next view - JSP or
GUI
component depending on what invoker expects. Action itself don't care
about the type.
 throws Exception
  {
    foo = (xyzzy > 10) ? "big" : "small" // Logic to
perform -> create
result data
    return getResult(); // All is well, return whatever
"result" is set
to
  }
}
This is all. Note that
1) It is very similar to a regular JavaBean. The only thing that tells
it is a WebWork bean is the "execute" method from the Action interface,
and it too is very straightforward.
2) How to compute the result view is extremely flexible. In this case
I
got it as an input parameter. I could also code getResult() to look
in a
mapping, which could go to a database or look in a properties file,
or
whatever. This is taken care of by the action itself, but *typically*
one uses standard support classes for how this is done. But the
framework itself does not mandate how it is done.
Next, here's a typical JSP that views this and the URL to invoke it:
---
http://www.somehost.com/myapp/Test.action?result=test.jsp&xyzzy=42
As noted above, I *chose* to have the result JSP as input, but this
could be done in a number of other different ways. *If* this way is
used
then there is no need for a name->JSP mapping, which makes it extremely
easy to "skin" the application since all URL's are coded into the pages
themselves.
---
<%taglib ...%>


 is a 
value. 



The action is set as the page context parameter "result" so getting
property "xyzzy" results in
"((Test)pageContext.getAttribute("result")).getXyzzy()". One can use
JSP/taglibs or some other framework, even Struts taglibs if desired.
This is not mandated by the dispatcher framework.
 end email -
I hope this gave a few pointers.
The main points are:
* Actions are normal JavaBeans. Very little impact of WebWork framework
* Actions 

Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Rickard Öberg

Hi!

Bill Pfeiffer wrote:
> I have been playing with the struts library that apache offers through the
> jakarta project. Can you explain where WebWork would fit in and/or compete
> with struts?  It also offers a MVC framework with a set of form and utility
> cutomer jsp tags.  Will WebWork offer the same functionality?

I have looked at Struts too, and added some stuff to WebWork which it
does not have. Struts is pretty ok.

But. I have some concerns. Here is a copy of an email I sent to Craig
(Struts author) the other day. Whenever it says "you" I am referring to
Craig.

 start email -

I a have a few basic design concerns [with Struts], and I wanted to know
your opinion
on them.
1. Input variables in your framework is based on sending in an
ActionForm which is reflected upon by the dispatcher. In my framework I
simply set them on the action itself. This requires instantiating a new
action JavaBean instance for each request but that should not be a
problem. It makes the code much easier, since it is very similar to
normal JavaBeans programming. What would be put in bean instances fields
in Struts is simply put in static fields in my framework. Again much
similar to normal JavaBeans since that is what one would do there.

2. Struts actions are explicitly servlet aware. I wanted to make it
possible to do actions that are completely view agnostic, i.e. they
don't even know they're being used by servlets! To do this I have an
interface ServletAware with setRequest/Response that actions may
implement, but don't have to. The result is that the vast majority of
beans can easily be reused in a Swing app.

3. In Struts the dispatcher servlet keeps track of the view mappings.
This is bad. It is more flexible to let the action keep track of it, and
provide support classes to make it do so easily. Also, in Struts it
seems limited to success or error. In mine I don't have any such
restrictions, since the action  returns the next page and decides how to
do that.

These are some of the concerns I have with Struts, and which I have
solved in my framework. Let me show you an example of what I have done
so you can compare with Struts.

A WebWork (the name of my framework) action:
public class Test
   implements Action // Contains the "execute" method, see below
{
  Object result; // Result object - typically name of JSP page, but can
be Swing component too
  int xyzzy; // Input parameter - converted to int by PropertyEditor
  String foo; // Output parameter
  public void setResult(Object res) { .. }
  protected Object getResult(Object res) { .. }
  public void setXyzzy(int val) { .. }
  public int getXyzzy() { .. }
  protected String getFoo() { .. }

  public Object execute() // Return value is next view - JSP or GUI
component depending on what invoker expects. Action itself don't care
about the type.
 throws Exception
  {
foo = (xyzzy > 10) ? "big" : "small" // Logic to perform -> create
result data
return getResult(); // All is well, return whatever "result" is set
to
  }
}
This is all. Note that
1) It is very similar to a regular JavaBean. The only thing that tells
it is a WebWork bean is the "execute" method from the Action interface,
and it too is very straightforward.
2) How to compute the result view is extremely flexible. In this case I
got it as an input parameter. I could also code getResult() to look in a
mapping, which could go to a database or look in a properties file, or
whatever. This is taken care of by the action itself, but *typically*
one uses standard support classes for how this is done. But the
framework itself does not mandate how it is done.

Next, here's a typical JSP that views this and the URL to invoke it:

---
http://www.somehost.com/myapp/Test.action?result=test.jsp&xyzzy=42
As noted above, I *chose* to have the result JSP as input, but this
could be done in a number of other different ways. *If* this way is used
then there is no need for a name->JSP mapping, which makes it extremely
easy to "skin" the application since all URL's are coded into the pages
themselves.
---
<%taglib ...%>


 is a 
value. 



The action is set as the page context parameter "result" so getting
property "xyzzy" results in
"((Test)pageContext.getAttribute("result")).getXyzzy()". One can use
JSP/taglibs or some other framework, even Struts taglibs if desired.
This is not mandated by the dispatcher framework.

 end email -

I hope this gave a few pointers. 

The main points are:
* Actions are normal JavaBeans. Very little impact of WebWork framework
* Actions knows nothing about servlets. Can be reused in Swing apps
* Easy to "skin" applications (e.g. you want one WAP view, one text-only
view, one fancy view), which removes need for XML/XSL combo
* Tag libray available that can be used to easily extract data from
result (Struts has some of this too, but not very good IMHO. Mine is
more similar to WebMacro)
* It is simple to learn. Action API consists of basically one interface

Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Rickard Öberg

Hi!

Alexander ten Bruggencate wrote:
> i've download webwork + ebs but a first glance tells me i will need a howto
> or something.
> Do you have something like that?

Nope, not yet. It is under heavy development, and I also have lots of
other work to do on jBoss (docs mainly). Sorry, for now it is a tough
ride... 

> Are there any other alternatives? I can't believe it's so difficult to use
>  on
> a EJB.

Hm.. IMHO you should not try to make it *too* easy, because then you
will only fool yourself and get an unstable application. Some kind of
framework is definitely preferred.

regards,
  Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Bill Pfeiffer

Rickard,

I have been playing with the struts library that apache offers through the
jakarta project. Can you explain where WebWork would fit in and/or compete
with struts?  It also offers a MVC framework with a set of form and utility
cutomer jsp tags.  Will WebWork offer the same functionality?

Thanks,

Bill Pfeiffer


- Original Message -
From: "Rickard Öberg" <[EMAIL PROTECTED]>
To: "jBoss" <[EMAIL PROTECTED]>
Sent: Thursday, November 16, 2000 5:54 AM
Subject: Re: [jBoss-User] Aaarrgh...


Hi!

Alexander ten Bruggencate wrote:
> i've deployed a bean with jboss and now i want to access it through a
> jsp that runs on tomcat.
>
> my question is: can  be used with an ENTERPRISE
> JavaBean? and if so how?
>
>  scope="page">
> cannot create an instance of my bean, which i understand but how do i
> create an instance of a ejb AND be able to use  /> on it?

Typically you will want to hide this behind a regular JavaBean.

For a complete example on how to use servlets/JSP/EJB you can download
the EBS application (currently under development, but still) from:
dreambean.com/download/rickard
It uses the WebWork web application framework (also under development)
which allows for MVC in webapps using a Model-2 approach. Sounds fancy?
It isn't; the coding is pretty straightforward. The WebWork download has
a couple of examples included that you can look at too.

I am coding this right now, so check back regularly for updates. I am
getting a SourceForge account for it too, so you can post bugs/RFE's
etc.

Good luck!

regards,
  Rickard

--
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]





--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Alexander ten Bruggencate

Georgi Danov wrote:

> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Alexander
> > ten Bruggencate
> > Sent: Thursday, November 16, 2000 13:37
> > To: jBoss
> > Subject: Re: [jBoss-User] Aaarrgh...
> >
> >
> > Hi,
> >
> > although your example does allow me te create an instance of my
> > personbean, i
> > still cannot use  on it.
>
>   is supposed to be used with plain
> JavaBeans, read the spec.

 yes i'm still waiting for my copy of "Java Server pages to
arrive
so how does one get form data (easily) to an EJB?

-Alexander




--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Alexander ten Bruggencate

Rickard Öberg wrote:

> > my question is: can  be used with an ENTERPRISE
> > JavaBean? and if so how?
>
> Typically you will want to hide this behind a regular JavaBean.
>
> For a complete example on how to use servlets/JSP/EJB you can download
> the EBS application (currently under development, but still) from:
> dreambean.com/download/rickard

>
> regards,
>   Rickard

Hi Rickard,

i've download webwork + ebs but a first glance tells me i will need a howto
or something.
Do you have something like that?

Are there any other alternatives? I can't believe it's so difficult to use
 on
a EJB.

regards,
-Alexander.



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




RE: [jBoss-User] Aaarrgh...

2000-11-16 Thread Georgi Danov



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Alexander
> ten Bruggencate
> Sent: Thursday, November 16, 2000 13:37
> To: jBoss
> Subject: Re: [jBoss-User] Aaarrgh...
>
>
> Hi,
>
> although your example does allow me te create an instance of my
> personbean, i
> still cannot use  on it.


  is supposed to be used with plain
JavaBeans, read the spec.



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Alexander ten Bruggencate

Hi,

although your example does allow me te create an instance of my personbean, i
still cannot use  on it.

i get:
java.lang.NullPointerException
at
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibrary.java:169)

at
org.apache.jasper.runtime.JspRuntimeLibrary.introspect(JspRuntimeLibrary.java:154)



Georgi Danov wrote:

> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Alexander
> > ten Bruggencate
> > Sent: Thursday, November 16, 2000 12:41
> > To: jBoss
> > Subject: [jBoss-User] Aaarrgh...
> >
> >
> > Hello everyone,
> >
> > i've deployed a bean with jboss and now i want to access it through a
> > jsp that runs on tomcat.
> >
> > my question is: can  be used with an ENTERPRISE
> > JavaBean? and if so how?
> >
> >  > scope="page">
> > cannot create an instance of my bean, which i understand but how do i
> > create an instance of a ejb AND be able to use  > /> on it?
> >
> > -Alexander.
> >
> here is a example:
>
> 
> <%@ page
> import="javax.naming.*,javax.rmi.PortableRemoteObject,musala.sds.*,java.util
> .*" %>
> 
> 
> Untitled
> 
>
> 
>
> <%
>   LoginHome lh=null;
>
> System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingC
> ontextFactory");
>   System.setProperty("java.naming.provider.url"," here>:1099");
> try{
>   Context ctx = new InitialContext();
>
> lh=(LoginHome)PortableRemoteObject.narrow(ctx.lookup("Login"),LoginHome.clas
> s);
>  LoginRemote lr=lh.create();
>  String sessionid=lr.login("asd","asd",1);
> %>
> your sessionid is:<%=sessionid%>
> <%
>
> }catch(Exception e){
> %>
> exception:<%= e.toString() %>
> <%
> }
> %>
>
> 
> 



--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




Re: [jBoss-User] Aaarrgh...

2000-11-16 Thread Rickard Öberg

Hi!

Alexander ten Bruggencate wrote:
> i've deployed a bean with jboss and now i want to access it through a
> jsp that runs on tomcat.
> 
> my question is: can  be used with an ENTERPRISE
> JavaBean? and if so how?
> 
>  scope="page">
> cannot create an instance of my bean, which i understand but how do i
> create an instance of a ejb AND be able to use  /> on it?

Typically you will want to hide this behind a regular JavaBean. 

For a complete example on how to use servlets/JSP/EJB you can download
the EBS application (currently under development, but still) from:
dreambean.com/download/rickard
It uses the WebWork web application framework (also under development)
which allows for MVC in webapps using a Model-2 approach. Sounds fancy?
It isn't; the coding is pretty straightforward. The WebWork download has
a couple of examples included that you can look at too.

I am coding this right now, so check back regularly for updates. I am
getting a SourceForge account for it too, so you can post bugs/RFE's
etc.

Good luck!

regards,
  Rickard

-- 
Rickard Öberg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com


--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]




RE: [jBoss-User] Aaarrgh...

2000-11-16 Thread Georgi Danov



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of Alexander
> ten Bruggencate
> Sent: Thursday, November 16, 2000 12:41
> To: jBoss
> Subject: [jBoss-User] Aaarrgh...
>
>
> Hello everyone,
>
> i've deployed a bean with jboss and now i want to access it through a
> jsp that runs on tomcat.
>
> my question is: can  be used with an ENTERPRISE
> JavaBean? and if so how?
>
>  scope="page">
> cannot create an instance of my bean, which i understand but how do i
> create an instance of a ejb AND be able to use  /> on it?
>
> -Alexander.
>
here is a example:


<%@ page
import="javax.naming.*,javax.rmi.PortableRemoteObject,musala.sds.*,java.util
.*" %>


Untitled




<%
  LoginHome lh=null;

System.setProperty("java.naming.factory.initial","org.jnp.interfaces.NamingC
ontextFactory");
  System.setProperty("java.naming.provider.url",":1099");
try{
  Context ctx = new InitialContext();


lh=(LoginHome)PortableRemoteObject.narrow(ctx.lookup("Login"),LoginHome.clas
s);
 LoginRemote lr=lh.create();
 String sessionid=lr.login("asd","asd",1);
%>
your sessionid is:<%=sessionid%>
<%

}catch(Exception e){
%>
exception:<%= e.toString() %>
<%
}
%>






--
--
To subscribe:[EMAIL PROTECTED]
To unsubscribe:  [EMAIL PROTECTED]
Problems?:   [EMAIL PROTECTED]