Re: When to use JSF?

2006-11-14 Thread David Geary

As a general rule, I would only use Struts if I had a considerable legacy
system built with it. In that case, depending upon the skillsets of your
team and the amount of legacy code, it might be better to stick with Struts.

But otherwise, Struts is dated, and in today's world is a pretty tedious way
to develop a new application. JSF is much better. For example, value
expressions in JSF reduce the amount of code you must write vs. Struts in a
big way. Instead of implementing a Struts action, that's passed a form bean,
from which you manually pull strings, convert them to their appropriate
type, and manually push that data to the model, in JSF, you just do this: #{
bean.property} and JSF takes care of all that tedium for you. Struts
dynabeans help in that regard, but still...

That said, JSF has many flaws and holes; for example, JSF doesn't explicitly
support client-side validation out of the box. Shale, and other open-source
frameworks such as Facelets, Seam, and Ajax4jsf serve to fill those holes
and provide a great deal of cool functionality on top.

btw, all of my comments concerning Struts refer to Struts 1.X. I know very
little about Struts 2, other than it is really WebWork in disguise.


david

2006/11/14, Thomas Walland [EMAIL PROTECTED]:


I have a question to the usage of JSF and Shale.

Are there any rules or is there any limitation, when Shale/JSF should
be applied to a project?

Until now I only worked with Struts. So I was involved in page-centric
developement.

Is it easy to build applications which uses user-input in a massive
way? For example, triggering some actions because of some input-data?

I just want a few rules or tipps, when to use JSF and when it would be
better to continue using struts.

Thanks a lot,
Thomas




Re: form rendering problem

2006-11-13 Thread David Geary

David D. gives some good advice, but the standard JSF way of doing this,
without having to drag Tomahawk into the mix is to use h:panelGrid. btw,
you don't need empty bodies in your JSF HTML tags.


david

2006/11/13, david.delbecq [EMAIL PROTECTED]:


Hi Jonathan,

Don't mix JSF component and html tags in your JSP. The whole JSF form
tree is rendered at the position of the h:form and the html tags are
rendered after the form tag. If you want to include html tags inside
your jsf tree, use the f:verbatim component around html sections or
use the t:tag of tomahawk. The later one is cleaner in terms of
hierarchy in the jsp, but might be difficult to read if you go too deep.

In your case (rendering a table) there is already a grid component in
tomahawk that does it :)


btw, attachements are stripped away from mailing list. If you want to
provide screenshots use something like imageshak.

Jonathan Smith a écrit :
 ok using this code

 %@ page language=java contentType=text/html; charset=ISO-8859-1
 pageEncoding=ISO-8859-1%
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN


 %@ taglib prefix=f uri=http://java.sun.com/jsf/core%
 %@ taglib prefix=h uri=http://java.sun.com/jsf/html%
 %@ taglib prefix=t uri=http://myfaces.apache.org/tomahawk%



 t:div styleClass=portletheader
 h:outputText value=Add Contact/h:outputText
 /t:div

 h:form
 table
 tr
 td width=50%h:outputText value=First Name: 
 //td
 td width=50%h:inputText id=fName value= //td
 /tr
 tr
 tdh:outputText value= Last Name:  //td
 tdh:inputText id=lName value= //td
 /tr
 tr
 tdh:outputText value= Office:  //td
 tdh:inputText id=office value= //td
 /tr
 tr
 tdh:outputText value= Extension:  //td
 tdh:inputText id=extension value= //td
 /tr
 tr
 tdh:outputText value= Email:  //td
 tdh:inputText id=email value= //td
 /tr
 tr
 tdh:outputText value= IM Username:  //td
 tdh:inputText id=imUsername value= //td
 /tr
 tr
 tdh:outputText value= IM Service: //td
 tdh:inputText id=imService value= //td
 /tr
 /table
 h:commandButton styleClass=managerboxbutton
 style=margin-top:5%;
 value=Add Contact action=addcontact/h:commandButton
 /h:form

 the form gets rendered wrong. please see attachment for a picture.

 _
 Stay in touch with old friends and meet new ones with Windows Live
 Spaces

http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us





Re: Is it a postback or a fresh page load?

2006-11-08 Thread David Geary

2006/11/8, Craig McClanahan [EMAIL PROTECTED]:


On 11/8/06, Ramineni Viswanath [EMAIL PROTECTED] wrote:

 While on a page, I call the same page with a different
 set of query parameters, it is being treated as a
 postback.

 For example my current url is

 /mainmenu.faces?menuid=0

 I have a HtmlOutputLink on this page with the value
 set to /mainmenu.faces?menuid=26. When I click on this
 link, isPostBack() is showing true. Is this the
 correct and intended behaviour?


