Re: wizard-style JSF application: looking for words of wisdom

2006-09-15 Thread Adam Brod

Check out JBoss Seam or the Apache Shale
project. They are both JSF frameworks with support for widard-like
flows.

Adam Brod
Product Development Team


Henrik Bentel [EMAIL PROTECTED]
wrote on 09/15/2006 11:22:56 AM:

 Hi
 
 I'm developing a JSF webapp which works like a 'wizard' where the
user
 steps though
 several pages(or steps). The main navigation control are links like
 'next', 'previous', and 'cancel'. I've done a couple of these
 'wizard'-style apps, each very different in structure.
 
 I'm looking for suggestions for what you've found to work well in
this
 type of application.
 
 
 My previous 2 weak attempts of a wizard-style app is as follows.
 My first app has one managed bean for the entire wizard with all
 validation and wizard logic in that one bean(and supporting POJOs).
 Using one backing bean made it easier for reuse of page layout and
 navigation controls, and made it easy to skip steps dynamically at
 runtime. But it grew very large and not very pretty.
 
 My second app has one backing bean per 'step'. But I couldn't find
an
 obvious way of reuse page layout and navigation controls across all
 the managed beans. So each page is bound to its own backing bean with
 'next', 'previous' and 'cancel' action methods. And sometimes a
 backing bean had to know which page was the previous and the next
 step.
 
 Hope someone can help
 
 regards,
 Henrik

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


RE: AJAX for JSF

2006-09-13 Thread Adam Brod

Avatar / Dynamic Faces is not
production ready (see the website: jsf-extensions.dev.java.net). However,
it does have the backing of many JSF spec members. The Ajax4Jsf team
is working with the jsf-extensions team and they have committed to being
compatible in the future. So Ajax4Jsf is a great place to start right
now.

Adam Brod
Product Development Team






Frank Russo
[EMAIL PROTECTED] 
09/12/2006 03:59 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
RE: AJAX for JSF








What about the JSF-Extensions project? Isn't the Avatar
solution there
closer to what will be in the future spec? If so, I think it might be
better to start with that. Does anyone know if it is production ready,
though? That would be my only concern...

Frank Russo
Senior Developer
FX Alliance, LLC


-Original Message-
From: Aleksei Valikov [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 12, 2006 11:21 AM
To: MyFaces Discussion
Subject: Re: AJAX for JSF

Hi.

 AJAX and JSF can definitely work together, but it's tricky because

 AJAX can't be added incrementally; it has to be built into the JSF

 components themselves.

ajax4jsf is capable of adding AJAX functionality to the existing JSF
components. 
That's the incremental addition you talk about.

 You might also want to some commercial JSF frameworks that support
AJAX. 
 I've looked at ICEfaces a little and it seemed like it was on
the 
 right track. There may be something along those lines in Oracle
ADF 
 at some point as well. And the status of the open-source ones
seem to

 change monthly if not weekly.

ICEFaces has a pretty nice idea that, I think, can be adapted. They hav
so-called direct-to-DOM render kit. That is, components are rendered not
as plain text but as a DOM tree. This allows easily identify subtrees
that have to be synchronized with the client. What client sees in his
browser is just a replication of the server-side DOM tree, synchronized
via AJAX.

ajax4jsf uses a different approach. When you use AJAX controls from
ajax4jsf or ajaxify existing controls with their a4j:support, you
provide (1) hook onto client-side event that triggers AJAX
synchronization and (2) (possibly via value
binding) a ids of the components which have to be rerender. Server-side
AJAX handler then renders selected components and sends the result back
to the browser.

The only problem with existing controls is that they need to be rendered
as valid XML in order to be transferrable and parseable on the client
side. 
ICEFaces solves this problem with own render kit (if you render DOM,
it's already valid XML after all), ajax4jsf uses JTidy filter to clean
up possibly malformed XML produced by components and their renderers.

By the way, requiring HTML but not XHTML was in my point of view an
awful decision. Otherwise all the JSF component were ajaxifiable out of
the box.

Bye.
/lexi




Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Does myface supports jsf 1.2

2006-09-12 Thread Adam Brod

Is there anywhere public that the MyFaces
community publishes their planned release schedules? Something similar
to what eclipse does would be terriffic. http://www.eclipse.org/eclipse/development/eclipse_project_plan_3_3.html

That would really help people such as
me plan ahead for releases.

Thanks,

Adam Brod
Product Development Team


Martin Marinschek [EMAIL PROTECTED]
wrote on 09/11/2006 11:31:01 AM:

 Longer answer: work is in progress, but we're not there yet.
 
 regards,
 
 Martin
 
 On 9/11/06, Gerald Müllan [EMAIL PROTECTED] wrote:
  Hi,
 
  short answer: currently No :)
 
  cheers,
 
  Gerald
 
  On 9/11/06, David Delbecq [EMAIL PROTECTED] wrote:
   Title says it all :) Does svn version of myfaces supports
JSF 1.2? There
   are quite some interesting new tag properties to h:panelGroup
i'd like
   to use, but it seems my tld is the 1.01 one.
  
 
 
  --
  Gerald Müllan
  Schelleingasse 2/11
  1040 Vienna, Austria
  0043 699 11772506
  [EMAIL PROTECTED]
 
 
 
 -- 
 
 http://www.irian.at
 
 Your JSF powerhouse -
 JSF Consulting, Development and
 Courses in English and German
 
 Professional Support for Apache MyFaces

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: AJAX for JSF

2006-09-12 Thread Adam Brod

Ajax4Jsf is really good. The DynamicFaces
project in jsf-extensions is very promising, but it isn't ready to be used
in a real application yet.

I really think Ajax4Jsf is your best
bet if you want to develop JSF + Ajax today.

Adam Brod
Product Development Team


Stephen Osella [EMAIL PROTECTED]
wrote on 09/12/2006 09:18:48 AM:

 Is there a good (i.e., working!) AJAX for JSF framework? I have
tried 
 AjaxAnywhere and Ajax4jsf with varying degree (but not complete) success.

 Your opinion and recommendations would be greatly appreciated. 
 

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Can I override a Redirect?

2006-08-07 Thread Adam Brod

Hi-

I am trying to set up an error page
in MyFaces. I have a PhaseListener that is invoked before the Render
Phase. If the PhaseListener finds any errors, it sends the user to
the error page. However, this is not working because the action that
executes before the Render Phase is a redirect. Even though my PhaseListener
has the correct logic to invoke NavigationHandler.handleNavigation() and
then call FacesConfix.renderResponse(), the user is going to the error
page.

For example, the user is on the UpdateDocument
page and they hit the save button. The navigation rule says that
the user should next go to the DocumentList page with a redirect. However,
after the InvokeApplication phase and before the Render phase, my PhaseListener
commits the transaction and gets a Transaction Rollback error. At
this point, my PhaseListener calls the NavigationHandler to override
the redirect to DocumentList with a command to go to the Error page. But
it doesn't work - the user always goes back to the DocumentList and the
error is swallowed.

As far as I can tell, this is because
in NavigationHandlerImpl line 131 (MyFaces 1.1.3), externalContext.redirect()
is called. Somehow, even though I later call the NavigationHandler
again to go to the error page, it doesn't happen.

Does anybody know how I can override
the original redirect and force the user to the error page?

Thanks,

Adam Brod
Product Development Team

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Ajax4JSF + MyFaces + Facelets issue

2006-07-27 Thread Adam Brod

Hi Raj-

If you post this to [EMAIL PROTECTED]
I bet you'll get a response. The a4j team is very active there.

Did you try to download the aj4-simpleRepeatorFacelets
war? https://ajax4jsf.dev.java.net/nonav/ajax/ajax-jsf/download.html#examples

That one works for me (although I'm
on MyFaces 1.1.3 and Facelets 1.1.11).

Adam Brod
Product Development Team




Raj Rajendran
[EMAIL PROTECTED] 
07/27/2006 01:19 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Ajax4JSF + MyFaces + Facelets
issue








I posted this in the Exadel forum, but didn't get any
response back. 
Hre is my question:
===
I am trying to get the Repeater Ajax4JSF demo working, using MyFaces/Tomahawk
1.1.4, Facelets 1.0.10 
It doesnot work. 

Looking at the generated html, and the first line was like this: 
script src="">null
type=text/_javascript_!-- 

//-- 

Please note that there is a null appended to AjaxScript, which
I think is the cause of the problem. Why is this happening and how can
I avoid it ? 
Any ideas, please ? 

Thanks !!!

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: MyFaces Tomahawk + JSF 1.2 + Facelets + Tomcat

2006-07-27 Thread Adam Brod

I'm holding out for the MyFaces JSF
1.2 implementation. I know there is a 1.2 branch with activity already,
but I don't think there is a planned release date, unfortunately. I
don't think the JSF 1.2 Reference Implementation has a very active open
source community - at least their mailing lists are not used much.

I did try out JSF 1.2 + Facelets on
another J2EE 1.4 container (weblogic) and it appeared to work okay. I
didn't try Tomahawk though.

Adam Brod
Product Development Team




Andrew Robinson
[EMAIL PROTECTED] 
07/27/2006 01:24 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
MyFaces Tomahawk + JSF 1.2
+ Facelets + Tomcat








Just looking for feedback on people's experiences
with the following
environment (or similar):

Tomcat 5.5.x
JSF 1.2
Facelets 1.1.x
MyFaces Tomahawk 1.1.3

I am currently on MyFaces Core  Tomahawk, but I am looking to further
enhance my AJAX support in my application and Ajax4jsf looks really
nice (Currently using AjaxAnywhere which is not as robust). However,
it looks like I would gain quite a bit of benefit for running on JSF
1.2 which MyFaces doesn't support.

With Tomahawk 1.1.3 (1.1.2 had problems with commandLink and
commandButton that I know of) and beyond it is supposed to be
technically
possible to run with the RI, but am curious what people have
experienced so far.

Thanks,
Andrew

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Navigation problems with FACELETS

2006-07-26 Thread Adam Brod

Hi Jorge-

Welcome to Facelets! I'm sure
that we'll be able to get you through your current issue.

First, I would make sure that you have
h:messages
showDetail=true
/
defined on your login page. There might be a validation/model update
problem that isn't being displayed.

Secondly, I would make sure that you
have the facelets.DEVELOPMENT parameter defined in your web.xml:
context-param
  param-namefacelets.DEVELOPMENT/param-name
  param-valuetrue/param-value
 /context-param

Often that will ensure you get a good
error message.

If those don't work, are you sure your
action method is being invoked? Perhaps you could send the details
of your login page so we can ensure that everything looks okay.

I hope that helps.

Adam Brod
Product Development Team




Jorge Vásquez [EMAIL PROTECTED]

07/26/2006 02:07 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Navigation problems with
FACELETS








Greetings to all,
Alter having many problems with JSP+JSF I
decided to give it a try with Facelets. Everything started fine,
my login page appeared on screen and I was starting to get excited but
unfortunately in our profession excitement doesn´t lasts much and I am
getting problems with navigation where I get no message at all, no log,
etc. I followed the application in debug mode and after clicking
the submit button it went to the corresponding action method in the managed
bean and reached the end and returned the respective String which in the
faces-config is mapped to another page but nothing happens and the same
page is reloaded with no message at all. Here I confess that I am
completely lost, how can I debug this? Has anyone had a similar problem
with MyFaces+Facelets? 
Regards,
JV
Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Facelets

2006-07-26 Thread Adam Brod

If you search the mailing list, you'll
see there is some evidence that Facelets performs a decent amount faster
than JSP. Also, there was a JavaOne presentation with Jacob Hookom
and Adam Winer with some performance benchmarks showing Facelets outperforming
JSP. I believe all JavaOne presentations are now online on the java.net
website. The title was something like Ajax done right..

HTH,

Adam Brod
Product Development Team




Colin Chalmers [EMAIL PROTECTED]

07/26/2006 02:07 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion users@myfaces.apache.org


cc



Subject
Facelets








Hi all,

I've recently just *discovered* facelets.

This has probably come just at the right time. After choosing the JSF 
path approx. a year ago our Java developers have gained much valuable 
experience but alas our design boys keep resisting due to the lack of 
freedom they have when working with default JSF. The advent of facelets

and the templating possibilities has renewed their enthousiasm and we 
have them back on board :-)

HoweverI'm worried that by choosing facelets we'll be riding that 
bleeding edge wave again with all it's up's  downs. Great for POC's
but 
bad when you have a strict deadline.

My question is really if there are many others using facelets, what 
their experience is and specifically how it performs??

THX

Colin

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Facelets

2006-07-26 Thread Adam Brod

Facelets is production ready. You
will most likely encounter many more bugs (or perceived bugs) using JSP
than Facelets.

I don't know how to use JSP and Facelets
together. You might try the Facelets user mailing list.

Adam Brod
Product Development Team




Colin Chalmers [EMAIL PROTECTED]

07/26/2006 02:47 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion users@myfaces.apache.org


cc



Subject
Re: Facelets








Guys,

I appreciate the feedback and am glad there are others successfully 
implementing facelets. One comment I received was that facelets was too

experimental!?

I have already downloaded the examples and got them working in minutes
:-)

Should we decide to migrate an older project to facelets is it possible

to use the two view technologies side-by-side so we could migrate page

by page?
I'm sure I saw something regarding setting a default view tech. in the

context?

Colin

Andrew Robinson wrote:

 My experience is that development with facelets over JSP-JSF is much

 faster and saves a lot of time (complex controls, templating, 
 functions, etc. are all extremely time consuming or impossible with

 JSF on JSF). In addition, perforamnce is better. So your timeline

 should be less and your code faster. I still wonder why anyone would

 want to use JSF without Facelets except possibly when converting a

 legacy JSP application to JSF.

 On 7/26/06, *Adam Brod* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:


   If you search the mailing list, you'll see there is
some evidence
   that Facelets performs a decent amount faster than JSP.
Also,
   there was a JavaOne presentation with Jacob Hookom and
Adam Winer
   with some performance benchmarks showing Facelets outperforming
   JSP. I believe all JavaOne presentations are now
online on the
   java.net http://java.net website. The
title was something like
   Ajax done right..

   HTH,
   *
   Adam Brod*/
   Product Development Team/

   *Colin Chalmers [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]*

   07/26/2006 02:07 PM
   Please respond to
   MyFaces Discussion users@myfaces.apache.org
   mailto:users@myfaces.apache.org


 
 
   To
 
 MyFaces Discussion  users@myfaces.apache.org
   mailto:users@myfaces.apache.org
   cc
 
 
   Subject
 
 Facelets



 
 





   Hi all,

   I've recently just *discovered* facelets.

   This has probably come just at the right time. After
choosing the JSF
   path approx. a year ago our Java developers have gained
much valuable
   experience but alas our design boys keep resisting due
to the lack of
   freedom they have when working with default JSF. The
advent of
   facelets
   and the templating possibilities has renewed their enthousiasm
and we
   have them back on board :-)

   HoweverI'm worried that by choosing facelets we'll
be riding that
   bleeding edge wave again with all it's up's  downs.
Great for
   POC's but
   bad when you have a strict deadline.

   My question is really if there are many others using
facelets, what
   their experience is and specifically how it performs??

   THX

   Colin

