Kevin Duffey wrote:

> [snip]
> So, my question is, is there any way I can just create a class and have the
> XML parser map the right elements (by name) and place the values after those
> tags directly into an instance of an object? It would also need to be able
> to add items to a vector, or table of some sort. For example, my config file
> looks like so:
>
> <config>
>         <action>
>                 <name>Login</name>
>                 <class>com.bm.ui.actions.Login</class>
>                 <result name="Successful" page="/inside/home.jsp" />
>                 <result name="Error" page="/outside/login_error.jsp" />
>         </action>
>
>         <action>
>                 <name>Enroll</name>
>                 <class>com.bm.ui.actions.Enroll</class>
>                 <result name="Successful" page="/common/login_ok.jsp" />
>                 <result name="BadLogin" page="/common/enroll.jsp" />
>                 <result name="Error" page="/outside/enroll_error.jsp" />
>         </action>
> </config>
>

I will (shortly) be able to help you with this issue, as well as several others.

I'm putting the finishing touches on a small Model 2 based framework that will be
open sourced, and will contain the following tools:

* Basic "model 2" servlet with action interfaces and some
  other support classes.

* Custom tag library for some common use cases in Model 2
  scenarios, including internationalization.

* Support for populating bean properties directly from request
  parameters (like JSP can do with the "*" wildcard).

* Processing XML files like the one above, and creating new
  objects (and populating properties) from them elegantly,
  based on simple processing rules that you define.

Look for an announcement of code availability for this for JavaOne.  In addition, I
will be present at many of the BOFs and Sessions (TS) related to servlet and JSP
technology, including speaking at some of them.  This code will be one of the case
study examples.  Hope to see you there!

Craig McClanahan

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to