File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes dynamic jsp forms? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "dynamic jsp forms?" Watch "dynamic jsp forms?" New topic

dynamic jsp forms?

Jack Harrison

Joined: Nov 08, 2005
Posts: 1
Hi all,

I went to be able to generate a dynamic form based upon an XML document that is read into the application.

The XML will determine which form fields, etc will need to be populated in the form.

My problem is that the output form fields need to contain JSP tags, so I need a servlet to dynamically create the JSP output.
This bit isn't too problem is that I need to somehow get the JSP container to process the servlet output as if it were a standard JSP document.

Any ideas? BTW, I'm using JBoss, however the ideal solution would not be tied to any particular product.

Thank you.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 33129

Welcome to JavaRanch!

As you've probably noticed by now, you can't mix and match servlets and JSPs. Instead, have the servlet generate raw HTML. That can be displayed by the browser. There is no reason to involve a JSP.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

you can't mix and match servlets and JSPs

Just in case this statement gets misconstrued -- actually the combination of Servlets and JSP is a match made in heaven: Servlets to perform the processing, JSP to render the view. What you can't do -- which is what I'm sure Jeanne meant -- is to emit JSP syntax from a Servlet and expect it to be interpreted.

If you'd like to use JSP for this project you might want to look into the 'x' tags of the JSTL.
[ November 08, 2005: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
subject: dynamic jsp forms?
It's not a secret anymore!