• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Can i control where the response.getWriter().println ends up in my DOM tree ?  RSS feed

 
Ranch Hand
Posts: 359
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet with these lines of code:


response.getWriter().println("Web service up and running");
RequestDispatcher rd = request.getRequestDispatcher("ping.jsp");
rd.include(request, response);


When the jsp is loaded i get "Web service up and running" in the top of my jsp.

Can i control where on the JSP i put this tekst.

I know i can be using ajax, but can i control with some javascript, or is there a other way, to control where this tekst
ends up in my jsp ?


Frank
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can write it to request attribute and use it in JSP to print whereever you like.



ofcourse you should use some tag libs of your front end framework, writing java code in jsp is stone age thing.
 
Sheriff
Posts: 67259
170
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Formatting of the page is accomplished with HTML and CSS. If the HTML page is generated via JSP, you can use the JSTL and EL to control exactly what the page contains and where data is placed within in it.

You may want to look at this article for a discussion of how to structure a web app to get data to the JSP properly.
 
Frank Jacobsen
Ranch Hand
Posts: 359
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks , just was i was looking fore

Frank
 
It is an experimental device that will make my mind that most powerful force on earth! More powerful than this tiny ad!
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!