Disclaimer: This electronic mail and any attachments are confidential
and may be privileged. If you are not the intended recipient, please notify
the sender immediately by replying to this email, and destroy all copies
of this email and any attachments. Thank you.


  




Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


RE: Navigation problems with FACELETS

2006-07-26 Thread Adam Brod

Well, everything looks correct to me.
It might be that some exception somewhere is getting swallowed. Do
you have your logging set up? Sometimes MyFaces swallows and logs
certain exceptions that makes debugging difficult. If not, you should
make sure you have commons-logging.jar and log4j.jar in your WEB-INF/lib
directory. Then in WEB-INF/classes/log4j.properties you should have
something like what I have below. Otherwise, you can do the painful
debugging of just stepping through the execution of NavigationHandlerImpl.handleNavigation(...).
That method should be getting alero.altSearch
as the outcome and finding the next page and rendering it. It appears
that something must be going wrong in there.

I hope this helps you isolate your problem.

log4j.rootLogger=WARN, stdout

log4j.logger.org.apache.myfaces
= INFO
log4j.logger.javax.faces
= INFO
log4j.logger.org.ajax4jsf
= INFO

#***
# Appender stdout
#***
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601}
%-5p %c - %m%n


Adam Brod
Product Development Team




Jorge Vásquez [EMAIL PROTECTED]

07/26/2006 03:45 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
'MyFaces Discussion'
users@myfaces.apache.org


cc



Subject
RE: Navigation problems with
FACELETS








Hi Adam,
Thanks for your kind welcome
to Facelets and your valuable help.
I currently have the messages
in my page as follows:

h:messages
errorClass=errorMessage
globalOnly=false
showDetail=true
lang=en
/


There´s one important note
and is that the action method is getting executed and as I remember the
validation and conversion phases happen before so I guess that my problem
is directly related with navigation or probably library stuff.

I also have the following lines
in my web.xml:

context-param
 param-namejavax.faces.DEFAULT_SUFFIX/param-name
 param-value.xhtml/param-value
/context-param
.
context-param
 param-namefacelets.DEVELOPMENT/param-name
 param-valuetrue/param-value
/context-param

context-param
 param-namecom.sun.faces.validateXml/param-name
 param-valuetrue/param-value
/context-param
context-param
 param-namecom.sun.faces.verifyObjects/param-name
 param-valuetrue/param-value
/context-param

I have carefully followed all
the guidelines suggested in the developer documentation.

My faces-config.xml rule is
as follows:

navigation-rule
 from-view-id/pages/logon.xhtml/from-view-id
 navigation-case
 from-outcomealero.altSearch/from-outcome
 to-view-id/pages/tools/search/mainSearch_TRIAL.xhtml/to-view-id
 /navigation-case
/navigation-rule
navigation-rule

I am 100% sure that the action
of the managed bean is getting executed, I followed it until the last line
and it returns the String: alero.altSearch.
And it returns back to the login.xhtml. By the way, all my files
have the extension: *.xhtml accordingly. Something to note
is that at first I was getting an exception related to some factory stuff,
which I googled and found that it was related to the el-ri.jar library
not being compatible with jdk1.4 and from a mailing list I saw that someone
had solved a similar problem by getting Exadel´s corresponding library,
and after using it the login page finally appeared but now I have this
problem with the navigation. 
As you see I am feeling kind
of blind here, do you have any ideas as to how to debug it? 

In case it helps this is my
environment:

TOMCAT_VERSION: 5.0
(The one embedded with Exadel Studio PRO 3.5.1)

JDK: j2sdk1.4.2_12

LIBRARIES:
-myfaces-api-1.1.4-SNAPSHOT.jar
-myfaces-impl-1.1.4-SNAPSHOT.jar
-commons-beanutils-1.7.0.jar
-commons-codec-1.3.jar
-commons-collections-3.1.jar
-commons-digester-1.6.jar
-commons-el-1.0.jar
-commons-fileupload-1.1.1.jar
-commons-lang-2.1.jar
-commons-logging-1.0.4.jar
-el-api.jar
-el-ri.jar
-jsf-facelets.jar
-log4j-1.2.13.jar
-tomahawk-1.1.5-SNAPSHOT.jar
-portlet.jar
-alerolib.jar
-ajaxanywhere-1.2-RC2.jar


Regards,
JV










De: Adam Brod [mailto:[EMAIL PROTECTED]

Enviado el: miércoles, 26 de julio de 2006 13:18
Para: MyFaces Discussion
Asunto: Re: Navigation problems with FACELETS


Hi Jorge- 

Welcome to Facelets! I'm sure that we'll be able to get you through
your current issue. 

First, I would make sure that you have h:messages
showDetail=true
/
defined on your login page. There might be a validation/model update
problem that isn't being displayed.


Secondly, I would make sure that you have the facelets.DEVELOPMENT parameter
defined in your web.xml: 
context-param

  param-namefacelets.DEVELOPMENT/param-name

  param-valuetrue/param-value

 /context-param


Often that will ensure you get a good error message.


If those don't work, are you sure your action method is being invoked?
Perhaps you could send the details of your login page so we can ensure
that everything looks okay.


I hope that helps.

Adam Brod
Product

[OT] Looking for JSF/MyFaces Consultant in Boston

2006-07-21 Thread Adam Brod

Hi-

We are looking for a Boston-based consultant
with strong JSF/MyFaces experience to join our team for a six month contract
starting right away.

If you are interested, please send an
email directly to me with your resume and any information.

Thanks,
Adam Brod
Product Development Team

PS - ASF is okay with this type of message
as long as it is marked off-topic [OT]


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Can I set default f:convertDateTime dateStyle?

2006-07-20 Thread Adam Brod

Hi-

We display dates all over our site with
a short dateStyle. Is there a way I can change the default
value for the f:convertDateTime dateStyle? I really don't want to
have to put f:convertDateTime
type=date
dateStyle=short
/
in lots of places all over my pages.

Thanks for any tips!

Adam Brod
Product Development Team

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: swalled exception

2006-07-18 Thread Adam Brod

I agree. This was a huge problem
for me. I lost many hours because MyFaces was logging errors that
I couldn't find. For what it's worth, if you have log4j.jar in WEB-INF/lib
and log4j.properties in WEB-INF/classes with these values, you'll see the
errors.

log4j.rootLogger=WARN, stdout

log4j.logger.org.apache.myfaces = INFO
log4j.logger.javax.faces = INFO

#***
# Appender stdout
#***
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601}
%-5p %c - %m%n

Adam Brod
Product Development Team




Iordanov, Borislav
\(GIC\) [EMAIL PROTECTED] 
07/17/2006 01:22 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
swalled exception








Hi guys,

Im sure there is a way to configure logging
so that this doesnt happen, but by default I notice tons of swallowed
exceptions in MyFaces. The resulting behavior obviously is that something
doesnt work and theres no indication why. Regardless of logging the
error and of my not having spent a few hours figuring out how to configure
MyFaces logs, I think it is unacceptable behavior for the application to
continue to run after a fatal error. An example of a fatal error is an
NPE thrown from a property setter during the update model values request
processing phase. Such errors should be propagated to the servlet container
so that I can eventually see a stack trace on my browser  very convenient
during development. 

Regards,
Bolerio
Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


RE: [newbie] MyFaces or Barracuda ??

2006-07-13 Thread Adam Brod

Here is an example of mapping to a maven1
repo in maven2. You need the legacy element.


   repository

   idjava.net/id

   namejava.net/name

   urlhttps://maven-repository.dev.java.net/nonav/repository/url

   snapshots

   
   enabledtrue/enabled

   /snapshots

   layoutlegacy/layout

   /repository

HTH,

Adam Brod
Product Development Team




Frank Russo
[EMAIL PROTECTED] 
07/13/2006 08:37 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
RE: [newbie] MyFaces or Barracuda
??








To be clear, this is a maven 1
repository. If you are using maven 2, this may not be usable. I have read
that m2 can use m1 repos, but I haven't found any docs on how. Maybe someone
can post a link if they know of one.

My 2 cents on your original question
is that barracuda is not the way to go, mainly for the reason that very
few people are using it. Support for it is probably minimal. JSF vs Struts
or Spring Web is a better question. I'd go JSF, whether it be MyFaces or
Sun RI, for the reason that you may be more comfortable with it coming
from an M$ background. Correct me if I'm wrong, but I think a component
based framework like JSF is closer to building Active X web controls than
using some kind of action framework like Struts. 

My other recommendations would
be Tomcat for the app server. If you need transaction management and persistence,
I'd recommend Spring and Hibernate over JEE 5. Older J2EE shouldn't even
be a consideration for a new project at this point...
Frank Russo
Senior Developer
FX Alliance, LLC



From: Mikael Andersson [mailto:[EMAIL PROTECTED]

Sent: Thursday, July 13, 2006 5:15 AM
To: MyFaces Discussion
Subject: Re: [newbie] MyFaces or Barracuda ??

To get started I would recommend giving the myfaces maven
archetype a go, that will give you basic web application to get started
with and uses the Jetty6 web container, which is really nice when developing
(allows you to do this to start the web applciation 'mvn jetty6:run').


Then I would have a look at Facelets, which is easily integrated ( facelets
is also in dev.java.net's
maven repository; https://maven-repository.dev.java.net/repository/
).

- Mike

On 12/07/06, Cyrille37 [EMAIL PROTECTED]
 wrote: 
Hello,

I'm exploring Java solutions for a new Web Application project. 

I'm coming from ASP.Net but for the new starting project, the first rule
is plateform portability, so Java is the solution.

Unfortunately, unlike .Net, Java for Web Application is not delivered as
a package. So I've to make an assembly of solutions to get an 
environment for creating the Web Application.

After surfing onto Java/J2EE projects, I've selected some nice stuff :
  - App Server : Enhydra
  - Framework : here is my interogation, MyFaces or Barracuda
?? 
  - What else is needed for a strong and well formed Web Application
??

I guess you have opinion on that question ...

Please, share your mind ;o)
Thanks
Cyrille.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: [newbie] MyFaces or Barracuda ??

2006-07-12 Thread Adam Brod

My guess is MyFaces has a much, much
larger market share than Barracuda.

Adam Brod
Product Development Team




ldr [EMAIL PROTECTED]

07/12/2006 04:22 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Re: [newbie] MyFaces or Barracuda
??









MyFaces is absolute crap...


No just kidding, don't know about barracuda, but Im thrilled about how
one
can build webapplications fast with easy backend interoperability.

chris
-- 
View this message in context: http://www.nabble.com/-newbie--MyFaces-or-Barracudatf1932758.html#a5296748
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: How to call JSF method binding expressions from a java script.

2006-07-12 Thread Adam Brod

Here is the Shale Remoting documentation:

http://struts.apache.org/struts-shale/shale-core/apidocs/org/apache/shale/remoting/package-summary.html

I don't know why it isn't on the proper
website as well.

Adam Brod
Product Development Team




Andrew Robinson
[EMAIL PROTECTED] 
07/12/2006 05:52 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: How to call JSF method
binding expressions from a _javascript_.








There is no built in way. You have to invoke an AJAX
call to the
server, setup the Faces context, possibly restore your view then
evaluate the EL.

There is a Remote set of APIs in JBoss-Seam that let you do
things
like this. There may be other frameworks that have similar
functionality as well that I am not familiar with (I think Shale
might, but there remoting feature is not documented at all on their
site)

-Andrew

On 7/12/06, ved.gunjan [EMAIL PROTECTED] wrote:

 Hi Experts
 How to call JSF method binding expressions from a _javascript_.
 For example i want to call == action="">
 of a command link from _javascript_.

 Waiting for the experts reply.
 Thanks


 __
 Do You Yahoo!?
 Tired of spam? Yahoo! Mail has the best spam protection around
 http://mail.yahoo.com

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Send to error page from PhaseListener

2006-07-10 Thread Adam Brod

Hi-

I have a PhaseListener that does some
business logic. If there is a RuntimeException, I want to automatically
redirect to my error page. With my PhaseListener, if it throws a
RuntimeException, the exception is swallowed and logged in PhaseListenerManager.informPhaseListenersAfter(...).


What is the best way to redirect all
such errors to the error page? In standard Servlets land, you just
declare the exception and the error page in the web.xml file. That
is done once, and it works for the entire web-app. Is there another
way to support this in JSF with PhaseListeners?

Thanks,

Adam Brod
Product Development Team

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Send to error page from PhaseListener

2006-07-10 Thread Adam Brod

Thanks for responding. Unfortunately
that doesn't work for PhaseListeners because MyFaces PhaseListenerManager
swallows the exception without allowing the Servlet container to redirect
to the error page (specified in web.xml).

Perhaps I should log this as an issue
in MyFaces?

Adam Brod
Product Development Team




Cagatay Civici
[EMAIL PROTECTED] 
07/10/2006 12:51 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: Send to error page from
PhaseListener








This could help;

http://wiki.apache.org/myfaces/Handling_Server_Errors

Cagatay


On 7/10/06, Adam Brod [EMAIL PROTECTED]
wrote:

Hi- 

I have a PhaseListener that does some business logic. If there is
a RuntimeException, I want to automatically redirect to my error page.
With my PhaseListener, if it throws a RuntimeException, the exception
is swallowed and logged in PhaseListenerManager.informPhaseListenersAfter(...).
 

What is the best way to redirect all such errors to the error page? In
standard Servlets land, you just declare the exception and the error page
in the web.xml file. That is done once, and it works for the entire
web-app. Is there another way to support this in JSF with PhaseListeners?


Thanks, 

Adam Brod
Product Development Team
Disclaimer: This electronic mail and any attachments
are confidential and may be privileged. If you are not the intended recipient,
please notify the sender immediately by replying to this email, and destroy
all copies of this email and any attachments. Thank you.



Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: What supports JSF 1.2?

2006-06-30 Thread Adam Brod

From what I know, there aren't any annotations
in the JSF 1.2 spec. If you want Annotations, you can use Shale-Tiger
with JSF 1.1 - those work great.

Adam Brod
Product Development Team




octoberdan [EMAIL PROTECTED]

06/30/2006 12:58 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
What supports JSF 1.2?









Does stable support 1.2 and all the nifty anotations? Nightly?
-- 
View this message in context: http://www.nabble.com/What-supports-JSF-1.2--tf1871288.html#a5114729
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Does MyFaces 1.1 support annotations?

2006-06-30 Thread Adam Brod

If you want Annotations with JSF 1.1
(MyFaces 1.1.x), check out Shale Tiger.

Adam Brod
Product Development Team




msksatish [EMAIL PROTECTED]

06/30/2006 12:41 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Does MyFaces 1.1 support
annotations?









Is there support for annotations from Backing Beans with MyFaces; Wat
additional annotation related features would be present in JSF 1.2
-- 
View this message in context: http://www.nabble.com/Does-MyFaces-1.1-support-annotations--tf1874152.html#a5123418
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: ajax4jsf

2006-06-30 Thread Adam Brod

Ajax4Jsf has far and away the best Ajax-JSF
integration that I've seen. Every other solution that has been released
requires the JSF developer to write a lot of _javascript_. 

