wood burning stoves 2.0*
The moose likes Struts and the fly likes  How To Use Servlet Instead Of Jsp In Struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " How To Use Servlet Instead Of Jsp In Struts2" Watch " How To Use Servlet Instead Of Jsp In Struts2" New topic
Author

How To Use Servlet Instead Of Jsp In Struts2

Thangaraj Selvamani
Ranch Hand

Joined: Sep 20, 2008
Posts: 61

Hai Iam New To Struts2. Can Any One Say Me How To Use Servlet Instead Of Jsp Page.

Thanks In Advance
Thangaraj
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

Servlets instead of JSP ? Why ? This would break the whole purpose of using Struts.


[My Blog]
All roads lead to JavaRanch
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Why do you think you want to do this? Heck, that wouldn't just defeat the purpose of using Struts, it'd defeat the purpose of everything invented at the time JSP came out.
Thangaraj Selvamani
Ranch Hand

Joined: Sep 20, 2008
Posts: 61
Customized Jsp Component Wants To Get Create(With textfield, select, button etc... ) At RunTime.And Gets Loaded For The End User.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I'm not sure what that has to do with servlets, though--generating HTML with a servlet is just yucky, and there are better alternatives.

(On a side note, there's no reason to capitalize every word in a sentence--that's only for things like the titles of books :)
Thangaraj Selvamani
Ranch Hand

Joined: Sep 20, 2008
Posts: 61
can you give some sollutions how to generate struts2 jsp component at run time and load the page to user.

thanks in advance
s.thangaraj
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

JSP? But remember: the ultimate goal isn't to create S2 JSP components, but rather to generate the appropriate HTML. Right now it sounds as though you want to create actual JSP, *then* interpret it so tags are rendered, and serve *that* to the user.

Without more details is tough to help, though.
Thangaraj Selvamani
Ranch Hand

Joined: Sep 20, 2008
Posts: 61
My requirement: I am developing web application which can be acessible by A and B users.
In my application I am having only one jsp page. This jsp page can be used by more than
one user that too more than one functionality.
A is using X functionality.B is using Y functionality.
To satisfy these users A and B , I need to display the required jsp/html view controls.
These jsp view controls are comes from database.The view controls in jsp page are
equivalent to the fields/columns in database table.
Now I need to dynamically change/show the view controls in the only available jsp page.
Please give me a solution....
Thanks in Advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

So far it still just sounds like you need to show specific information to a specific user, and there's nothing here that can't be handled in a clean way. Still not information given to provide any specifics, however. And so far it's not Struts-specific.
sarada srinivas
Greenhorn

Joined: Oct 09, 2008
Posts: 20
Since you have only one jsp page, Please use <s:if></s:if> tag and make use as per user request.

-Sarada.

 
jQuery in Action, 2nd edition
 
subject: How To Use Servlet Instead Of Jsp In Struts2
 
Similar Threads
struts2
migration to Struts2
how to display images on JSP in struts2
Struts2
STRUTS2