The mechanism used to declare a request being a postback is whether the
ViewController.restoreView() method provided by JSF determines that there
was an existing view that could be restored.  In turn, if you are using
server side state saving with current 1.1 implementations, this decision
is
based solely on the view identifier, not on any related parameters.  Thus,
if you are using server side state saving, JSF will treat your two URLs as
being the same, and will restore the previous state (and, therefore, the
postback property will be set to true).

If you were to use client side state saving, on the other hand, the two
URLs
would be considered distinct views (since the HtmlOutputLink ends up doing
a
GET to the second URL), with no state to be restored, and therefore
postback
would be false.



Holy cow, I didn't know that. Is that not a bug according the definition of
a postback? IMO, behaviour that differs depending upon state-saving mode is
bad news.


david

--Vish



Craig




Re: new to shale tiles

2006-11-08 Thread David Geary

2006/11/8, Jonathan Smith [EMAIL PROTECTED]:


added the space and the flush false now i get a

java.lang.IncompatibleClassChangeError
org.apache.shale.tiles.TilesViewHandler.dispatchToTile(
TilesViewHandler.java:304)
org.apache.shale.tiles.TilesViewHandler.renderView(
TilesViewHandler.java:160)
org.apache.myfaces.lifecycle.LifecycleImpl.render(
LifecycleImpl.java:384)
javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter
(ShaleApplicationFilter.java:267)

what does this mean?



It means you're screwed. 8-)

That's essentially a linkage error (see the javadocs). I suspect you somehow
have incompatible JARs. It looks like you're trying to call the Tiles
ComponentContext, but that class is not what the compiler is expecting.

What version of Tiles are you using? You must use the standalone version of
Tiles with Shale.

david


From: David Geary [EMAIL PROTECTED]
Reply-To: user@shale.apache.org
To: user@shale.apache.org
Subject: Re: new to shale tiles
Date: Wed, 8 Nov 2006 10:09:47 -0700

I believe you're missing a space between the two attributes. Also, you
should specify flush=false or you're bound to run into problems.


david

2006/11/8, Antonio Petrelli [EMAIL PROTECTED]:

Jonathan Smith ha scritto:
  ok when i do this
 
  tiles:insert definition=debug2flush=true/tiles:insert
 
  with this as the definition
 
  tiles-definitions
 
 
 
 
  definition name=debug2 path=debug2.jsp
  put name=header type=template
  value=/debug/debug-header.jsp /
  /definition
 
  definition name=header value=/debug/debug-header.jsp /
 
  /tiles-definitions
 
 
  I get this
 
  javax.servlet.ServletException: /debug2.jsp(4,0) Attribute definition
  invalid for tag insert according to TLD
  javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
 
org.apache.shale.application.faces.ShaleApplicationFilter.doFilter(
ShaleApplicationFilter.java:267)
 
 
  what am i doing wrong?

It's not your fault :-) Notice that Tiles 2 is under heavy development.
For example you have a snapshot where tiles:insert tag is still there,
while in the SVN repository, that tag is not there anymore, because it
is splitted in three.
http://struts.apache.org/struts-sandbox/tiles/faq.html#insert

Ciao
Antonio


_
Stay in touch with old friends and meet new ones with Windows Live Spaces

http://clk.atdmt.com/MSN/go/msnnkwsp007001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=createwx_url=/friends.aspxmkt=en-us




Re: General questions to shale...

2006-11-03 Thread David Geary

2006/11/3, Thomas Walland [EMAIL PROTECTED]:


Hi,

As I already wrote, I am a newby to apache shale. So I have a few
general questions.

I have great experience with apache struts, but never made some work
with JSF or other technologies which are used in shale.

So I need something like a short introduction in the style of shale
für struts users.



Shale is built on JSF, so you need to have a good grasp of JSF fundamentals.

I heard a lot about the prerenderer. Is this something like the

controller-classes in struts-tiles? A class or action which is called
just before the associated jsp or html file is rendered?



Yes, the controller's prerender method is indeed much like a Tiles
controller. In that method, you generally set things up for the view.

Until now I had only a look to the clay-usecases example which is

distributed on the shale-webpage. In this example, there is a
managed-bean defined (QueryParam) which puts some Request-Parameters
into the defined class.

Can we say in general, that this is a rebuild of the functionality of
the Struts-Action's?

