• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

struts or JSF

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
We are on discussion of starting one new project on ejb.
We've experience in struts.But for this project it is planning for choosing Java Server Faces.please comment on this suggestion.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hamlin,
Do they have a reason for switching or is it just for the sake of trying something new?
 
hamlin stephen
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne,
Yes, for trying new technology,moreover it is from sun.
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hamlin,

If you understand Struts really well, then JSF is the next logical step. I noticed that JSF derive some of its attributes from Struts like the config file(faces-config.xml), bean mapping, and page navigation. I noticed that JSF has little more flexiblity and power than Struts. I say this because Struts makes you conform to the Action and Form structure but JSF does not. JSF strongest suite is its UI components. It ties the bean nicely to the form components. JSF has a steeper learning curve, but once I got my head around it, I really liked it.

I would recommend not using Sun Studio creator because it uses proprietary object that is not standard in JSF download. I noticed this because this one developer decided to move from Studio creator to Eclipse. Each bean created by Sun Studio Creator extended AbstractPageBean. The AbstractPageBean is referenced in the jsfcl.jar which is not included in the JSF 1.0 download. I would say be careful of using that IDE.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joseph,

Like Hamlin, I am also considering using JSF for an upcoming project. Can you recommend a different IDE for JSF, which do you use?

Thanks,
John
 
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I too see a lot of potential in jsf, but it's still to mature ... the current implmentation contains a lot of bugs.
I am currently using in our project and majority of the time is spent in finding the work arounds (even for the simplest of the functionalities like "resetting" a page).
Sun studio and WSAD 5.1.2(my preference) are pretty good IDEs for JSF. But beaware prior to using any of the properiety components provided by these IDEs incase you plan to migrate to another server/IDEs
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just beware of what you're getting into with JSF -- don't dive in just because it's a Sun spec.

I did a long evaluation of jsf, and it has a lot of potential, but the implementations are still in infancy. JSF has a lot more power than struts when it comes to extensibility, but some features just aren't there yet. For example, you can't submit a JSF form using the GET method -- all form submits are POSTs. There are a lot of little nuances like this that surprised me.

The upside to this is that you can create your own tags, components, validators, converters, events, etc, extending JSF to meet your requirements. Just because the features you need might not be in the RI doesn't mean you can't create them. The problem is that you could get so bogged down in JSF details that you could lose track of your application project.

I agree that the power of components is probably the biggest advantage JSF has over struts, but the RI components are basic. You can use the basic components to compose more complex ones, for example using two list-boxes and some action-buttons to create a shuttle component. Oracle is building a lot of components like this into their ADF faces, but it too is relatively new. I chose not to use JSF yet because its DataModel hierarchy didn't have the kind of pagination support I was looking for, although I'm sure that problem will eventually be solved.

So, it depends on your application / project. Just beware that although JSF is a lot like struts, it's not the same, and some things you take for granted in struts might not be available in JSF.

Good Luck,

Dan
 
Joseph Hatton
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, all.

Of course it is in its early stage but any issues to bugs is because of JSF 1.0. I noticed that JSP imported from another JSP acted kinda weird. I recommend that you update JSF 1.0 to JSF 1.1. I haven't seen a bug in the mid-size project I have completed.

Actually, you can get data from a GET through JSF:
If you have a link http://localhost:8080/jsf/main.jsf?userid=joseph&pwd=test, you can access the parameters this way:
FacesContext ctx = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest)ctx.getExternalContext().getRequest();
String userid = request.getParameter("userid");
String pwd = request.getParameter("pwd");

Where you invoke the actionListener or the data binding, the GET values are always available through the FacesContext in JSF.

Actually, I just got finished with moving data from one listbox to another listbox. The functionality occurred where there were able to select multple items from the list and hit the ">>" button to move it to the seletected listbox. The great thing about this is that it did not require one single line of JavaScript. It was all done through JSF.

I think the biggest misunderstanding that I had was comparing Struts to JSF. Or better yet, applying what I know to JSF. While Struts is servlet concentric based, where action is routed to the ActionServlet and then back to JSP for display. The concept is totally different for JSF, where all action or behavior is component based. If you have 4 buttons, you can literally tie 4 DIFFERENT BEAN to these button. Also, you have to understand the behavior of JSF. If you are using the ACTION event and ACTIONLISTENDER, which does it execute first? If you submit a FORM and ACTION is not specified(in JSF, you do not have to specifies where it goes to next), where does it go? If you submit on a form with no ACTION value, JSF will naturally submit back to the page that submiited it. Point being, there is alot more learning curve to JSF than what is being assumed. Although, it has similarites as I mentioned before, trying to compare Struts to JSF can lead you down the wrong path or leveraging it improperly.

I think any IDE is appropriate. I cannot give advice on which IDE is better than another. Currently, I am using Eclipse 3.0 and running Tomcat 5 with a plugin as my app server.

Hope that helps.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might also want to note that there is a proposal for Struts 2.x (Shale) to use JSF as the view component and be rid of the Struts Taglibs. You can read about it here.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic