Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.

chintu reddy

Greenhorn
+ Follow
since Feb 13, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by chintu reddy

@Bear.. I checked servlet version from my webapp and these are the results..



As you have guessed correctly, my web.xml was using version 2.3 and now I changed the header to use correct version.. its workingfine now.. thanks a lot!
7 years ago
JSP

I have this code in my jsp page and sectionList value is obtained from Spring modelmap attribute..



but on the output I only see ${section.desription}.. While debugging I saw that sectionList has about 10 values... and it's not that jsp is not parsing JSTL correctly because I have other part on the page like ${param.title} and its working fine..
7 years ago
JSP
I have to open a file (lets say "list.txt") inside a TagLibrary class file. My webapp folder organization under tomcat looks like this.



I have defined the file location in a properties file under config folder as "/resources/list.txt" hoping that the first "/" will default to the root of the webapp and it can find "list.txt" uner resources folder. But When I use the following code to open the file I am getting a file not found exception.



i did a bit of debugging to see whats happening and found that the value in " fileloc" is what I wanted "/resources/list.txt" but when I initialized the File object with that path, the listFile object has path variable set to "\\resources\\list.txt". i.e. it did not consider initial "/" as root of the webapp as I thought. So in this case what should I do to open this file. Since this is inside a TagLib class and not servlet I cannot use the request object to get the context path. Also I can give an absolute path in the properties file as my dev is in windows and prod is in unix. Help me fixing this for both the environments.

Thanks in advance.
7 years ago
Hi.. On my tomcat server manager page, I see that there is a thread in Servicing state since 14536664ms and that request is coming from my ip. I don't have any active requests to the server othe than the manager page i.e. even if I close the request server is still trying to process that request. How can I kill that thread from server side other than restarting the server? And also how to setup a time limit for the maximum service time for a request? thanks in advance.
7 years ago
Yes I tried using Session and it was working... but was wondering if there will be any other options and also any disadvantages of using sessions...
7 years ago
JSP
I have been banging my head for more than a day now to resolve this issue.. grateful if anyone can offer help... I'm trying to fix a bug in a legacy application in my organization.. in one of the jsp pages..

pag1.jsp



The Servlet1 is calling another Servlet2, which in turn calls Servlet3 to print some code to page1.jsp.. one page1.jsp is compiled html output looks like this..
page1.jsp output..



I need to be able to pass "param" value from page1.jsp to page2.jsp. request.setAttribute is not working. The Servlet class Servlet3 is vendor provided so I cannot set a hidden form variable inside form "yy" to pass it to page2.jsp.

if anyone has a solution please help me, Thanks in advance.
7 years ago
JSP
thanks Rob.. LinkedHashMap is exactly what I wanted
8 years ago
@Joanne & @Ireneusz.. thanks a lot folks... LinkedHashMap is exactly what I was looking for... thanks thanks
8 years ago
All the references and Sun Java docs state that HasMap() is unsorted. But when in my following code, HashMap() comes out sorted on keys automatically..



now lets say my resultset was like "(1, john), (3,paul) (2, robert)".. but 'studentsList' was in following format "(1, john),(2, robert), (3,paul) ". i.e. when I am putting records into HasMap it is sorting automatically.... Is this normal behavior of HashMaps? Are there any other collections/maps I can use to get around this?

Thanks in adv?
8 years ago
hi... i want to list students on jsp page based on their names.. my query returns students Ordered on names. But when I am putting obtained results in HashMap, the records in HashMap are sorting automatically based on key(which is Student ID,).. i mean, if I put (1,john), (3, paul)(2, robert) sequentially, map sorts itself to (1,john)(2,robert)(3,paul)..

how to over come this problem.. Are their any other collections/Maps to achieve this? OR can I make HashMap not auto sorting - like if I put (1,john), (3, paul)(2, robert)
8 years ago
Hi.. I have a jsp page where I have to print "available shows" for a given "movieId". "movieID"is passed from jsp page to servlets and that gets an ArrayList of Shows object from database. This shows object has date and time as fields. Now I want to print these results as per date.. I mean,

my arrayList is Like ([date1,sh1], [date1,sh2], [date1,sh3], [date2,sh1], [date2,sh2].....)

and I want to print it like..

date1 sh1 sh2 sh3
date2 sh1 sh2 sh3
date3 sh1 sh2 sh3

Can anyone suggest me any startup idea about how to proceed?

thanks in adv.
8 years ago
JSP
Ok.. that solves my problem.. thanks a lot....

now my next quest is to learn tag libraries and use them to display content in jsps.. can you suggest me some good startup material.. i have absolutely no idea abt tag libraries.. very difficult to understand the working procedure from sun's tutorial...
8 years ago
JSP
oh sorry.. i meant forward only.. not redirect......

so all the jsp pages that are supposed to be open after an action should be put under web-inf.. right?

thanks a lot
8 years ago
JSP
lets say, a user wanted to check his course list.. there is a link on the menu bar "my course list"... right now im linking that to "courselist.do" and that redirects to courselist.jsp page

once a user opens that page url is saved in web history in the browser.. in case some clever (or stupid) user instead of going through the link on the menubar, directly enters the url to the jsp page then the jsp page loads but it doesn't show any content as no content was drawn from servlet... i was thinking how to get around this..
8 years ago
JSP