Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 744871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T09:01:43+00:00 2026-05-14T09:01:43+00:00

This [servlet or jsp] must return an XML document [for future processing by my

  • 0

This [servlet or jsp] must return an XML document [for future processing by my web-app].
That is not intended for end-users.

What is a better design: write a JSP or an XML ?

p.s. What I don’t like about jsp is that every system admin can see your java code.

p.p.s If that’d be a jsp, than it must be capable to be autowired by Spring. Is it as easy to do as with servlets?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T09:01:44+00:00Added an answer on May 14, 2026 at 9:01 am

    I would use a servlet for this in combination with a Javabean-to-XML serializer, such as XStream, XMLBeans, etc.

    XStream is pretty easy:

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        Person person = personDAO.find(request.getParameter("personId"));
        response.setContentType("text/xml");
        response.setCharacterEncoding("UTF-8");
        new XStream().toXML(person, response.getWriter());
    }
    

    No need to hassle with template text, so also no need for JSP.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've a JSP/Servlet Web App that consist of more than one servlet (and some
I added Comet servlet into Spring web application. This servlet does not differ from
I'm developing a simple servlet/JSP, data-driven web site on Google App Engine. I've started
Folks, Used to be that when you hit a servlet/jsp, the app server would
I have a decent working web application (Java/Servlet/Jsp) that I would like to improve
this is how I define the loaction of my jsp files: <bean id=jspViewResolver class=org.springframework.web.servlet.view.InternalResourceViewResolver>
I am getting this error when ever deploying my jsf application java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config at
This is a follow on to my previous question: JSP / servlet / IE
How can I call a servlet from jsp ? But in this case, I
How can I upload files to server using JSP/Servlet? I tried this: <form action="upload"

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.