Solved

Spring XML document

Posted on 2013-12-12
1
404 Views
Last Modified: 2013-12-12
When defining a bean in Spring, what is the best way or documentation to get all the xml elements needed for the bean definition?

For example, the spring documentation defines a bean this way.

<bean id="viewResolver"
      class="org.springframework.web.servlet.view.UrlBasedViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
    <property name="prefix" value="/WEB-INF/jsp/"/>
    <property name="suffix" value=".jsp"/>
</bean>

But, Netbeans IDE does it another way:

<bean id="viewResolver"
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"                  
          p:prefix="/WEB-INF/jsp/"
          p:suffix=".jsp"
     />

I need to translate the first snippet into the second snippet.  That is, documentation -> Netbeans way.

What is the best way to figure out how to do that?
0
Comment
Question by:lcor
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39715468
Are you referring specifically to the difference between...

<property name="prefix" value="/WEB-INF/jsp/"/>

and

p:prefix="/WEB-INF/jsp/"

??



Basically, either version is acceptable (in Netbeans or any other development environment) as they are just two different alternatives to do the same thing. The only requirement is that for the second version, the "p:" namespace prefix needs to be declared in your top level "beans" xml element.

So yeah, you can choose whichever way you are happier with.


Note, I do realise that there are other differences in the two xml snippets above (the bean's class and the viewClass property). If that is what you are referring to, then there really isn't a path to translate the first into the second, they are two different (albeit very similar) things.

If I have missed the point somewhere, can you please elaborate!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
web application structure 18 135
jsp insert to database example 2 89
java example issue 5 65
Read CLOB data from Oracle using JAVA 3 40
WHY MVC is the future technology... As many of you know, MVC is Model,View,Controller pattern. Model View Controller pattern was invented in a Smalltalk context at Xerox in late 1970s. Why is this buzz about MVC: --------------------------- …
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question