Another question: Most question and mails on this list refer to jsp
functionality and problems with some jsp-errors. As I heard about
struts especially about clay, this was the most interesting point for
me. But it seems that not that much people are using clay at the
moment?

Are there some great disadvantages about this technology? I want to
realize a huge project with shale and also with clay. Is it a too
early stage to use clay? Is there some further developement work,
which should be done?



truphone.com was implemented using Shale and Clay.

I hope my questions are clearly written. I am not so an experienced

english-writer.



No problem, you're doing very well.


david

Thanks :-)

   Thomas

---
Thomas Walland
http://www.walland.net
[EMAIL PROTECTED]




Re: Please Welcome Rahul Akolkar As A Shale Committer

2006-10-14 Thread David Geary

Thanks for all of the work you've already done on Shale, Rahul. We're glad
to have you on board!


david


2006/10/13, Matthias Wessendorf [EMAIL PROTECTED]:


welcome dude!

On 10/13/06, James Mitchell [EMAIL PROTECTED] wrote:
 Welcome Rahul!


 --
 James Mitchell
 678.910.8017




 On Oct 12, 2006, at 12:00 PM, Craig McClanahan wrote:

  Please extend a welcome to Rahul Akolkar as a committer to Shale.
  Rahul has
  been working tirelessly on the new Dialog2 code in the sandbox, as
  well as
  the Commons SCXML technology that is used by one of the Dialog2
  implementations.  He has consistently shown he gets it on how Apache
  projects work, and we welcome his participation across the rest of
  the Shale
  codebase as well.
 
  Welcome Rahul!
 
  Craig




--
Matthias Wessendorf
http://tinyurl.com/fmywh

further stuff:
blog: http://jroller.com/page/mwessendorf
mail: mwessendorf-at-gmail-dot-com



Re: Logo Contest - what happened?

2006-10-04 Thread David Geary

1st choice: Walied Amer {84} (drop of oil is a nice touch, Walied)
2nd choice: Michael Ameduri {49}
3th choice: Aide Chang {70}
4rd choice: Michael Ameduri {31}
5th choice: Coco {73}


david

2006/10/4, James Mitchell [EMAIL PROTECTED]:

The voting is still open right now.  We'll give people until this
weekend before we tally the results.

If anyone hasn't voted yet, please do so.

--
James Mitchell
678.910.8017




On Oct 4, 2006, at 2:53 AM, Randahl Fink Isaksen wrote:

 According to the website

 September 19, 2006 to determine the winner

 but as far as I can tell, there is still a lot of people voting.
 Has the deadline been postponed?

 Randahl





Re: Shale-Clay site goes live: http://www.truphone.com

2006-09-25 Thread David Geary

Hey Ian,

Thanks so much for pointing us to your site. I'm part of a travelling road
show where I teach Shale and Clay and I'm often specifically asked about
commercial sites that use Clay's approach to separating HTML and components
so that page authors and software developers can easily work with graphic
artists.

