Charmy Madhvani

Ranch Hand
+ Follow
since Dec 26, 2007
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 Charmy Madhvani

I came across a question


5
Marks: 1 Which of the following statements are true?
Choose at least one answer.
a. Tag files can contain the tag element that allows attributes to be processed
b. tag files cannot process attributes from the calling jsp page
c. the body of a tag file cannot contain scripting
d. the body of a tag file cannot contain EL statements
e. the body of a tag file can be declared as tagdependent
Partially correct
Marks for this submission: 1/1.



My Ans was partially correc because the right answers for me were a and e. But the Actual answer were a,c,e.
Just wanted to know how c is correct.
Infact in HFSJ it is clearly written on page 500 in one of the Dumb Question

You can do scripting in tag file but not in the body of the tag used to invoke tag file



Am I right or am I confused?
Which of the following statements are true?
Choose at least one answer. a. Once an ServletRequest attribute has been set, it is visible to all subsequent requests
b. Data in a HttpSession attribute will not be available if the web server restarts
c. Data in the ServletContext can be shared by any servlet of the same web application.
d. The getParameter method of HttpSession will retrieve a session attribute

I answered both b and c but the correct one is only c. b is incorrect for following reason:Although session attribute data may dissapear if Tomcat is restarted, this is not guaranteed behaviour and some web servers may store session data in a database.

Which web server stores the session attribute even after restarted? And whats the point in retaining the session data once the session is invalidated?
So should I say that Filter's doFilter method is a callback method but FilterChain's doFilter method is an inline?
Hi I have come across the terms callback and inline in Filters chapter. Just wanted to know the definitions of each.

Whether the following methods are callback or not?

doGet,doPost,init and destroy(both in Filters and jsps/servlets), doFilter



Any examples of inline methods?
Because jsp documents does not support scripting . It has a special tag for declaration which is mentioned in your option 'a'.
it started working now, for 2 reasons:
1. I added <type>java.util.List</type> for <attribute> element in tld for clist.
2. I added clist in session and passed it to the tag from sessionScope.

But my question remains that if i declare that list in scripting why should'nt it take from page scope. I explicitly have to add it in any of the scope.

Also


creates a List. Then why it is giving me an error :

Attempt to convert String "Red,Blue,Indigo,Yellow,Green" to type "java.util.List", but there is no PropertyEditor for that type

mList was my mistake.
and c list is declared within that jsp page only. So I assume it is of page scope
why E is not correct (ServletRequestListner).
Hi.
I a getting error when I run following code







It is getting null pointer exception..I dont understand why.
ALso when I avoid scripting to use


I am getting the error that it cannot convert String to List.
In jsp itself I can use this variable as List. But why cant it be passed as a List in the TagHandler. Please help me
Hi,
I am trying to put a classic tag in my jsp similar to HFSJ on page 521. But its giving me error that it cannot find the tag handler class

An error occurred at line: 15 in the jsp file: /classicTagUse.jsp
The type com.example.model.ClassicTest1 is not visible




My code is as follows
*******************************TLD************************************

**********************************************************************

***************************JSP****************************************

*******************************************************************

**************************TagHandler*******************************

***********************************************************************

Any mistake in my code?
I'll take care next time. Thanks anyways
Can you achieve this code without using scriplet?
my tld file is as follows:


please help me correcting this code if it is wrong