The jsf-extensions project has some
really cool Ajax-JSF stuff they are working on, but they haven't released
anything yet, so they are behind Ajax4Jsf.

Adam Brod
Product Development Team




Gregg Bolinger
[EMAIL PROTECTED] 
06/30/2006 11:27 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
ajax4jsf








I am curious to know if anyone has used or is currently
using this library and their general thoughts on it along side MyFaces
components. I have downloaded it and am in the process of adding
it to my project to do some initial testing. 

Thanks for any feedback.

Gregg
Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: A question about using Facelets with Tomahawk wiki entry.

2006-06-30 Thread Adam Brod

For example, I believe that UpdateActionListener
is not yet defined in tomahawk.taglib.xml because the JSP Tag for that
component has some special logic.

Facelets now provides the f:setPropertyActionListener
component (back-ported from JSF 1.2), so you really don't need UpdateActionListener
in Facelets, afaik.

Adam Brod
Product Development Team




Mike Kienenberger
[EMAIL PROTECTED] 
06/30/2006 04:18 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: A question about using
Facelets with Tomahawk wiki entry.








On 6/30/06, Todd Patrick [EMAIL PROTECTED]
wrote:
 Therefore, do I just copy the example content on the
 http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk into my
 tomahawk.taglib.xml?

Yep.


 What does the following statement mean?

 Please add additional component definitions to this example
as you use
 them (in alphabetical order). To find the component and renderer types,
 look at the getComponentType() and getRendererType() methods in the
Tag
 class for the component. If the Tag class does anything other than
 providing pass-through getters and setters, you will need to write
a
 facelets TagHandler or submit patches to MyFaces to standardize
the
 tag handler.

When I started the page, there were no taglib definitions.  As
people have used the various tomahawk components, they've added new
definitions for each component to the page.  I suspect we're getting
closer to the point where we have everything defined.  The above
statements are instructions on how to create a new entry for a missing
component.

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: custom pagination question

2006-06-19 Thread Adam Brod

Hi James-

If you use Facelets with MyFaces 1.1.3,
then you'll have the full unified EL. :)

Adam Brod
Product Development Team




James Richards
[EMAIL PROTECTED] 
06/16/2006 12:32 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
custom pagination question









Is it correct to assume, based upon the following:

http://mail-archives.apache.org/mod_mbox/myfaces-dev/200605.mbox/%3c30773=
[EMAIL PROTECTED]

that Unified EL is not supported in MyFaces 1.1.3? If that's true,
I =
have an interesting question:

I have a custom scrolling implementation which is somewhat working but
=
is losing its state during certain view actions. I would like to
be =
able to declaratively attach one visual component to another to resolve
=
the problem properly. For example, I have a=20

z:paginationState id=3DpaginationState bean=3D#{facilityForm}/
z:customPaginationDataTable id=3DfacilityLedgerData
  
  
   styleClass=3Ddata
  
  
   rowClasses=3DoddRow,evenRow
  
  
   =
columnClasses=3Dwidth125,width100,width100,width100,width100,width300,bu=
ttons
  
  
   footerClass=3Dfooter
  
  
   var=3Dentry
  
  
   rows=3D#{facilityForm.ledgerHandler.rows}
  
  
   value=3D#{facilityForm.ledgerModel}
  
  
   cellspacing=3D1
  
  
   width=3D100%
  
  
   preserveSort=3Dtrue
  
  
   rowIndexVar=3Dindex
% /* ... */ %
/z:customPaginationDataTable

What I would *like* to be able to do is attach the paginationState =
directly to the custom table using something like

z:paginationState id=3DpaginationState =
bean=3D#{facilityLedgerData}/

So that the facilityLedgerData can query its pagination state. When
the =
scroller fires an scrolling event, custom pagination for the table will
=
be disabled until a new view is created.

I tried this on 1.1.1 and it didn't work so I used a very ugly hardcoded
=
approach of locating the scroller and the pagination state in Java code
=
via the ViewRoot and then attaching the pagination state to the scroller
=
as an ActionListener.

What I would like to do is be able to add the paginationState to the =
scroller using something like actionListener=3D#{paginationState}
but =
it seems that I would need Unified EL to do this? I tried this out
on =
1.1.1 but it didn't work, though I could attach a backing bean as an =
action listener.

Is there any way to declaratively, in the JSF, bind one UI Component to
=
another?

This solution:

http://www.mail-archive.com/users@myfaces.apache.org/msg16266.html

is not what I am looking for.

Thanks,

James 
Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


How do I enabled logging?

2006-06-13 Thread Adam Brod

Hi-

I am having a problem where MyFaces
catches a serious error and logs it to log.error(). How do I configure
my logging so that those error messages go to the console window?

In my log4j.properties I tried putting
org.apache.myfaces = INFO,
but that didn't seem to help.

Thanks for any help.

Adam Brod
Product Development Team

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: How do I enabled logging?

2006-06-13 Thread Adam Brod

Well, I got it working. I put
log4j.properties in my WEB-INF/classes directory. Inside the properties
file I have this:

log4j.rootLogger=WARN, stdout

log4j.logger.org.apache.myfaces = INFO,
stdout
log4j.logger.javax.faces = INFO, stdout

#***
# Appender stdout
#***
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601}
%-5p %c - %m%n

I can't say that this is the best way
to do it, but it work for me.

Adam Brod
Product Development Team




Adam Brod [EMAIL PROTECTED]

06/13/2006 09:12 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
How do I enabled logging?









Hi- 

I am having a problem where MyFaces catches a serious error and logs it
to log.error(). How do I configure my logging so that those error
messages go to the console window? 

In my log4j.properties I tried putting org.apache.myfaces
= INFO, but that didn't seem to help.


Thanks for any help.

Adam Brod
Product Development Team
Disclaimer: This electronic mail and any attachments
are confidential and may be privileged. If you are not the intended recipient,
please notify the sender immediately by replying to this email, and destroy
all copies of this email and any attachments. Thank you.

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Problems With saveState

2006-06-13 Thread Adam Brod

Do you have other Tomahawk components
working with Facelets? Have you configured the Tomahawk libraries
? http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk Perhaps
the t:saveState isn't even being rendered?

That's about all I can think of.

Adam Brod
Product Development Team




octoberdan [EMAIL PROTECTED]

06/13/2006 12:02 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Re: Problems With saveState









The backing bean is serializable and worked before I implemented Facelets
--
View this message in context: http://www.nabble.com/Problems-With-saveState-t1780890.html#a4849505
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Problems With saveState

2006-06-13 Thread Adam Brod

Do you have a h:messages component defined
so you'll be notified if there are any conversion errors?? I'm just
trying to come up with ideas...

Adam Brod
Product Development Team




octoberdan [EMAIL PROTECTED]

06/13/2006 04:47 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Re: Problems With saveState









Alright! Latest development: The action method #{pcwBacker.enableStepThree}
isn't being called! What that means... no clue. But that's also the point
of
failure.
--
View this message in context: http://www.nabble.com/Problems-With-saveState-t1780890.html#a4854073
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


When will Maven Repository have latest releases?

2006-06-08 Thread Adam Brod

Hi-

Is there an update for when the maven
repository will have core 1.1.3 and tomahawk 1.1.2?

Short of that, would it be possible
to upload the source drops to the download page? We need to upgrade
to MyFaces 1.1.3 and we want to be able to debug in the source code. However,
installing an SVN client and setting up the project is a real hassle.

I imagine there are other people that
are evaluating MyFaces and are turned away from a project that requires
so much effort to get the source code to the current release. I don't
mean for this just to be a complaint, I think it is important for the success
of the project. For MyFaces to continue to increase its adoption
rate, it is really important to be easy to download, distribute and learn.


Adam Brod
Product Development Team

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: MyFacesExtensionsFilter?

2006-06-08 Thread Adam Brod

I have seen some Sun documentation where
they are trying to recommend .jsf as a new file extension for
jsp files that contain JSF components (just like they recommend the .jspf
extension for jsps that are fragments). That of course is very confusing
since many people use the .jsf as a virutal mapped extension in their webapps.

Ugh. 

We use .faces since it is easy to diambiguate
from .jsp.

Adam Brod
Product Development Team




John Ruffin [EMAIL PROTECTED]

06/08/2006 01:57 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Re: MyFacesExtensionsFilter?









That's why they pay you the big buck$ :-). You are correct, I changed
it to
.jsp from .jsf and it worked.

The reference page needs to be updated - it has .jsf - I copied from that
page.

filter-mapping
  filter-nameMyFacesExtensionsFilter/filter-name
  url-pattern*.jsp/url-pattern
/filter-mapping
--
View this message in context: http://www.nabble.com/MyFacesExtensionsFilter--t1756467.html#a4777515
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Version of Servlet Container - Facelets

2006-05-30 Thread Adam Brod

2 - Facelets is great!

Adam Brod
Product Development Team




Martin Marinschek
[EMAIL PROTECTED] 
05/28/2006 12:09 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org, MyFaces Development dev@myfaces.apache.org


cc



Subject
Version of Servlet Container
- Facelets








May I ask a question out loud?

In discussing implementing 1.2, the question has arisen what kind of
servlet containers most users have in use currently respectively plan
to use in the next half year.

Can you answer with the corresponding number to help us figure out an
optimal way of going on with the 1.2 implementation?

(for me personally it's 1 - I can't change over my current project to
facelets this easily, and this is why I'm stuck with number 1)

regards,

Martin

1) TC 5.x (or other not JSP 2.1 compliant)
2) TC 5.x (or other not JSP 2.1 compliant) with facelets (or willing
to change their current projects to facelets, if necessary)
3) TC 6 or Glassfish (or other JSP 2.1 compliant)

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Maven Repo with 1.1.3?

2006-05-25 Thread Adam Brod

Hi-

Do I have something configured wrong? I don't see MyFaces 1.1.3 on
the standard ibiblio maven repository. I tried browsing the repository
and I only see version 1.1.2: http://www.ibiblio.org/maven2/org/apache/myfaces/core/myfaces-api/

Here's what's in my pom file.

  
 dependency

groupIdorg.apache.myfaces.core/groupId

artifactIdmyfaces-api/artifactId

version1.1.2/version

scopecompile/scope

   /dependency


   dependency

groupIdorg.apache.myfaces.core/groupId

artifactIdmyfaces-impl/artifactId

version1.1.2/version

scopecompile/scope

   /dependency

Any ideas?

Adam Brod
Product Development Team




John [EMAIL PROTECTED]

05/25/2006 03:34 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Tobago sheets don't gridLayout
with other components?








It seems that sheets don't participate in
a gridLayout like normal components.
When a sheet is involved (even when wrapped
in a cell), it seems to break the gridLayout and the components (including
the sheet) are layed out as if no layout existed.

John
Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: JSF Backing Bean Unit Testing

2006-05-15 Thread Adam Brod

Hi Murat-

I agree with what Dave B. said - Unit
Testing is very different from Integration Testing. I have found
that it is best to start with Unit Testing where you are testing an individual
method or class (a unit) in isolation from all other objects. Therefore,
you should mock/stub out the other frameworks and classes that are used
by the backing bean you are testing.

Once you have good unit testing coverage
and know that your backing bean does what you want it to, then you can
build larger Integration Tests that test the interactions between the backing
bean and the hibernate daos. If you start with Integration Testing,
it is much more difficult to isolate bugs in your code because for any
given test, there is lots of code being executed.

I hope this helps,

Adam Brod
Product Development Team




Murat Hazer
[EMAIL PROTECTED] 
05/14/2006 08:11 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
JSF Backing Bean Unit Testing








Hi,

I am trying to write unit tests on my backing beans' action, actionListener
and other methods, and using shale-test framework to accomplish this. From
TDD principles i know every unit test should test only itself not other
functions or layers etc., but in my scenario backing beans use spring managed
services and these services also use hibernate managed DAOs, and also these
backing beans use other request or session based beans. What are the best
practices about unit testing backing beans like this? 

Should i also use mock objects (like jmock or easymock) for these properties
of the backing beans? And what should i do to validate faces-config files?
I study appfuse (on backing bean tests exceutes all layer functions..)
and examples come with shale, they are not very clear (or my misunderstaning),
i think i need a clear and nice sample (also other users) unit test on
a such complicated backing bean) 

regards...
-- 
Murat HAZER
Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer 
Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: WebLogic 8.1

2006-05-15 Thread Adam Brod

Quintin-

When Weblogic starts up a webapp, it
will print out 'ServletContext /myWebApp initialized'. If
it says null, it might just be that your webapp doesn't have
a name or that the webapp is mapped to the root directory /.
I don't think it is a problem.

Adam Brod
Product Development Team




Quintin Kerby [EMAIL PROTECTED]

05/12/2006 07:30 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
WebLogic 8.1









I developed a webapp using MyFaces, Spring, and Hibernate which runs beautifully
on Tomcat 5.5 and JDK 1.5. I now have to deploy to WebLogic which
uses JDK 1.4.2. 

I had to take the following steps to get where I am (which is still not
very far). 

1) Downgrade the web.xml from 2.4 to 2.3 
2) Remove Antlr.jar for Hibernate as WebLogic seems to have problems with
it. 
3) Add servlet-api.jar and jsp-api.jar from the Tomcat common/lib directory


I noticed the ServletContext 'null' initialized. Does
anyone know WebLogic well enough to point me in the right direction?


snip 
2006-05-12 19:15:17,882 [main] INFO org.springframework.aop.framework.DefaultAopProxyFactory
- CGLIB2 available: proxyTargetClass feature enabled

2006-05-12 19:15:18,211 [main] INFO org.springframework.web.context.ContextLoader
- Using context class [org.springframework.web.context.support.XmlWebApplicationContext]
for root WebApplicationContext 
2006-05-12 19:15:18,211 [main] INFO org.springframework.web.context.ContextLoader
- Root WebApplicationContext: initialization completed in 4313 ms

2006-05-12 19:15:18,211 [main] INFO org.apache.myfaces.webapp.StartupServletContextListener
- MyFaces already initialized 
2006-05-12 19:15:18,211 [main] INFO org.apache.myfaces.webapp.StartupServletContextListener
- ServletContext 'null' initialized. 
May 12, 2006 7:15:18 PM EDT Notice WebLogicServer
BEA-000331 Started WebLogic Admin Server myserver
for domain mydomain running in Development Mode 
May 12, 2006 7:15:18 PM EDT Notice WebLogicServer
BEA-000360 Server started in RUNNING mode 
May 12, 2006 7:15:18 PM EDT Notice WebLogicServer
BEA-000355 Thread ListenThread.Default listening
on port 7001, ip address *.* 
--Following occurs when I attempt to access one of the pages

May 12, 2006 7:16:15 PM EDT Error HTTP BEA-101017
[ServletContext(id=18611390,name=TaskManager,context-path=/TaskManager)]
Root cause of ServletException. 
javax.faces.FacesException: javax.servlet.ServletException

at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)

at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)

at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)

at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:92)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6724)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3764)

at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2644)

at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:219)

at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)

Caused by: javax.servlet.ServletException: javax.servlet.ServletException

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:121)

at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1006)

at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:419)

at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:92)

at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)

at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:92

Re: JSF Backing Bean Unit Testing

2006-05-15 Thread Adam Brod

Hi Murat-

