Hi everyone i'm new at struts i'm using struts 1.2.9 .i have an arrayList called bookList and it has elements i retrieving from database.But i guess its empty cause when i run the application my jsp page is empty i can't see arraylist elements on the screen help please
You can use whatever version you want--but unless you have a good reason to learn Struts 1, I wouldn't.
You put it into scope by using request.setAttribute or session.setAttribute; you might want to look at some basic Java web application tutorials to understand some of the more common mechanisms used in Java web apps.
To add to what David has said, I think it's really hard to learn Struts - which is built on top of Servlets and JSP - without first learning Servlets and JSPs. There is a free version of the book Core Servlets and JavaServer Pages available as PDF download here: http://pdf.coreservlets.com, along with some very helpful tutorials, etc.
And yes, unless you have a specific need to learn Struts 1, you should begin with the current Struts 2. It's more than just a newer version - it's a different architecture.
Joined: Mar 08, 2010
thanks for reply everyone.
It's just my homework doing a basic web applications with java frameworks.I finished jsf.. now i must do it with struts.But it doesnt matter version struts 1 or struts 2 i just wanna use which struts is more effective and more easy to learn.Do you think which one i use??struts1 or struts2
I've been recommended to learn struts 1.x, because there are more jobs offered with this technology in Spain. I've looked through the job offerings, but they don't specify the version. I don't trust the person who gave me this recommendation very much. He also said that Struts 2 is not having much success.
I would like to know how this works worldwide...Struts 1.x or Struts 2.0? Could someone with the knowledge give me another opinion please?
Struts 2 will never have the success Struts 1 had--there are too many other equally-compelling choices. When Struts 1 came out there *were* no other good choices, and by the time there were, Struts 1 was pretty well entrenched.
Anybody doing *new* development work with Struts 1 should have their head examined; it's a ridiculous idea. There are thousands, probably tens of thousands, of deployed Struts 1 apps: if you're happy working on old, difficult-to-test, difficult-to-use technology, then by all means--learn Struts 1.
Joined: Sep 18, 2009
Thank you David!
Since I'm starting from "scratch"(about to get the SCWCD), I think I will go for the new stuff. My next question is: what's the most recommended framework? Struts 2?
I have no idea. Spring MVC is pretty popular, I know a bunch of places using Struts 2, I know a few places using Tapestry. JSF is the "official" Sun web solution (I'm not a fan except under certain circumstances, but people use it). There are a few others around that are used, but not as much as the others I mentioned.
Joined: Mar 08, 2010
i'm not expert at jsf but i did some examples with it and i didn't use request.setattribute code.And its easier than struts.
I think struts is hard but i must do this basic example for my homework.
i added request.settattribute to my code but my page is still empty
i changed my code like tihs
i'm new please help i'm losing my mind for 2 days thanks