473,387 Members | 1,882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

how to load a servlet on index.jsp page...

can u please help me out...
Question is ...

i need to pass a value dyanamically on index page using a servlet.. so how do i call a servlet on start of index page....
Jan 16 '08 #1
4 8277
dmjpro
2,476 2GB
can u please help me out...
Question is ...

i need to pass a value dyanamically on index page using a servlet.. so how do i call a servlet on start of index page....
Which you want to call first index.jsp or the Servlet?
Let me know first.

Debasis Jana
Jan 16 '08 #2
Which you want to call first index.jsp or the Servlet?
Let me know first.

Debasis Jana

first i need to call the Servlet from which i need to load the values to index.jsp dynamically
Jan 16 '08 #3
dmjpro
2,476 2GB
first i need to call the Servlet from which i need to load the values to index.jsp dynamically
You want your Servlet gets executed first then the Servlet forwards the jsp.
And you want to access some values in JSP.
Right?
Ok simply user HttpServletRequest.setAttribute("attr_name",attr_v alue);
and try to access using request.getAttribute("attr_name").

I think it will help you.
Best of luck with your try!

Debasis Jana
Jan 16 '08 #4
r035198x
13,262 8TB
can u please help me out...
Question is ...

i need to pass a value dyanamically on index page using a servlet.. so how do i call a servlet on start of index page....
Isn't your index page the entry point? Then why does it need a parameter from somewhere to be able to load it? If you want to pass values from a servlet to a JSP, you can use request.setAttribute in the servlet and request.getAttribute in the JSP.
Jan 16 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: robert walker | last post by:
hi all, to my webapp named mrf, i have added load-on-startup tag to mrf\WEB-INF\web.xml so i added a snippet like so <servlet> <servlet-name>loadDbProperties</servlet-name>...
1
by: Hai Tran | last post by:
Any help is appreciated. Installed Tomcat 4.1 and Mysql on a WinXP. I've manage to get Tomcat up and was able to view my first application ( myhome ) simple home page. Tomcat was installed under...
1
by: bisanthe | last post by:
hi, Tomcat has a property in web.xml , load-on-startup. <servlet> <servlet-name>MyServerl</servlet-name> <servlet-class>com.bisanthe.MyServlet</servlet-class>...
2
by: ChrisW | last post by:
Hi, I'm developing a very small, basic bespoke MySQL-based website, and there are effectively 3 ways (as far as I'm aware) to do what I want to do, but I'd like some opinions on what people...
7
evilmonkey
by: evilmonkey | last post by:
My assignment was to create a shopping cart servlet, it works locally on tomcat but when I deploy it to the schools server (also tomcat) it fails to refresh the front page and just prints the HTML...
0
by: krishna81m | last post by:
Could some one please explain why the session is not being maintained when I am doing a forward in a servlet after setting a cookie. I am even unable to set session attributes or parameters and...
1
by: shyaminf | last post by:
hi everybody! iam facing a problem with the transfer of file using servlet programming. i have a code for uploading a file. but i'm unable to execute it using tomcat5.5 server. kindly help me how to...
2
by: ManidipSengupta | last post by:
Hi, a few (3) questions for the Java experts, and let me know if this is the right forum. It deals with 100% java code (reason for posting here) but manages a Web browser with Javascript. Thanks in...
3
by: vijaykumardahiya | last post by:
Hello To Every One, I want to know that when I upload the File like a image from html page Its not show on servlet page using appropriate logic. I read the FileUpload Home page.But I am still...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.