I will add a screenshot of your application to my slideshow (
http://nofluffjuststuff.com/speaker_topic_view.jsp?topicId=18)

Thanks again!


david

2006/9/15, Gary VanMatre [EMAIL PROTECTED]:


Hi Ian,

Thanks for sharing your success with us.  I really appreciate your
participation and for the kind words.  The site looks very sexy!

Gary

-- Original message --
From: Ian.Priest [EMAIL PROTECTED]

 Hi all,

 I thought you might be interested to know that the site I've been
 working on for the past few months has now gone live. The site,
 http://www.truphone.com, is driven by Shale/Clay sitting on MyFaces and
 running inside Tomcat. Underneath there is a MySQL database and a
 bespoke application backend that provides the functionality and
 interfaces with the VoIP provider and various other third parties.

 Clay was chosen for the ability to write pure HTML that could then be
 replaced by dynamic content and for the Tiles-like layout feature. That
 was quite important as I was working with a third-party HTML design
 agency (sadly that slick look and feel isn't my design!) so JSP or
 similar would have been inappropriate. However, a later architecture
 re-design showed that Clay was a better choice than realised because I
 was able to exploit the full-xml and symbol replacement bits of Clay to
 get a very nice site that blends dynamic and static content in quite a
 cool manner. The pages are rendered by pulling sub-section pages into a
 layout to create some archetypes. The full-xml view pages extend the
 archetypes and use clay and clayImport to pull in the final bits of
 content in a nice ready for multi-language manner. Those of you who have
 read and answered my various postings over the last few months will have
 a pretty good idea of how it's put together, and now the mystery of the
 unusual .tru extension is solved too :-) (see previous theads).

 I'm sure Truphone would welcome any constructive comments and I know I
 would.

 I'd like to say thanks to everyone here. I couldn't have done it without
 the help and advice received on this forum, and I'd especially like to
 single out Gary VanMatre for help he's given me. Thanks. Hope you like
 the site.

 Cheers,
 Ian.





Re: TilesViewHandler

2006-08-29 Thread David Geary

2006/8/29, Baker,Jonathan [EMAIL PROTECTED]:


I'm sure if I renamed my tiles to have the slash at the beginning of their
names that it would work as well.  My confusion is over the explicit
statement that it will look for a tile both with and without the leading
slash and that does not seem to be the case.



It is no longer the case, and the latest documentation has been updated to
reflect that.


david

JB


-Original Message-
From: Dick Starr [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 8:37 AM
To: user@shale.apache.org
Subject: RE: TilesViewHandler


Standalone Tiles works for me.

In tiles.xml I use definitions like definition name=/myDef ...

My navigation rules are like from-view-id/myDef.jsp/from-view-id

I do not have to do an extra jsp containing a tiles:insert definition=
... for my tiles - except for my very first tile (a jsp:forward from
index.jsp).

I am using the 8/3/06 release.

Dick

-Original Message-
From: Baker,Jonathan [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 29, 2006 6:28 AM
To: Shale User Group (E-mail 2)
Subject: TilesViewHandler

According to the Documentation for the shale-tiles TilesViewHandler:

*   Strips off the view ID's suffix (eg: /tiles/test.jsp becomes
/tiles/test)
*   Searches for a tile with the resulting name, with or without the
leading slash (eg: /tiles/test or tiles/test)

I was not getting this behavior at all.  My tile is defined as inbox,
and my navigation rule points to /inbox.jsp.  The view handler cannot
successfully find the tile named inbox.  I looked at the source for this
class and even though the javadoc says that the leading slash is
stripped off, I could find no code anywhere in that class that looked
for the tile, and if it wasn't found stripped of a leading slash and
looked for the tile again.

If I remove the leading slash from my navigation rule, I get the
follwoing error:

(JspViewHandlerImpl.java:285) - ViewId must start with '/' (viewId =
inbox.jsp)

I am using the shale 1.03 release.

Thanks for your help.


JB





Re: Stupid ? re dialog data

2006-07-27 Thread David Geary

You have to set up the dialog data yourself. One way to do that is with an
action state as the starting state for a dialog; for example:

 dialog name=Payment start=Setup
   action name=Setup
 method=#{dialogLauncher.setupPaymentDialog}
  transition outcome=success
   target=Payee Information/
   /action

   !-- Payee Information --
   view name=Payee Information
   viewId=/billpay/payment/wizard.jsp
 transition outcome=next
target=Payment Method/
   /view
...
  /dialog
/dialog

The Setup state is an action state, so it invokes
dialogLauncher.setupPaymentDialog(), which returns a string that Shale
immediately uses as an outcome.

Here's the method:

public class DialogLauncher extends AbstractFacesBean {
   public String setupPaymentDialog() {
  // Create billpay data
  billpayData = new BillpayData();

  // Set dialog data with the handy setValue method
  // from org.apache.shale.view.AbstractFacesBean
  setValue(#{dialog.data}, billpayData);

  // This outcome takes us to the payment dialog's
  // first view state
  return success;
   }
}

In my views, I have fields wired to my dialog.data:

h:inputText id=paymentAmount
value=#{dialog.data.paymentAmount}/


david

2006/7/27, Sean Comerford [EMAIL PROTECTED]:


I've had no problem setting up a dialog but I can't figure out how to use
the dialog scoped data. I need a simple example I guess...

So assuming the following dialog:

dialog name=testDialog start=step1
  view name=step1 viewId=/step1.jsp
transition outcome=next target=step2 /
  /view
  view name=step2 viewId=/step2.jsp
transition outcome=prev target=step1 /
transition outcome=exit target=exit /
  /view
  end name=exit viewId=/done.jsp /
/dialog

I want to have a text input with a value bound to #{dialog.data.name} in
step1.jsp so I can refer to it in step2.jsp

But if, in step1.jsp, I just try:

af:inputText value=#{dialog.data.name} /

The input doesn't show up because the binding doesn't exist and clearly I
can't access it again later :)

So it seems I need a backing bean to hold name but I'm not sure what to
call
it / how to point to it.

Can someone dumb this down for me?

--
Sean Comerford, Software Engineer
Major League Baseball Advanced Media
[EMAIL PROTECTED] ~ 212.485.4508





MLB.com: Where Baseball is Always On