Your understanding appears to be correct.
If you want more details on the differences between unit testing
and integration testing, google for some of the testing websites such as
junit.org, testing.com, etc.

Since JSF managed beans are regular
POJOs, unit testing a managed bean is no different from unit testing any
other plain java object.

Adam Brod
Product Development Team




Murat Hazer
[EMAIL PROTECTED] 
05/15/2006 11:15 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF Backing Bean Unit
Testing








Thanks,

I agree with you, before integration tests i need to write unit test,so
i am looking for answer of How can i do write correct unit
tests for backing beans which use spring and hibernate?. I understand
following points from your asnwers, if i am wrong please correct me; 
1- to write correct unit tests i should isolate the uni t(class/function)
which is under test from other layers/api's.
2- to test jsf backing bean shale-test framework is a good choice. 
3- i should use jmock (or equivalent) to create mock objects of spring
managed services and dao's then i should set these mocks to the backing
bean in the test setUp() metod.

I am a little confused beacuse i couldn't find any good article, tutorial
or sample code for a scanerio like this. I need to find something to get
a clear understanding. Any suggestions?

Another question; can i use canoo web tests (or selenium) for integration
tests? Is this a correct approach or should i follow a different way for
integration testing? 

best regards

On 5/15/06, Adam Brod [EMAIL PROTECTED]
wrote:

Hi Murat- 

I agree with what Dave B. said - Unit Testing is very different from Integration
Testing. I have found that it is best to start with Unit Testing
where you are testing an individual method or class (a unit) in isolation
from all other objects. Therefore, you should mock/stub out the other
frameworks and classes that are used by the backing bean you are testing.


Once you have good unit testing coverage and know that your backing bean
does what you want it to, then you can build larger Integration Tests that
test the interactions between the backing bean and the hibernate daos.
If you start with Integration Testing, it is much more difficult
to isolate bugs in your code because for any given test, there is lots
of code being executed. 

I hope this helps,

Adam Brod
Product Development Team



Murat Hazer
[EMAIL PROTECTED]

05/14/2006 08:11 AM





Please respond to
MyFaces Discussion users@myfaces.apache.org






To
MyFaces Discussion
users@myfaces.apache.org



cc



Subject
JSF Backing Bean Unit Testing










Hi,

I am trying to write unit tests on my backing beans' action, actionListener
and other methods, and using shale-test framework to accomplish this. From
TDD principles i know every unit test should test only itself not other
functions or layers etc., but in my scenario backing beans use spring managed
services and these services also use hibernate managed DAOs, and also these
backing beans use other request or session based beans. What are the best
practices about unit testing backing beans like this? 

Should i also use mock objects (like jmock or easymock) for these properties
of the backing beans? And what should i do to validate faces-config files?
I study appfuse (on backing bean tests exceutes all layer functions..)
and examples come with shale, they are not very clear (or my misunderstaning),
i think i need a clear and nice sample (also other users) unit test on
a such complicated backing bean) 

regards...
-- 
Murat HAZER
Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer 
Disclaimer: This electronic mail and any attachments
are confidential and may be privileged. If you are not the intended recipient,
please notify the sender immediately by replying to this email, and destroy
all copies of this email and any attachments. Thank you.





-- 
Murat HAZER
Elektrik-Elektronik Mühendisi - Electrical-Electronics Engineer
Tel - Phone: +90 222 335 05 80 - 1395
Cep Tel - Mobile Phone: +90 532 472 00 63 
Blog URL: http://www.projedunyasi.org
Yahoo Group: http://groups.yahoo.com/group/malatyafenlisesi/

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: UI Design with PanelStack

2006-05-12 Thread Adam Brod

Could you bind your PanelStack to a
session-scoped managed bean? 

Adam Brod
Product Development Team




Julian Ray [EMAIL PROTECTED]

05/12/2006 12:22 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
UI Design with PanelStack









This is a general UI design question. We are implementing a event scheduler
for recurring events (like the one in Outlook) where events can recurr
on
weekly, monthly or yearly schedules.

The PanelStack seems like a good way to go to provide three panels, only
one
of which is visible based on choices made by the user. The UI is
backed up
by a model bean which I was hoping to use saveState to manage however

the PanelStack component only renders the currently visible panel which
means that if the user switches panels, the model managed by saveState
gets
duly updated with null values for the non-rendered components and therefore
looses state -- if the users switches back to a previous panel the state
has
gone.

So.. what options are available? Any disabled component does not get updated
when the form is submitted so is there another way? It would be nice to
use
existing components rather than hiding divs (which actually works with
saveState!). Perhaps an extended PanelStack component which uses
JS to hide
rather than not render the panels.

Thoughts?

--
View this message in context: http://www.nabble.com/UI-Design-with-PanelStack-t1608677.html#a4361070
Sent from the MyFaces - Users forum at Nabble.com.


Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: MyFaces support for Facelets

2006-05-09 Thread Adam Brod

I vote for option 1. A couple
small files/classes won't add much to the jar size and it will greatly
improve the experience for somebody just trying to get up and running.

Great idea.

Adam Brod
Product Development Team




Andrew Robinson
[EMAIL PROTECTED] 
05/09/2006 04:05 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
MyFaces support for Facelets








Until now, most people are using the WIKI[1] for getting
myfaces to
work with facelets. I was wondering if we want to make MyFaces include
support for facelets natively. This should be able to be done in such
a way to prevent problems for those that do not use facelets.

Option 1)
Add everything to tomahawk.jar including the TagHandler classes and
taglib.xml file(s).

This is easiest, and will not cause issues since non-facelet users
will not be using those classes, and therefore if they don't have
facelets in their classpath, it shouldn't matter.

Option 2)
Create a new myfaces jar file (tomahawk-facelets-1.1.2.jar for
example) that contains only the code and configuration necessary to
plug tomahawk into facelets.

This is possibly more elegant but more of a pain to setup.

Option 3)
Maintain all this at jsf-comp.

This works, but new users may not know about jsf-comp and it is harder
to stay in sync with facelet and myfaces version changes (since it is
not tied into the release cycle).

Since facelets hasn't changed the taglib.xml structure at all, facelet
version should not be a major issue. This would also make issues like
what tree2 had a mute point since we could include component handlers
built in to translate any non-standard logic in the Tag classes.

This methodology could be applied to the sandbox as well. Once there
is some code in SVN I would think myfaces developers could easily
maintain their configuration for their components as well since there
would be examples from other components to learn from (so even
developers without facelets experience shouldn't have any issues).

What do you think?
-Andrew

[1] http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk

Disclaimer: This electronic mail and any attachments are confidential and may be privileged. If you are not the intended recipient, please notify the sender immediately by replying to this email, and destroy all copies of this email and any attachments. Thank you.


Re: Datatable and Request scope

2006-04-25 Thread Adam Brod

Jacob Hookom had a good post on this
last week: http://weblogs.java.net/blog/jhook/archive/2006/04/possible_jsf_co_1.html

Adam Brod
Product Development Team




Travis Reeder
[EMAIL PROTECTED] 
04/25/2006 04:55 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org, [EMAIL PROTECTED]


cc



Subject
Re: Datatable and Request
scope








I've been thinking about this same issue lately, it seems
to me that the only component that must stores it's data in the
session is the DataTable (the DataModel may be lazy, but it still must
be in the session) and other Collection based components like dataList.
Other components don't necessarily have this requirement, you can
bind output's and inputs to request based objects. 

I got to thinking how this issue could be overcome and generally in non-jsf
apps, you use some id field in the object to identify the item
in a list. So what if you could specify on the dataTable an identityField
attribute like t:dataTable identityField=id...  Then
on the backend instead of trying to match up object identity, we can just
match up the identityField. This way, you could reload the data each
request and wouldn't have to worry if the list changed in the database
because you would only try to find the matching identity field. 

Travis

On 4/25/06, Werner Punz [EMAIL PROTECTED]
 wrote:
Werner Punz schrieb:
 [EMAIL PROTECTED]
schrieb:
 I have a Datatable which has thousands of items in it. I get this
items 
 via a database. I don't want to store them in the session, because
this 
 will kill the session...

 So I put it into request scope.. The problem now is the the datascroller
 doesn't work anymore, because I loose the list, because it's only
in
 request scope... 

 What would be the best way to overcome this problem?


 Using a datamodel overcomes this problem.
 There is a wiki entry in the myfaces wiki which describes exactly

 on how to write your own custom data models.


sorry for the missing link, it took me a while to dig it out:

http://wiki.apache.org/myfaces/WorkingWithLargeTables


or at least it should be I cannot reach the wiki currently :-(



Re: myfaces 1.1.1 error with Weblogic 9.1

2006-04-19 Thread Adam Brod

Edward-

I've used MyFaces on Weblogic 9.1. It
looks like you have a compiler problem in your JSP. The Weblogic
9.x JSP compiler is much more strict than 8.x, so you probably need to
check your JSPs for violations. There is some documentation on the
JSP compiler changes on support.bea.com.

javax.servlet.ServletException:
Exception occuured while processing 'C:\BFAPPS\bea\user_projects\domains\test\apps\portal\Login.jsp'
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:303)


Adam Brod
Product Development Team






Edward Patterson
[EMAIL PROTECTED] 
04/18/2006 04:10 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
myfaces 1.1.1 error with
Weblogic 9.1








Has anyone used myfaces with Weblogic Server
9.1? We have added myfaces to our application with 7 lines of code in our
login.jsp. It works correctly on WLS 8.1 SP5. After trying to upgrade to
WLS 9.1 the login page throws the following error:

javax.faces.FacesException: Exception occuured
while processing 'C:\BFAPPS\bea\user_projects\domains\test\apps\portal\Login.jsp'
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:421)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
javax.servlet.ServletException:
Exception occuured while processing 'C:\BFAPPS\bea\user_projects\domains\test\apps\portal\Login.jsp'
at weblogic.servlet.jsp.JavelinxJSPStub.compilePage(JavelinxJSPStub.java:303)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:200)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:224)
at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:380)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:298)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:496)
at weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:245)
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:415)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1973

***
BENEFITFOCUS.COM CONFIDENTIALITY NOTICE: This electronic message is intended
only for the individual or entity to which it is addressed and may contain
information that is confidential and protected by law. Unauthorized review,
use, disclosure, or dissemination of this communication or its contents
in any way is prohibited and may be unlawful. If you are not the intended
recipient or a person responsible for delivering this message to an intended
recipient, please

Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

Hey Adam-

The most common type of GET requests
I've had trouble with in JSF is binding request parameters to complex managed
bean parameters. 

For (a simple) example, say I have a
link /faces/vewDocument.xhtml?documentID=1234.
 viewDocument.xhtml has a backing bean (documentController)
with a managed property named documentID and value #{params.documentID}.
 DocumentController.setDocumentID() takes a DocumentIdentifier object,
not a primitive. 

Can JSF convert the request parameter
to an object even though the request goes directly to the render phase?
Will a Converter work or will JSF auto-wire this since it can see
that the target setDocumentID(...) method takes a parameter of type DocumentIdentifier?

Thanks for your input.

Adam Brod
Product Development Team


Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

If you have your faces servlet configured
to receive *.jsf, then all requests to jsp pages that use *.jsf will be
intercepted by JSF. That means the target JSP can have a full component
tree with jsf component goodness. However, as another user mentioned,
you will lose the state of the originating page (but often times that's
ok).

Adam Brod
Product Development Team


Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

If you wanted a GET to execute an action
(and pass parameters), why not adapt Shale's url convention /[managedBeanName]/[actionMethod]
(for example: /documentController/documentID?id=1234)? That would
enable GET requests to go through the NavigationHandler and have even more
of the JSF framework goodness.

Adam Brod
Product Development Team


Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

Adam-

I don't think your response is quite
what I was getting at. In Struts world, I have lots of ugly code
sprinkled everywhere that converts request params to very low-level custom
objects in our system (for example, Enums for statuses, types, and flags
as well as other objects like Identifiers, Credit Card Numbers, EmailAddresses,
etc.), When using JSF post-backs, we can use Converters to handle
all that boiler-plate request param - object mapping. If using
JSF with GET requests, we cannot use converters, can we? 

If my understanding is correct, that
is a definitely limitation of using GET with JSF.

Adam Brod
Product Development Team






Adam Winer
[EMAIL PROTECTED] 
04/14/2006 04:23 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF can handle GET requests
*just as easily* as other frameworks








Adam,

That's solved straightforwardly with indirection, so that
you have, say, a DocumentProviderBean with get/setId() and
getDocument() on it, and getDocument() has the code to handle
converting the ID into an appropriate object - presumably with a
trivial call to your DAO layer. The request parameter goes
to the DocumentProviderBean, and your page gets the document
out of the document provider.

Do other frameworks make this pattern significantly simpler?
If so, how?

-- Adam





On 4/14/06, Adam Brod [EMAIL PROTECTED] wrote:

 Hey Adam-

 The most common type of GET requests I've had trouble with in JSF
is binding
 request parameters to complex managed bean parameters.

 For (a simple) example, say I have a link
 /faces/vewDocument.xhtml?documentID=1234.
 viewDocument.xhtml has a backing bean (documentController)
with a managed
 property named documentID and value #{params.documentID}.
 DocumentController.setDocumentID() takes a
 DocumentIdentifier object, not a primitive.

 Can JSF convert the request parameter to an object even though the
request
 goes directly to the render phase? Will a Converter work or
will JSF
 auto-wire this since it can see that the target setDocumentID(...)
method
 takes a parameter of type DocumentIdentifier?

 Thanks for your input.

 Adam Brod
 Product Development Team




Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

Hubert-

Sorry I didn't clarify my idea better.
It was a general idea for a JSF extension, not something that will
help you in the near-term.

Using GET requests you can't get 100%
of the JSF framework goodness. Adam W. pointed out that you don't
get to use the Navigation framework if your URL hard-codes the destination
page. So my proposal would enable GET requests to use the navigation
framework. But it would require some effort to implement.

Adam Brod
Product Development Team






Hubert Rabago
[EMAIL PROTECTED] 
04/14/2006 05:00 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF can handle GET requests
*just as easily* as other frameworks








Adam,

Was this for me? I'm sorry, I can never tell because there's no
context. If it is, then yes, I know about the NonFacesRequestServlet
[1], and Shale's remoting support [2]. Both of those of course build
on the framework. I posed the question based on Jacob's statement
that seem to imply that such functionality is already supported by
JSF, and the perception that it isn't is a myth. I actually worked
on
something that builds on NFRS and I thought of offering it to Craig
for Shale but I don't think the way I implemented it jives with his
vision for Shale or his vision of how JSF should be utilized. IOW,
the way I did it might not be The JSF Way, so I'm just keeping it to
myself for now.

Hubert

[1] http://wiki.apache.org/myfaces/InvokingJsfPagesWithStandardUrls
[2] http://struts.apache.org/struts-shale/shale-remoting/apidocs/org/apache/shale/remoting/package-summary.html#package_description

On 4/14/06, Adam Brod [EMAIL PROTECTED] wrote:

 If you wanted a GET to execute an action (and pass parameters), why
not
 adapt Shale's url convention
 /[managedBeanName]/[actionMethod] (for example:
 /documentController/documentID?id=1234)? That would enable
 GET requests to go through the NavigationHandler and have even more
