Forums Register Login

i want to use jsp or html file to display content

+Pie Number of slices to send: Send
Hi, i dont know how to present this thing but, i am working on a project in which i have to populate the jsp or html file using the data i processed through java code, i know i can use servlets.
Please give an example of using and loading a html or jsp file when the server runs.
i want to put all my data in a html file and then use angularjs to organise it, i know all that things but only facing a small problem of displaying the jsp or html file when the server starts.
1
+Pie Number of slices to send: Send
After you process the request in your Servlet, you should add the processed data to the attributes of the request, and then forward the request to the JSP page. All the JSP has to do then is display the processed data.
+Pie Number of slices to send: Send
it is exactly what i am looking for, but can you please elaborate as i am facing problem in doing this and it will be great if you can give me explanatory code snnipet for the same, i also want server should load my jsp file as soon as it gets started.
+Pie Number of slices to send: Send
What does "server should load my jsp file as soon as it gets started" mean?
What is it you are expecting to see?

The JSP is meaningless without a request to access it.
+Pie Number of slices to send: Send
 

Dave Tolls wrote:What does "server should load my jsp file as soon as it gets started" mean?
What is it you are expecting to see?

The JSP is meaningless without a request to access it.



What to do so that when server starts my index.html or index.jsp file should open in the browser, i dont want to put html code in my class as i want to use angularjs with the data recieved from java code and populate it to index.jsp or index.html
1
+Pie Number of slices to send: Send
Then your browser needs to access the server using the relevant URL.

The browser has no idea whether the server has started or not.
+Pie Number of slices to send: Send
 

Dave Tolls wrote:Then your browser needs to access the server using the relevant URL.

The browser has no idea whether the server has started or not.



okay got it!, and how about using web.xml for the same, can you please explain me the usage of <jsp-file> tag under <servlet> tag.
+Pie Number of slices to send: Send
I'm a bit confused as to how you plan to use JSP and AngularJS together -- they are not particularly compatible technologies.
You firghten me terribly. I would like to go home now. Here, take this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 536 times.
Similar Threads
AngularJs as the alternative choice for building web interface
Java Based Spring Configuration with Angular JS client - control not transferred (@requestMapping)
Tomcat server setup
Loading .properties file.
What's actually happening behind the scene?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 11:34:23.