of the
 JSF framework goodness.


 Adam Brod
 Product Development Team




Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

Craig-

Thanks for your response. I understand
that the existing Shale remoting code wouldn't work, but as you wrote -
the same principle could be applied.

However,
dealing with conversion errors on unedited request parameters (it'll likely
throw an exception) is probably not as user friendly as it really ought
to be. 

Back to parameter mapping: since we
are talking about request URLs, we don't generally need to be concerned
about user-friendly errors. A malformed URL is a developer error
in this case. In most cases, we'd probably be passing
the id from the person list to the person detail page. (To be clear,
I'm talking about using action-style urls just for navigation, not for
form submissions where we expect conversion errors. I find
that navigating from a list page to a detail page is too heavy-weight using
post-backs with potentially large datasets.)

If the framework didn't do this and
I were to use longs and Strings in my managed bean properties, then I'd
have to write code that creates the model objects. In the exceptional
case that the primitive managed properties couldn't be converted, I would
probably just throw an exception. Exceptions are generally okay for
developer errors that can be fixed at development time. I'd rather
the framework do this basic conversion for me since it works great 90+%
of the time. If I have a special case that needs special error handling,
I'll hand-code those few cases (or use post-backs).

Does that make sense?

Adam Brod
Product Development Team






Craig McClanahan
[EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
04/14/2006 05:42 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF can handle GET requests
*just as easily* as other frameworks










On 4/14/06, Adam Brod [EMAIL PROTECTED]
wrote:

If you wanted a GET to execute an action (and pass parameters), why not
adapt Shale's url convention /[managedBeanName]/[actionMethod] (for example:
/documentController/documentID?id=1234)?

This capability was specifically designed for being the back end of AJAX
style requests, but it works quite nicely for bookmarkable URLs too. However
... 

That would enable GET requests
to go through the NavigationHandler and have even more of the JSF framework
goodness.

You don't get this out of the box with the current implementation in Shale.
That's because, from a JSF lifecycle point of view, Shale's phase
listener fires after Restore View -- and it will do this: 

* Determine that the URL matches one of the patterns it is configured
 to watch for (/dynamic/* by default)

* Execute the corresponding method via a programmatic method
 binding call. As a side effect, this might trigger managed
bean 
 creation of the bean instance containing this method.

* Expect that the method has created the entire response, so it
 calls FaceContext.responseComplete() and returns.

As you can see, we never actually entered Invoke Application phase, we
never pay attention to anything that the invoked method returns (indeed,
the expected method signature is public void methodname()),
and we never invoke the navigation handler. 

That's not saying you couldn't configure a Processor that does that sort
of thing -- its just that the default one doesn't.

For a use case like a bookmarkable URL, I tend to take a different approach,
because of what JSF's lifecycle will do for you anyway -- if Restore View
detects that there is no view state to restore, it jumps immediately to
Render Response phase. If you can interpose some processing logic
that happens right before rendering, and hav that logic pull out the request
parameters you need (or let JSF inject them via the managed properties
stuff), then it is very straightforward to process GET requests. Shale
even gives you a very easy place to put this kind of logic, if your backing
bean implements ViewController -- stick it in the prerender() method. This
approach certainly isn't harder than doing the same sort of thing in Struts
1.x.

Regarding conversion of request parameters to model data types, Section
5.3.1.2
of the JSF 1.1 spec discusses using managed properties to inject values
into managed beans as they get created. It requires the same implicit
conversions that JSP provides for the jsp:setProperty tag, so you're
covered for things like Java primitives, but not for custom data types.
That means you could use a value _expression_ like #{ param.personId}
to pull out the personId request parameter, and assign it to a bean property
of type int or long. However, dealing with conversion errors on unedited
request parameters (it'll likely throw an exception) is probably not as
user friendly as it really ought to be. I would tend to use string
properties for that reason. 

Adam Brod
Product Development Team


Craig



Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

 the
interesting question (which you're posing) is how to make
 JSF better tomorrow than it is today.

Exactly! Simplifying some action-style
interactions just makes the framework richer and expands its usefulness.

Adam Brod
Product Development Team






Adam Winer
[EMAIL PROTECTED] 
04/14/2006 06:10 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF can handle GET requests
*just as easily* as other frameworks








On 4/14/06, Adam Brod [EMAIL PROTECTED]
wrote:

 Adam-

 I don't think your response is quite what I was getting at. In
Struts
 world, I have lots of ugly code sprinkled everywhere that converts
request
 params to very low-level custom objects in our system (for example,
Enums
 for statuses, types, and flags as well as other objects like Identifiers,
 Credit Card Numbers, EmailAddresses, etc.), When using JSF post-backs,
we
 can use Converters to handle all that boiler-plate request param -
object
 mapping. If using JSF with GET requests, we cannot use converters,
can we?

For JSF 1.2, you'll have type coercion - but that only gets you
to primitive types. There's no direct support in the EL APIs for
extending the type coercion semantics. I think you could do so with
a particularly clever AOP layer on top of a managed bean.
Or, more elegantly, use an ELResolver (or PropertyResolver in 1.1)
that knows how to go from a String to a particular type of object;
make that resolver dynamically hooked up to metadata that
is per-page specific (or annotation-based), and you can cleanly
automate a lot of this.

So, for instance, you could work towards a system like;

 /**
  * @requestParameter mailto
  * @convertOnSet mypackage.foo.EmailConverter
 public void setEmail(EmailBean bean)

... that would automate all of that conversion.

 If my understanding is correct, that is a definitely limitation of
using GET
 with JSF.

True. The question on our plate was whether JSF is worse
than other frameworks, and based on your description above of
all the nastiness in Struts, we definitely have one counterexample.
But the issue of whether JSF is worse or better is basically
a question most suited for another pointless smackdown, and
the interesting question (which you're posing) is how to make
JSF better tomorrow than it is today.

-- Adam



Re: JSF can handle GET requests *just as easily* as other frameworks

2006-04-14 Thread Adam Brod

But in your example, personId is a primitive.
What I really want is to pass my own model objects from the List
to the Detail page (without post-backs). Would your example work
if personId were a PersonIdentifier object? What about other
custom properties such as Enums, EmailAddresses, etc? If so, then
how? Does it invoke converters at ManagedBean creation time?

Adam Brod
Product Development Team






Craig McClanahan
[EMAIL PROTECTED] 
Sent by: [EMAIL PROTECTED]
04/14/2006 06:31 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF can handle GET requests
*just as easily* as other frameworks










On 4/14/06, Adam Brod [EMAIL PROTECTED]
wrote:

Craig- 

Thanks for your response. I understand that the existing Shale remoting
code wouldn't work, but as you wrote - the same principle could be applied.



However,
dealing with conversion errors on unedited request parameters (it'll likely
throw an exception) is probably not as user friendly as it really ought
to be. 


Back to parameter mapping: since we
are talking about request URLs, we don't generally need to be concerned
about user-friendly errors. A malformed URL is a developer error
in this case. In most cases, we'd probably be passing
the id from the person list to the person detail page. (To be clear,
I'm talking about using action-style urls just for navigation, not for
form submissions where we expect conversion errors. I find
that navigating from a list page to a detail page is too heavy-weight using
post-backs with potentially large datasets.)

As an added benefit, you can get bookmarkable URLs out of the deal too.


If the framework didn't do this and
I were to use longs and Strings in my managed bean properties, then I'd
have to write code that creates the model objects. In the exceptional
case that the primitive managed properties couldn't be converted, I would
probably just throw an exception. Exceptions are generally okay for
developer errors that can be fixed at development time. I'd rather
the framework do this basic conversion for me since it works great 90+%
of the time. If I have a special case that needs special error handling,
I'll hand-code those few cases (or use post-backs).


Does that make sense?

Yep, that makes sense. Indeed, JSF today does what you want already.
Here's a pattern I've used that makes life pretty easy:

  managed-bean
managed-bean-namebacking/managed-bean-name
managed-bean-classcom.foo.BackingBean/managed-bean-class
managed-property
  property-namepersonId/property-name
  value#{param.personId}/value
/managed-property
  /managed-bean

with a backing bean like this: 

  public class BackingBean implements ViewController {

private int personId;
public int getPersonId() { return this.personId;
}
public void setPersonId(int personId) { this.personId
= personId; }

...

public void prerender() {
  // By the time you get here,
personId has aready
  // been converted and injected,
so use it to go look
  // up the relevant information

}

  }

No muss ... no fuss ... if you're willing to have the exception thrown
on a conversion error.


Adam Brod
Product Development Team

Craig
 



Craig McClanahan
[EMAIL PROTECTED]

Sent by: [EMAIL PROTECTED]

04/14/2006 05:42 PM






Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org



cc



Subject
Re: JSF can handle GET requests
*just as easily* as other frameworks












On 4/14/06, Adam Brod 
[EMAIL PROTECTED] wrote: 

If you wanted a GET to execute an action (and pass parameters), why not
adapt Shale's url convention /[managedBeanName]/[actionMethod] (for example:
/documentController/documentID?id=1234)? 

This capability was specifically designed for being the back end of AJAX
style requests, but it works quite nicely for bookmarkable URLs too. However
... 

 That would enable GET requests to go through the NavigationHandler and
have even more of the JSF framework goodness. 

You don't get this out of the box with the current implementation in Shale.
That's because, from a JSF lifecycle point of view, Shale's phase
listener fires after Restore View -- and it will do this: 

* Determine that the URL matches one of the patterns it is configured
 to watch for (/dynamic/* by default)

* Execute the corresponding method via a programmatic method
 binding call. As a side effect, this might trigger managed bean

 creation of the bean instance containing this method.

* Expect that the method has created the entire response, so it
 calls FaceContext.responseComplete() and returns.

As you can see, we never actually entered Invoke Application phase, we
never pay attention to anything that the invoked method returns (indeed,
the expected method signature is public void methodname()),
and we never invoke the navigation handler. 

That's not saying you couldn't

Re: Can a dataTable work in request scope?

2006-04-13 Thread Adam Brod

Yes, you can use request-scoped backing
beans with dataTable. I would recommend that you use the t:saveState
component to simplify your life.

See Action
listeners and actions for my commands on dataTables do not fire
from the FAQ. 
http://wiki.apache.org/myfaces/FAQ

Also http://wiki.apache.org/myfaces/ExecutingMethodsFromLinkButtonParameters

Adam Brod
Product Development Team


Re: WebLogic precompilation

2006-03-17 Thread Adam Brod

Hi Thien-

Precompiling jsps is great, but you
need to tell weblogic's runtime where to look for them. 

To do that, you need to edit/create
your weblogic.xml file (under WEB-INF) and add the workingDir param.

jsp-descriptor
  jsp-param
   param-nameworkingDir/param-name
   param-valueautodeploy/mywebapp/WEB-INF/classes/param-value
  /jsp-param
/jsp-descriptor

If you do this, the files should not
be compiled twice. This works on my local windows machine in exploded
webapp format.

Adam Brod
Product Development Team




THIEN PHAM [EMAIL PROTECTED]

03/16/2006 01:01 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion users@myfaces.apache.org


cc



Subject
WebLogic precompilation








Hi,

My Myfaces application seems to take a long time to
respond when its pages are accessed for the first time
in WebLogic 8.1 (though this problem is not seen with
JBoss 4 or Websphere 6). Now that's probably okay
because of the first time compilation of the involved
JSP files. I'd like to precompile JSP pages of my
application so that it can be deployed and used by WL.
I have followed all kinds of instructions from BEA
website from using weblogic.jspc to weblogic.appc
tools but to no avail. The tools do generate byte
codes for these pages and place them under
WEB-INF/classes. But WL still recompile these pages
(instead of using classes under WEB-INF/classes
directory) when they're access for the first time.
Does anyone have any success in doing this? I'd
appreciate very much if you can show me how. Thanks.

__
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


Re: Can I load another jsf page by t:popup?

2006-03-03 Thread Adam Brod

That would be a great feature!

Adam Brod
Product Development Team




Anthony Hong
[EMAIL PROTECTED] 
03/03/2006 09:17 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Can I load another jsf page
by t:popup?








I want to load another dynamic jsf page with some
actions in page in a
popup div. Can I?

--

Anthony Hong


MyFaces 1.1.3-SNAPSHOT and missing Resources

2006-03-02 Thread Adam Brod

Hi-

I have read that a number of bug fixes
have been checked into the snapshot. So I tried upgrading to MyFaces
1.1.3-SNAPSHOT and Tomahawk 1.1.2-SNAPSHOT. Now my page with a tree2
component no longer works, whereas it used to work in 1.1.1. I get
the same error with jscookMenu.

Does anybody know what's wrong?

Thanks,
Adam



2006-03-02 14:26:38,726 ERROR org.apache.myfaces.shared_tomahawk.renderkit.html.util.DefaultAddResource
- Error while serving resource: tree2.H
tmlTreeRenderer/images/line-last.gif,
message : Can't find bundle for base name org.apache.myfaces.shared_tomahawk.renderkit.html.util.AddResou
rce, locale en_US
java.util.MissingResourceException:
Can't find bundle for base name org.apache.myfaces.shared_tomahawk.renderkit.html.util.AddResource,
locale
en_US
at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:837)
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:727)
at java.util.ResourceBundle.getBundle(ResourceBundle.java:550)
at org.apache.myfaces.shared_tomahawk.renderkit.html.util.MyFacesResourceLoader.getLastModified(MyFacesResourceLoader.java:69)
at org.apache.myfaces.shared_tomahawk.renderkit.html.util.MyFacesResourceLoader.defineCaching(MyFacesResourceLoader.java:188)
at org.apache.myfaces.shared_tomahawk.renderkit.html.util.MyFacesResourceLoader.serveResource(MyFacesResourceLoader.java:150)
at org.apache.myfaces.shared_tomahawk.renderkit.html.util.DefaultAddResource.serveResource(DefaultAddResource.java:526)
at org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:119)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:292)
at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:108)
at org.acegisecurity.intercept.web.SecurityEnforcementFilter.doFilter(SecurityEnforcementFilter.java:197)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:246)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:220)
at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:303)
at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:173)
at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:120)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at com.intralinks.ma.ui.filter.TransactionFilter.doFilter(TransactionFilter.java:39)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:137)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3027)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1932)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1855)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)

Adam Brod
Product Development Team


Re: jscookMenu and onclick()?

2006-03-02 Thread Adam Brod

By original, do you mean
the raw _javascript_ library? I really like encapsulating all of our
reusable components behind a JSF Component. That gives our pages
a lot of consistency.

Logically speaking, since commandLinks
support the onclick attribute, it would be great if jsCookMenu would support
it as well. If it doesn't support it, then I understand.

Thanks,

Adam Brod
Product Development Team




Dennis Byrne
[EMAIL PROTECTED] 
03/02/2006 04:58 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: jscookMenu and onclick()?








Hello Adam,

Perhaps the original jsCookMenu would be your first choice.

Dennis Byrne

-Original Message-
From: Adam Brod [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 2, 2006 04:55 PM
To: 'MyFaces Discussion'
Subject: jscookMenu and onclick()?

Hi-

Is is possible for jsCookMenu to execute some _javascript_ instead of
an 
action/actionMethod? Perhaps with the an onClick event?

Thanks,

Adam Brod
Product Development Team





Re: JSF Lifecycle and Design Question

2006-03-01 Thread Adam Brod

You can just lazily load the data in
your bean. For example, myActionBean.getMyDataBean(), just call loadData()
in there. (You can keep a boolean to make sure you only load the
data once.)

Adam Brod
Product Development Team




j2ee Developer
[EMAIL PROTECTED] 
03/01/2006 04:43 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: JSF Lifecycle and Design
Question








Appreciate your response. That is very close to the way
we have implemented it here. The only distinction being that the first
time page load, in our scenario does not come from an action event ( commandbutton
or commandlink). It is the first request. So I am confused as to where
do I call the load(), other than the constructor.
 I understand that probably Shale or Spring can provide us this flexibility,
but we are not evaluating them right now. Does anyone has any idea how
I could implement this.


On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED]
wrote:
Oh, and don't forget to put the
following tag in your JSP that displays the contents of your data bean:

t:saveState value=#{myDataBean}/

- Brendan

-Original Message-
From: CONNER, BRENDAN (SBCSI) 
Sent: Wednesday, March 01, 2006 2:18
PM
To: MyFaces Discussion
Subject: RE: JSF Lifecycle and Design Question

What we do is something like the
following:

public class MyDataBean implements
Serializable {
  private
String field1;
  private
Date field2;
  //
define getters and setters
}

public class MyActionBean implements
Serializable {
  public
MyDataBean myDataBean;
  // define getter
and setter for myDataBean
  public
String loadData() {
...
return
outcome;
  }

  public
Stirng saveData() {
...
return
outcome;
  }
  ...
}

And then define the following
relationship in faces-config.xml:

managed-bean
 managed-bean-namemyDataBean/managed-bean-name
 managed-bean-classcom.example.MyDataBean/managed-bean-class

 managed-bean-scoperequest/managed-bean-scope
 /managed-bean
 
 managed-bean
 managed-bean-namemyActionBean/managed-bean-name
 managed-bean-class com.example.MyActionBean/managed-bean-class
 managed-bean-scoperequest/managed-bean-scope
 managed-property
  property-namemydataBean/property-name
  value#{myDataBean}/value 
 /managed-property
 /managed-bean
  
Then in the screen that leads
up to the screen that displays the initial value of the bean, your commandButton
or commandLink would invoke #{myActionBean.loadData}. The save
commandButton would invoke #{myActionBean.saveData}, whose success
would just lead to redisplaying the page.

MyActionBean.loadData() would
call the EJB layer to fetch the data and populate the fields within the
object returned by getMyDataBean(). (JSF makes sure that this object
is already instantiated.)

MyActionBean.saveData() would
call the EJB layer to update the database with the contents of the object
returned by getMyDataBean(). (JSF populates this bean with the contents
of the request.) After this method return, JSF automatically populates
the HTML fields with the values of this bean.

- Brendan
-Original Message-
From: j2ee Developer [mailto:[EMAIL PROTECTED]]

Sent: Wednesday, March 01, 2006 1:50 PM
To: MyFaces Discussion
Subject: Re: JSF Lifecycle and Design Question

Thanks Brendan! Sounds interesting! Can you please
explain a little bit more on how are you seperating data beans from action
beans. This is how I have implemented my backing beans. All data is in
a formbean(struts style formbean), this formbean is a member attribute
of my actual backing bean. The actual backing bean just has the action
methods like save, clear, delete etc.
Also if I do not call the action methods in the constructor, where do I
call the action method before the screen gets displayed? 

On 3/1/06, CONNER, BRENDAN (SBCSI) [EMAIL PROTECTED]
wrote: 
Also, you shouldn't have to worry
about populating the bean's values again after the save (unless you're
changing them or re-querying the database), since the beans already have
their values. From what I recall (although it's been awhile since
I've worked with Struts), this is one of the areas in which JSF makes our
life a lot easier than with Struts.

You may want to use t:saveState,
though, to make sure your bean values get passed from one request to another.

- Brendan
-Original Message-
From: CONNER, BRENDAN (SBCSI) 
Sent: Wednesday, March 01, 2006 12:59 PM
To: MyFaces Discussion
Subject: RE: JSF Lifecycle and Design Question

I would advise against doing any
kind of action as part of a managed bean's constructor. In my experience,
you want to separate out Action methods from Managed Bean data. Your
action methods should be the only things accessing the EJBs, etc. So
you should have an action method that gets invoked before the screen is
displayed. It goes out and gets the data and populates the data fields,
which then get displayed. Your Save then is very simple, since JSF
automatically

Re: Can not run Facelet on weblogic 9

2006-02-27 Thread Adam Brod

What jars do you have in your WEB-INF/lib?
Somewhere you still have Sun's JSF implementation (jsf-ri.jar ) in
your classpath. You need to remove Sun's JSF. If you see an
exception with this this element (com.sun.faces.lifecycle.RestoreViewPhase.isPostback),
then you know you're still running Sun's JSF RI (com.sun.faces.**).

I hope this helps.

Adam Brod
Product Development Team




Anthony Hong
[EMAIL PROTECTED] 
02/25/2006 12:32 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: Can not run Facelet on
weblogic 9








Hi Adam,

Now I follow the My faces installation guides to setup facelet, But
the problem is the same. Exception show as following:

2006-2-25 下午01时27分40秒 CST Error HTTP
BEA-101017 [weblogic.servlet.
[EMAIL PROTECTED] - name: 'webapp', context-path: '/webapp']
 Root cause of ServletException.
java.lang.AbstractMethodError: javax.faces.render.ResponseStateManager.isPostbac
k(Ljavax/faces/context/FacesContext;)Z
at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase.
java:200)
at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.jav
a:156)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:222)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
Truncated. see log file for complete stacktrace


I aslo tried same on on Tomcat5.5. It shows 404 error, Page can not be
found.

This is my web.xml
?xml version=1.0 encoding=UTF-8?

web-app version=2.4
 xmlns=http://java.sun.com/xml/ns/j2ee
 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
 xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd

  !-- Use Documents Saved as *.xhtml --
  context-param
param-namejavax.faces.DEFAULT_SUFFIX/param-name
param-value.xhtml/param-value
  /context-param

  !-- Special Debug Output for Development --
  context-param
param-namefacelets.DEVELOPMENT/param-name
param-valuetrue/param-value
  /context-param

   context-param
param-namejavax.faces.STATE_SAVING_METHOD/param-name
param-valueclient/param-value
  /context-param

  !-- Optional JSF-RI Parameters to Help Debug --
  context-param
param-namecom.sun.faces.validateXml/param-name
param-valuetrue/param-value
  /context-param
  context-param
param-namecom.sun.faces.verifyObjects/param-name
param-valuetrue/param-value
  /context-param

  !-- Faces Servlet --
  servlet
servlet-nameFaces Servlet/servlet-name
servlet-classjavax.faces.webapp.FacesServlet/servlet-class
load-on-startup1/load-on-startup
  /servlet

  !-- Faces Servlet Mapping --
  servlet-mapping
servlet-nameFaces Servlet/servlet-name
url-pattern*.jsf/url-pattern
  /servlet-mapping

/web-app

My faces-config.xml

?xml version=1.0 encoding=UTF-8?
!DOCTYPE faces-config PUBLIC
 -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN
 http://java.sun.com/dtd/web-facesconfig_1_0.dtd

faces-config

  application
view-handlercom.sun.facelets.FaceletViewHandler/view-handler
  /application

  managed-bean
managed-bean-nameNumberBean/managed-bean-name
managed-bean-classfacelet.tutorial.NumberBean/managed-bean-class
managed-bean-scopesession/managed-bean-scope
managed-property
  property-namemin/property-name
  value1/value
/managed-property
managed-property
  property-namemax/property-name
  value10/value
/managed-property
  /managed-bean

  !-- going from guess.xhtml to response.xhtml --
   navigation-rule
from-view-id/guess.xhtml/from-view-id
navigation-case
 from-outcomesuccess/from-outcome
 to-view-id/response.xhtml/to-view-id
/navigation-case
   /navigation-rule

   !-- going from response.xhtml to guess.xhtml --
   navigation-rule
from-view-id/response.xhtml/from-view-id
navigation-case
  from-outcomesuccess/from-outcome
 to-view-id/guess.xhtml/to-view-id
/navigation-case
   /navigation-rule


/faces-config

I follow the example in facelte site.
Any problem with my configurations?



Re: Where to get facelet xsd defintions

2006-02-24 Thread Adam Brod

If you are using Facelets, it is inside
the jsf-facelets.jar. 

Adam Brod
Product Development Team




Anthony Hong
[EMAIL PROTECTED] 
02/24/2006 01:32 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Where to get facelet xsd
defintions








I saw namespace like this in facelet example, but
I can not get its
element definition, xmlns:ui=http://java.sun.com/jsf/facelets

Where can I get this dtd or xsd

--

Anthony Hong


Re: Can not run Facelet on weblogic 9

2006-02-24 Thread Adam Brod

Anthony-

Apparently you are running Facelets
on Sun's JSF Reference Implementation of JSF. Do want to be running
Facelets on MyFaces? If so, you need to delete two jars that come
with Facelets - jsf-ri.jar and jsf-impl.jar - from WEB-INF/lib and replace
them with the MyFaces jars. 

If you, in fact, do want to be running
on Sun's RI, then I recommend you contact their mailing list. :)

Adam Brod
Product Development Team




Anthony Hong
[EMAIL PROTECTED] 
02/24/2006 03:18 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Can not run Facelet on weblogic
9








Hi all,

I downloaded the latest Facelet 1.0.11 and use it to learn facelet as
a view of JSF.
I put all libaries under %facelet_bundle%/lib into my web-inf/lib
and jsf-facelet into web-inf/lib.
I go through as facelet document section 1 example number guess
But at weblogic startup time I saw a caution:
Incorrect JSP version found, method getJspApplicationContext does not exist.
And when I trying to request that page, following error occured:
java.lang.AbstractMethodError:
javax.faces.render.ResponseStateManager.isPostback(Ljavax/faces/context/FacesContext;)Z

at com.sun.faces.lifecycle.RestoreViewPhase.isPostback(RestoreViewPhase.java:188)

at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:143)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)

at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:112)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:175)

at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:214)

at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:120)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)

at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)

at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022)

at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)

at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)

at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925)

at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848)

at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)

at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)

at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)

How pity I am! anybody can help me out.
Thanks in advance

--

Anthony Hong


Re: linkDummyForm not rendering on every page

2006-02-24 Thread Adam Brod

I know that ADF Faces overrides all
of the default renderers and the ADF Faces commandLink does not create
a dummy form for you. Perhaps that is your problem?

Adam Brod
Product Development Team




Joey Geiger [EMAIL PROTECTED]

02/24/2006 11:22 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion users@myfaces.apache.org


cc



Subject
linkDummyForm not rendering
on every page








I recently upgraded to a 1.1.2 nightly build, and
I've run into an issue where the linkdummyform
listed below is not being created on every page. This wasn't an issue with
the 1.1.1 release.
I know that I can surround all of my h:commandLink tag sections with forms
to make them work,
but I was wondering specifically what triggers the code below to render.
I'd rather not have
7-8 different forms on a page just for common links that can be processed
by one form.

Thank you.



!-- MYFACES _javascript_ --
form id=linkDummyForm name=linkDummyForm style=display:inline
method=post action="">
input type=hidden name=linkDummyForm:_link_hidden_
/script type=text/_javascript_!--
function clear_linkDummyForm() {
 var f = document.forms['linkDummyForm'];
 f.elements['linkDummyForm:_link_hidden_'].value='';
 f.target='';
}
clear_linkDummyForm();
//--/script
/form




RE: [JSF] Tiles and Reusable Template

2006-02-23 Thread Adam Brod

https://facelets.dev.java.net/nonav/docs/dev/docbook.html#template

Adam Brod
Product Development Team




Garner, Shawn
[EMAIL PROTECTED] 
02/23/2006 01:50 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
'MyFaces Discussion' users@myfaces.apache.org


cc



Subject
RE: [JSF] Tiles and Reusable
Template








I looked at Clay and it looks like it will work but
I want to examine
facelets more first.

The facelets tutorial says it does easy templating but there were no
examples on how to do it and I couldn't find one in the documentation.
Is there an example of this somewhere?


Shawn
-Original Message-
From: news [mailto:[EMAIL PROTECTED] On Behalf Of Laurie Harper
Sent: Wednesday, February 22, 2006 6:44 PM
To: users@myfaces.apache.org
Subject: Re: [JSF] Tiles and Reusable Template

Garner, Shawn wrote:
 I tried using tiles with JSF and found it does not work very well.
 
 You end up having to define every page in the tiles.xml file that
you want
 to use the template for.
 
 Are there any other approaches to creating a reusable template that
uses
 multiple jsp pages?
 
 Seems like I should be able to just include a page and override the
body,
 title portion without redefining the template for every page.

You may be able to do what you want with Tiles using the JSP tags 
instead of the XML file. Alternatively, take a look at Facelets or Shale

Clay.

L.



This email may contain confidential material. 
If you were not an intended recipient, 
Please notify the sender and delete all copies. 
We may monitor email to and from our network. 



Re: MyFAces with FAcelets

2006-02-21 Thread Adam Brod

Marco-

It sounds to me like your webapp is not properly deployed in your webserver.

Can you get a page directly /TestJSFApp/index.html
without going through the FacesServlet?

Also, you said the code you included
was index.html, but your url says it is for main.jsf. You should
be hitting index.jsf.

Finally, if that doesn't solve it, could
you send the relevant sections of your web.xml?

Adam Brod
Product Development Team




Marco Mistroni
[EMAIL PROTECTED] 
02/21/2006 10:19 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
MyFAces with FAcelets








hello all,
 i have just downloaded the latest version of facelets (1.0.10) to
be used with myfaces

i (literally) copied context parameters from demo application, because
i wanted to try to
use facelets in my pages... 

It turned out that, for some weird reasons, the page was not rendered at
all..

for example, here's my index.html (copied from numberguess application)

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=
http://www.w3.org/1999/xhtml
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/
meta http-equiv=refresh content=0; url= ""
/
titleUntitled Document/title
/head

body
/body
/html


when this gets loaded (and it will try to load the main.jsf )

the app fails miserably by saying 

The requested resource (/TestJSFApp/main.jsf) is not available.

For some weird reason, page does not get rendered, which leads me to think
that
some parameters are not set, since i am having a main.xhtml (written usign
facelets) that should 
be rendered properly


can anyone find any reason of why facelets does not work with my applications?

regards
 marco



here's my web.xml   (be patient, it's long)

?xml version=1.0 encoding=UTF-8?

!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd

web-app 
 context-param
  param-namecontextConfigLocation/param-name

  param-value
/WEB-INF/core-context.xml
/WEB-INF/web-context.xml
/WEB-INF/aop-context.xml
/WEB-INF/applicationContext-acegi-security.xml
/WEB-INF/applicationContext- common-authorization.xml
/WEB-INF/applicationContext-common-business.xml
  /WEB-INF/faces-context.xml
/WEB-INF/dataSourcePopulator.xml

  /param-value
/context-param 

context-param
 param-namejavax.servlet.jsp.jstl.fmt.localizationContext/param-name
 param-valueresources.MessageResources/param-value
/context-param

context-param
   param-namejavax.faces.CONFIG_FILES/param-name
   param-value/WEB-INF/faces-config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml/param-value

/context-param

context-param
param-namejavax.faces.STATE_SAVING_METHOD/param-name
param-valueclient/param-value
description 
  State saving method: client
or server (= default)
  See JSF Specification 2.5.2
/description
  /context-param

  context-param 
param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name
param-valuetrue/param-value
description
  This parameter tells MyFaces
if _javascript_ code should be allowed in the 
  rendered HTML output.
  If _javascript_ is allowed, command_link
anchors will have _javascript_ code
  that submits the corresponding
form.
  If _javascript_ is not allowed,
the state saving info and nested parameters 
  will be added as url parameters.
  Default: true
/description
  /context-param

  context-param
param-nameorg.apache.myfaces.DETECT_JAVASCRIPT
/param-name
param-valuefalse/param-value
  /context-param

  context-param
param-nameorg.apache.myfaces.PRETTY_HTML/param-name
param-valuetrue/param-value
description
  If true, rendered HTML code will
be formatted, so that it is human readable.
  i.e. additional line separators
and whitespace will be written, that do not 
  influence the HTML code.
  Default: true
/description
  /context-param

  context-param
param-nameorg.apache.myfaces.AUTO_SCROLL
/param-name
param-valuetrue/param-value
description
  If true, a _javascript_ function
will be rendered that is able to restore the
  former vertical scroll on every
request. Convenient feature if you have pages 
  with long lists and you do not
want the browser page to always jump to the top
  if you trigger a link or button
action that stays on the same page.
  Default: false
/description
  /context-param

  context-param

param-nametiles-definitions/param-name

param-value/WEB-INF/tiles-defs.xml/param-value


description
Tiles configuration

   definition files and a listener
need to be defined.
   the listener will initialize
JspTilesViewHandlerImpl with tiles definitions. 

/description
  /context-param

context-param
param-namefacelets.REFRESH_PE

Re: MyFAces with FAcelets

2006-02-21 Thread Adam Brod

In web.xml, do you have your FacesServlet
configured to check for the /*.jsf url pattern? Some examples use
*.faces or /faces/*.

servlet

   servlet-nameFaces
Servlet/servlet-name

   servlet-classjavax.faces.webapp.FacesServlet/servlet-class

   load-on-startup1/load-on-startup
/servlet
   
servlet-mapping

   servlet-nameFaces
Servlet/servlet-name

   url-pattern*.jsf/url-pattern
/servlet-mapping

Can you load /TestJSFApp/main.xhtml?
If yes, then the webapp is deployed, but JSF is not properly configured.

Adam Brod
Product Development Team




Marco Mistroni
[EMAIL PROTECTED] 
02/21/2006 10:50 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: MyFAces with FAcelets








Hello Adam,
 thanks for your quick reply...
in the index.html (in the meta-http data) the page is supposed to load
main.jsf.. as in following piece of code

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=
http://www.w3.org/1999/xhtml
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/
meta http-equiv=refresh content=0; url=""
/ 
titleUntitled Document/title
/head

body
/body
/html


that meta-http-equiv should load the main.jsf (which is, actually,
main.xhtml.. that hsould be picked up by Facelets  FacesServlet) 
to me it looks like i am having some facelets config parameter wrong
but actually the proper parameter is set up correctly..

context-param
param-namejavax.faces.DEFAULT_SUFFIX/param-name

param-value.xhtml/param-value
  /context-param

i'll try to debug more and get back with my findings

regards
 marco








On 2/21/06, Adam Brod [EMAIL PROTECTED]
wrote:

Marco- 

It sounds to me like your webapp is not properly deployed in your webserver.


Can you get a page directly /TestJSFApp/index.html without going through
the FacesServlet? 

Also, you said the code you included was index.html, but your url says
it is for main.jsf. You should be hitting index.jsf.


Finally, if that doesn't solve it, could you send the relevant sections
of your web.xml?

Adam Brod
Product Development Team



Marco Mistroni
[EMAIL PROTECTED]

02/21/2006 10:19 AM





Please respond to
MyFaces Discussion users@myfaces.apache.org






To
MyFaces Discussion
users@myfaces.apache.org



cc



Subject
MyFAces with FAcelets










hello all,
 i have just downloaded the latest version of facelets (1.0.10) to be used
with myfaces

i (literally) copied context parameters from demo application, because
i wanted to try to
use facelets in my pages... 

It turned out that, for some weird reasons, the page was not rendered at
all..

for example, here's my index.html (copied from numberguess application)

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

html xmlns=
http://www.w3.org/1999/xhtml
head
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/
meta http-equiv=refresh content=0; url= ""
/
titleUntitled Document/title
/head

body
/body
/html


when this gets loaded (and it will try to load the main.jsf )

the app fails miserably by saying 

The requested resource (/TestJSFApp/main.jsf) is not available.

For some weird reason, page does not get rendered, which leads me to think
that
some parameters are not set, since i am having a main.xhtml (written usign
facelets) that should 
be rendered properly


can anyone find any reason of why facelets does not work with my applications?

regards
 marco



here's my web.xml   (be patient, it's long)

?xml version=1.0 encoding=UTF-8?

!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd


web-app 
context-param
  param-namecontextConfigLocation/param-name 
  param-value
/WEB-INF/core-context.xml
/WEB-INF/web-context.xml
/WEB-INF/aop-context.xml
/WEB-INF/applicationContext-acegi-security.xml
/WEB-INF/applicationContext- common-authorization.xml
/WEB-INF/applicationContext-common-business.xml
  /WEB-INF/faces-context.xml
/WEB-INF/dataSourcePopulator.xml

  /param-value
/context-param 

context-param
 param-namejavax.servlet.jsp.jstl.fmt.localizationContext/param-name
 param-valueresources.MessageResources/param-value
/context-param

context-param
   param-namejavax.faces.CONFIG_FILES/param-name
   param-value/WEB-INF/faces-config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml/param-value

/context-param

context-param
param-namejavax.faces.STATE_SAVING_METHOD/param-name
param-valueclient/param-value
description 
  State saving method: client
or server (= default)
  See JSF Specification 2.5.2
/description
  /context-param

  context-param 
param-nameorg.apache.myfaces.ALLOW_JAVASCRIPT/param-name
param-v

Re: MyFAces with FAcelets

2006-02-21 Thread Adam Brod

Marco-

Here's is my understanding of your current
situation. Correct me if I'm wrong.

1) When you hit main.xhtml directly,
the webserve does return the xhtml page, with no processing of tags. That's
good. That's what you want to happen. By going directly to
the xhtml page, you are going around the JSF Servlet and just requesting
a static page from your webserver.

2) When you hit main.jsf, you get an
error saying resource cannot be found. That indicates that you don't
have your FacesServlet configured properly (I think). 

When main.jsf fails to load, look for
any errors in the console or error logs. Perhaps something is throwing
an exception.

As far as I can tell, your web.xml file
looks okay, but very complex. One small detail is there is an extra
space character in the ?xml version= 1.0...? - you
should probably remove the space before 1.0. I also see things in
web.xml that are specific to Sun's JSF reference implementation (anything
with com.sun.faces.xxx) - I would recommend you remove all of those if
you're using MyFaces. 

You have a lot of different frameworks
configured all at once. I would recommend paring them back to see
if you can get things working. Since main.xhtml is pretty simple,
try removing all of the Spring, Acegi and Tiles configuration from your
web.xml. You also might want to make sure that the facelets hangman
demo runs okay in your web container. You should be able to deploy
that with no problems. Basically, start with a webapp that is much
simpler and work your way up adding new frameworks one at a time once you
know the app is deployed okay.

Also, make sure your faces-config.xml
file has Facelets properly configured to handle the views. E.g.:

 application
  view-handler
  
   com.sun.facelets.FaceletViewHandler
  /view-handler
 /application

HTH,

Adam Brod
Product Development Team




Marco Mistroni
[EMAIL PROTECTED] 
02/21/2006 11:45 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: MyFAces with FAcelets








Hello Adam,
 when i access main.xhtml, INternet explorer does not 'recongnize'
it and ask me if i want to open the page.
so, yes, something is not configured properly, but i can' tfigure out what...

it looks like it does not recongize facelets tags at all.. since the text
that is not supposed to be shown 
instead it is shown..

here's my main.xhtml

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0
Transitional//EN 
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

html xmlns=
http://www.w3.org/1999/xhtml
   xmlns:ui=http://java.sun.com/jsf/facelets

   
 body

  ui:composition template=/layout/verticalClassicLayout.xhtml


   This text will not be displayed.Wrong! iw till be..

   ui:define name=title

 BudgetApp version 1.3 - Budget Queries
   /ui:define

   This text will also not be displayed.


   ui:define
 name=body
 
   Simple Test for entry
   /ui:define


  /ui:composition

 
 /body
/html   




here' s again my wbe.xml

?xml version= 1.0 encoding=UTF-8?

!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd


web-app 
 context-param
  param-namecontextConfigLocation/param-name
  param-value
/WEB-INF/core-context.xml
/WEB-INF/web-context.xml 
/WEB-INF/aop-context.xml
/WEB-INF/applicationContext-acegi-security.xml
/WEB-INF/applicationContext-common-authorization.xml
/WEB-INF/applicationContext-common-business.xml
  /WEB-INF/faces-context.xml
/WEB-INF/dataSourcePopulator.xml

  /param-value
/context-param

context-param
 param-namejavax.servlet.jsp.jstl.fmt.localizationContext
/param-name
 param-valueresources.MessageResources/param-value
/context-param

context-param
   param-namejavax.faces.CONFIG_FILES/param-name
   param-value/WEB-INF/faces- config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml/param-value
/context-param

context-param
param-namefacelets.REFRESH_PERIOD/param-name
param-value2/param-value
  /context-param

  context-param
param-namefacelets.DEVELOPMENT/param-name
param-valuetrue/param-value

  /context-param

  context-param
param-namejavax.faces.STATE_SAVING_METHOD/param-name
param-valueclient/param-value
  /context-param 
  context-param
param-namejavax.faces.DEFAULT_SUFFIX/param-name
param-value.xhtml/param-value
  /context-param

  context-param 
param-namecom.sun.faces.validateXml/param-name
param-valuetrue/param-value
description
  Set this flag to true if you
want the JavaServer Faces 
  Reference Implementation to validate
the XML in your
  faces-config.xml resources against
the DTD. Default
  value is false.
/description
  /context-param 

  context-param
param-namecom.sun.faces.verifyObjects/param-name
param-valuetrue/param-value
description
  Set this flag to true if you
want the JavaServer Faces 
  Reference

Re: MyFAces with FAcelets

2006-02-21 Thread Adam Brod

That's really a question for the Facelets
user group. However, yes, you can have components in your templates,
but you have to be a bit careful to define the view component to include
all the components.

Adam Brod
Product Development Team




Marco Mistroni
[EMAIL PROTECTED] 
02/21/2006 12:15 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
Re: MyFAces with FAcelets








Hello guys,
 ok i figured out what's the problem... it's my template layout
page that has somethign wrong in it..
when i replaced it iwth the template that comes with facelets demo application
everything works fine... 

i guess i'll get back here when i will find out what's wrong with my original
template.

one quick question: can a template include JSF elements? will i have problems?

thanks and regards

 marco 

On 2/21/06, Marco Mistroni [EMAIL PROTECTED]
wrote:
hello richard,
 thanx for your reply

unfortunately, when i enter pagename.jsf i get following error

type Status report
message /TestJSFApp/main.jsf
description The requested resource (/TestJSFApp/main.jsf)
is not available.

pls note that this was working when i was usingn tiles... i can't
imagine what could be thep roblem

am i specifying the wrong handler in jsf-config ?


faces-config
   application 
locale-config
default-localeen/default-locale
/locale-config
message-bundleresources.MessageResources/message-bundle

view-handler 
   com.sun.facelets.FaceletViewHandler
  /view-handler   
  /application

 ...
/faces-config

?

thanx and regards
 marco 





On 2/21/06, Richard Frazer [EMAIL PROTECTED]
wrote:
What's the url you are trying to hit? Based
on the web.xml below, you are mapping the faces servlet to *.jsf. The
url you enter should be pagename.jsf, not pagename.xhtml.




From: Marco Mistroni [EMAIL PROTECTED]
Reply-To: MyFaces Discussion users@myfaces.apache.org
Date: Tue, 21 Feb 2006 16:45:12 +
To: MyFaces Discussion users@myfaces.apache.org
Subject: Re: MyFAces with FAcelets

Hello Adam,
 when i access main.xhtml, INternet explorer does not 'recongnize'
it and ask me if i want to open the page.
so, yes, something is not configured properly, but i can' tfigure out what...

it looks like it does not recongize facelets tags at all.. since the text
that is not supposed to be shown 
instead it is shown..

here's my main.xhtml

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd


html xmlns=
http://www.w3.org/1999/xhtml
http://www.w3.org/1999/xhtml

   xmlns:ui=http://java.sun.com/jsf/facelets

   
 body

  ui:composition template=/layout/verticalClassicLayout.xhtml


   This text will not be displayed.Wrong! iw till be..

   ui:define name=title

 BudgetApp version 1.3 - Budget Queries
   /ui:define

   This text will also not be displayed.


   ui:define
 name=body
 Simple Test for entry
   /ui:define


  /ui:composition

 
 /body
/html   




here' s again my wbe.xml

?xml version= 1.0 encoding=UTF-8?

!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN 
http://java.sun.com/dtd/web-app_2_3.dtd
http://java.sun.com/dtd/web-app_2_3.dtd
 


web-app 
 context-param
  param-namecontextConfigLocation/param-name
  param-value
/WEB-INF/core-context.xml
/WEB-INF/web-context.xml 
/WEB-INF/aop-context.xml
/WEB-INF/applicationContext-acegi-security.xml
/WEB-INF/applicationContext-common-authorization.xml
/WEB-INF/applicationContext-common-business.xml
  /WEB-INF/faces-context.xml
/WEB-INF/dataSourcePopulator.xml

  /param-value
/context-param

context-param
 param-namejavax.servlet.jsp.jstl.fmt.localizationContext
/param-name
 param-valueresources.MessageResources/param-value
/context-param

context-param
   param-namejavax.faces.CONFIG_FILES/param-name
   param-value/WEB-INF/faces- config.xml,/WEB-INF/faces-managed-beans.xml,/WEB-INF/faces-navigation.xml/param-value
/context-param

context-param
param-namefacelets.REFRESH_PERIOD/param-name
param-value2/param-value
  /context-param

  context-param
param-namefacelets.DEVELOPMENT/param-name
param-valuetrue/param-value

  /context-param

  context-param
param-namejavax.faces.STATE_SAVING_METHOD/param-name
param-valueclient/param-value
  /context-param 
  context-param
param-namejavax.faces.DEFAULT_SUFFIX/param-name
param-value.xhtml/param-value
  /context-param

  context-param 
param-namecom.sun.faces.validateXml/param-name
param-valuetrue/param-value
description
  Set this flag to true if you
want the JavaServer Faces 
  Reference Implementation to validate
the XML in your
  faces-config.xml resources against
the DTD. Default
  value is false.
/description
  /context-param 

  context-param
param-namecom.sun.faces.verifyObjects/param-name

Re: Any inside of a very slow page loading of t:dataTable in Weblogic 8.1 sp4?

2006-02-20 Thread Adam Brod

Any chance your JSP wasn't precompiled?
That's the only thing I can think of that would cause that if the
rest of the code is the same.

Adam Brod
Product Development Team




Emily Gu [EMAIL PROTECTED]

02/18/2006 01:07 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
Any inside of a very slow
page loading of t:dataTable in Weblogic 8.1 sp4?








Hi,

I have a t:dataTable deployed on Weblogic 8.1
sp4. The table is bounded to a backing bean in session. It is so slow when
I click to next page. The data should be in memory already. It took no
time in Tomcat when paginating to the next page. But Weblogic 8.1 sp4 is
thinking very long to get to next page. Do you know anything I could be
done wrong in server setup in causing this? I know my question is off topic.
But BEA seems have the worse support. I have never gotten any answers from
them. Any help is very much appreciated. 

Thanks,
Emily

RE: MyFaces + Weblogic = Classloading Problems

2006-02-20 Thread Adam Brod

Hi-

This is still an issue for our team.
The problem occurs when a new class file is deployed, not a JSP.
For example, if I have a managed bean that I update and then copy
to the deployment directory, I get the java.lang.IllegalStateException:
No Factories configured for this Application... error.

The root of the problem is in the implementation
of FactoryFinder. It stores the Factory classes in a Map where the
key to the Map is the current ClassLoader. For Weblogic when you
deploy a new class, it drops the current Servlet's classloader and creates
a new one. That means the call to get a Factory returns null because
the new classloader is not a valid key.

FactoryFinder snippet:
  ClassLoader classLoader
= getClassLoader();
  Map factoryClassNames
= (Map) _registeredFactoryNames.get(classLoader);

The problem is the second line. Since
classloader refers to the newly loaded classloader, factoryClassNames is
always null.

Does anybody have a workaround for this?
I will log this as an issue since using Classloaders as a Map key
is not a very portable way to store the data.

Any help/workarounds would be greatly
appreciated.

Adam Brod
Product Development Team




Jesse Alexander \(KBSA
21\) [EMAIL PROTECTED] 
02/11/2006 05:43 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion
users@myfaces.apache.org


cc



Subject
RE: MyFaces + Weblogic =
Classloading Problems








The problem you mention (and the
code you found) were needed for WLS-versions
prior to 8.1.4 From that patchlevel
on a patch has been added to WLS to fix the 
contextlistener-init problem.

I just deployed the MyFaces simple
application (just had to remove the
description tags from the context-params,
nothing else) as an exploded
webapp to the autodeploy directory.
Every change to a jsp-file was immediately 
recognized and resulted in a different
html-view...

Hmm... what could be the differences?
I use OpenSuse 10.0 (linux) and
a 9.0 download from yesterday evening.

regards
Alexander


From: Adam Brod [mailto:[EMAIL PROTECTED]

Sent: Friday, February 10, 2006 3:43 PM
To: MyFaces Discussion
Subject: Re: MyFaces + Weblogic = Classloading Problems


Yes, I have tried it with and without the context-listener.


Any additional ideas? I'm sure there must be other people developing
on weblogic, right?

Adam Brod
Product Development Team



Martin Marinschek [EMAIL PROTECTED]

02/10/2006 12:57 AM





Please respond to
MyFaces Discussion users@myfaces.apache.org






To
MyFaces Discussion
users@myfaces.apache.org 


cc



Subject
Re: MyFaces + Weblogic =
Classloading Problems










Have you tried to setup your context-listener in the web.xml directly?

regards,

Martin

On 2/9/06, Adam Brod [EMAIL PROTECTED] wrote:

 Hi-

 I am running into a problem with Classloading with MyFaces 1.1.1 on
Weblogic
 9. Weblogic allows you to deploy your webapp in an exploded
directory
 format. That means that you can modify a JSP (or Facelet xhtml)
and copy it
 to the deployment directory to be automatically redeployed. This
 functionality works fine in the old Struts/JSP world.

 Now that I'm using MyFaces, I'm running into problems with the
 FactoryFinder. As I understand it, FacesServlet or FactoryFinder
stores
 the Factories based on the current classloader. When Weblogic
redeploys a
 JSP, it drops the current ClassLoader and creates a new one. That
means
 that the next time I hit a JSF page, I get an IllegalStateException
(see
 full stack trace below).

 I looked at the code in FacesServlet and I see this comment, //TODO:
 null-check for Weblogic, that tries to initialize Servlet before
 ContextListener. Obviously I'm not the first to run into
this problem. I
 browsed the source of the trunk online and I see the same code is
still
 there. Does anybody have a fix for this? Is there any
work around other
 than doing a full redeploy for each JSP modification?

 Thanks for your help.

 Adam


 java.lang.IllegalStateException: No Factories configured for this
 Application - typically this is because a context listener is not
setup in
 your web.xml.
 A typical config looks like this;
 listener

 listener-classorg.apache.myfaces.webapp.StartupServletContextListener/listener-class
 /listener

 at
 javax.faces.FactoryFinder.getFactory(FactoryFinder.java:84)
 at
 javax.faces.webapp.FacesServlet.init(FacesServlet.java:84)
 at
 weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:265)
 at
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 at
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
 at
 weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:61)
 at
 weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
 at
 weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48

Re: exception when using an EAR

2006-02-16 Thread Adam Brod

I can't open the zip. Can you include
the source for the offending JSP, the Backing Bean and part of faces-config.xml
where the backing bean is configured?

Adam Brod
Product Development Team




David Schlotfeldt [EMAIL PROTECTED]

02/15/2006 04:13 PM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
users@myfaces.apache.org


cc



Subject
exception when using an EAR








I have attached a zip... (well attached if it isn't
removed by the
mailing list) that contains the source and EAR file I am having an issue
with. This is a very very simple example I put together to show the issue.

The EAR contains a WAR and a JAR. The problem is myfaces finds the
backing bean that are in the JAR when a page from the WAR is accessed
but for some reason throws the exception below when its creating the
table. If I put what is in the JAR currently into WEB-INF/classes of the
WAR I have no problems.

How do I get it so I can have the classes in the JAR?
(I need this because in my actual project the JAR is an EAR and I don't
want those classes in the WAR.)
Also just to note, I am not using the myfaces that comes with jboss
because version 1.1.1 of myfaces that comes with jboss has 2 bugs that
I
need fixed and the bugs are fixed in the nightly build. I have removed
faces from jboss and packaged the nightly builds of myfaces with the WAR.

javax.faces.el.PropertyNotFoundException: Bean:
javax.faces.model.ListDataModel, property: id
   at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:483)
   at
org.apache.myfaces.el.PropertyResolverImpl.getPropertyDescriptor(PropertyResolverImpl.java:454)
   at
org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:417)
   at
org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:82)
   at
org.apache.myfaces.el.ELParserHelper$MyPropertySuffix.evaluate(ELParserHelper.java:532)
   at org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
   at
org.apache.myfaces.el.ValueBindingImpl.getValue(ValueBindingImpl.java:383)
   at
org.apache.myfaces.component.html.ext.HtmlDataTable.getForceIdIndexFormula(HtmlDataTable.java:634)
   at
org.apache.myfaces.component.html.ext.HtmlDataTable.getClientId(HtmlDataTable.java:96)
   at
org.apache.myfaces.component.html.ext.HtmlDataTableHack.setRowIndex(HtmlDataTableHack.java:275)
   at
org.apache.myfaces.component.html.ext.HtmlDataTable.setRowIndex(HtmlDataTable.java:219)
   at
org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeInnerHtml(HtmlTableRendererBase.java:147)
   at
org.apache.myfaces.renderkit.html.HtmlTableRendererBase.encodeChildren(HtmlTableRendererBase.java:99)
   at
org.apache.myfaces.renderkit.html.ext.HtmlTableRenderer.encodeChildren(HtmlTableRenderer.java:113)
   at
javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:524)
   at
javax.faces.webapp.UIComponentTag.encodeChildren(UIComponentTag.java:474)
   at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:361)
   at
org.apache.myfaces.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:55)
   at
org.apache.jsp.test_jspx._jspx_meth_t_dataTable_0(org.apache.jsp.test_jspx:169)
   at
org.apache.jsp.test_jspx._jspx_meth_h_form_0(org.apache.jsp.test_jspx:131)
   at
org.apache.jsp.test_jspx._jspx_meth_f_view_0(org.apache.jsp.test_jspx:106)
   at org.apache.jsp.test_jspx._jspService(org.apache.jsp.test_jspx:74)
   at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
   at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
   at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
   at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
   at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
   at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
   at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
   at
org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
   at
org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
   at
org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:372)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
   at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252

Tree2 TreeTable?

2006-02-15 Thread Adam Brod

Hi-

I've already got some code that uses Tree2 (with the Tree 2 model objects).
Is there any good way to output Tree2 into a table? Similar
to the TreeTable component for the Tree(1) component?

Thanks,
Adam

Adam Brod
Product Development Team

Re: MyFaces + Weblogic = Classloading Problems

2006-02-10 Thread Adam Brod

Yes, I have tried it with and without
the context-listener.

Any additional ideas? I'm sure
there must be other people developing on weblogic, right?

Adam Brod
Product Development Team




Martin Marinschek [EMAIL PROTECTED]

02/10/2006 12:57 AM



Please respond to
MyFaces Discussion users@myfaces.apache.org





To
MyFaces Discussion users@myfaces.apache.org


cc



Subject
Re: MyFaces + Weblogic =
Classloading Problems








Have you tried to setup your context-listener in the
web.xml directly?

regards,

Martin

On 2/9/06, Adam Brod [EMAIL PROTECTED] wrote:

 Hi-

 I am running into a problem with Classloading with MyFaces 1.1.1 on
Weblogic
 9. Weblogic allows you to deploy your webapp in an exploded
directory
 format. That means that you can modify a JSP (or Facelet xhtml)
and copy it
 to the deployment directory to be automatically redeployed. This
 functionality works fine in the old Struts/JSP world.

 Now that I'm using MyFaces, I'm running into problems with the
 FactoryFinder. As I understand it, FacesServlet or FactoryFinder
stores
 the Factories based on the current classloader. When Weblogic
redeploys a
 JSP, it drops the current ClassLoader and creates a new one. That
means
 that the next time I hit a JSF page, I get an IllegalStateException
(see
 full stack trace below).

 I looked at the code in FacesServlet and I see this comment, //TODO:
 null-check for Weblogic, that tries to initialize Servlet before
 ContextListener. Obviously I'm not the first to run into
this problem. I
 browsed the source of the trunk online and I see the same code is
still
 there. Does anybody have a fix for this? Is there any
work around other
 than doing a full redeploy for each JSP modification?

 Thanks for your help.

 Adam


 java.lang.IllegalStateException: No Factories configured for this
 Application - typically this is because a context listener is not
setup in
 your web.xml.
 A typical config looks like this;
 listener

 listener-classorg.apache.myfaces.webapp.StartupServletContextListener/listener-class
 /listener

 at
 javax.faces.FactoryFinder.getFactory(FactoryFinder.java:84)
 at
 javax.faces.webapp.FacesServlet.init(FacesServlet.java:84)
 at
 weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(StubSecurityHelper.java:265)
 at
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 at
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
 at
 weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecurityHelper.java:61)
 at
 weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubLifecycleHelper.java:58)
 at
 weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHelper.java:48)
 at
 weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:502)
 at
 weblogic.servlet.internal.ServletStubImpl.checkForReload(ServletStubImpl.java:429)
 at
 weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:221)
 at
 weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
 at
 weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022)
 at
 weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
 at
 weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
 at
 weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:1925)
 at
 weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848)
 at
 weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)
 at
 weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)

 Adam Brod
 Product Development Team



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces


JSF Design Question

2006-02-09 Thread Adam Brod

Hi-

I have run into a few problems moving
from the struts way of thinking to JSF. I'm hoping that the many
smart people on this list have made that jump. I'm stuck trying to
design the most elegant way to implement a piece of functionality I'll
call Update Document. I would appreciate it if anybody
can help. I'm sure many people have run into a similar design question.

Here are the relevant objects:
-Document
(this is the domain object being updated)
-DocumentRepository
(this is like a DAO object - it retrieves and persists the Document)
-DocumentController
(this is a POJO JSF-managed bean with request scope)
-UpdateDocument.jsp
(this is the JSF view that displays
the Update Document form)

Here are my constraints:
- My DocumentController (a managed bean)
should not use any Faces/Http objects. That is, no Request, no FacesContext,
etc. All request parameters should automatically map to objects
- I don't want to store anything in
the session
- I want to write the least code possible
(while still being manageable)

Here's what I would like to have happen
(but can't figure out how to do it):
1) On the Update Document page, the
user update the document title and clicks save 
2) JSF instantiates a new documentController
(request scope)
3) JSF passes the documentID
to the controller
4) The documentController
loads the Document from the DocumentRepository
5) JSF calls documentController.getDocument()
and maps the values from the Update Document form to the Document domain
object 
(e.g.,
h:inputText
id=title
value=#{documentController.document.title}/)

What I like about my approach is that
JSF just sets the values directly on my domain object. I don't want
to have to create a dummy FormBean that JSF uses to set the parameters
because then I would be forced to do a second round of copying from the
FormBean to the domain object. The domain object is actually just
an interface that only the repository can instantiate.

My problem is that I can't ever get
JSF to execute step 3 before step 5 gets called. I've tried using
the updateActionListener, but that gets invoked after the values are set.
I've tried using a hidden parameter to pass the documentID to the
documentController, but that didn't seem to work either. Below I've
included a simplified DocumentController and the Update Document form.

Does anybody have any advice??

Thanks, 
Adam

public class DocumentController
{
  // if the
documentID is set, this will load the Document from the repository
  public Document
getDocument();
  public void
setDocumentID(long id);

  // action
method to save Document to the repositor
  public String
save();
}

This is what my UpdateDocument form
looks like:
h:form
id=updateDocument
  h:panelGrid
columns=2


  h:column

   h:outputLabel
value=#{msgs.title}
for=title
/
/h:column
h:column
   

 h:inputText
id=title
value=#{documentController.document.title}
required=true

  f:validateLength
minimum=3
maximum=25
/

 /h:inputText

 h:message
for=title
styleClass=errorMessage
/

   /h:column

   h:column

 h:outputLabel
value=#{msgs.email}
for=email
/
/h:column
h:column
   

 h:inputText
id=email
value=#{documentController.document.email}
required=true
/

 h:message
for=email
styleClass=errorMessage
/
 
/h:column

   
  /h:panelGrid
  h:commandButton
id=submit
action=#{documentController.save}
value=#{msgs.enter}
/
  h:commandButton
id=cancel
action=cancel
value=#{msgs.cancel}
/
/h:form