Jigar Gosar

Ranch Hand
+ Follow
since Jul 09, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jigar Gosar

as of now there is no way. I hope someone else sheds more light on this matter, "whether tomcats implementation is correct according to the specs".
if BBUBUB is correct than, it can be infered that, when setAttribute is called for the second time than valueBound(for second attribute) is called before valueUnbound (for first attribute) is called.

I have read the spec but it doesnot specify the order in which valueBound valueUnbound methods are called.

so, can some one tell me the order in which methods valueBound/valueUnbound of Interface HttpSessionBindingListener will be called for the following code.
assume there is a class called X that implements HttpSessionBindingListener. Now,


according to me the order must be
1. valueBound - for first object X()
2. valueUnbound - for first object X()
3. valueBound - for second object X()

but according to the answers of q55 final mock exam HFSJ, the order is

1. valueBound - for first object X()
2. valueBound - for second object X()
3. valueUnbound - for first object X()

can someone tell me the correct order in which these functions are called.

thanks.
[ April 22, 2006: Message edited by: Jigar Gosar ]


NOTE: The <mytag attr="<%= date %>" /> is illegal in a JSP document because the < character should be used only for the start of elements (instead you should use a < entity reference). You might try:

<mytag attr="<jsp:expression>date</jsp:expression>" />

But this is illegal because elements can't be placed in attribute values. The valid alternative is therefore:

<mytag>
<jsp:attribute name="attr"><jsp:expression>date</jsp:expression></jsp:attribute>
</mytag>



well i assume "JSP document" means xml representation of jsp. and hence


would be invalid.

but


is not the only solution, i think even this can be used


correct me if i am wrong.
[ April 22, 2006: Message edited by: Jigar Gosar ]
parra matta:

your expreiment doesnot prove that something is wrong with tomcat.

even though u used following jsp:usebean


still jsp:getProperty ...

will search for the person bean in all scopes starting from pagescope, and thus will find the bean present in the request. this is not the recomended behaviour as far as jsp 2.1 spec is conscerned, but neither is it disallowed by specs. hence nothing is wrong with tomcat.


also i want to quote a para from jsp 2.1 spec titled JSP.5.3 <jsp:getProperty>

The value of the name attribute in jsp:setProperty and jsp:getProperty will
refer to an object that is obtained from the pageContext object through its findAttribute
method.
The object named by the name must have been �introduced� to the JSP
processor using either the jsp:useBean action or a custom action with an
associated VariableInfo entry for this name. If the object was not introduced in this
manner, the container implementation is recommended (but not required) to raise
a translation error, since the page implementation is in violation of the
specification.
Note � A consequence of the previous paragraph is that objects that are stored
in, say, the session by a front component are not automatically visible to jsp:set-
Property and jsp:getProperty actions in that page unless a jsp:useBean action, or
some other action, makes them visible.
If the JSP processor can ascertain that there is an alternate way guaranteed to
access the same object, it can use that information. For example it may use a
scripting variable, but it must guarantee that no intervening code has invalidated
the copy held by the scripting variable. The truth is always the value held by the
pageContext object.


[ April 22, 2006: Message edited by: Jigar Gosar ]
Ernesto Leyva,

first, i dont agree with some of the answers given, as you will notice from my reply.
second, i'll try to answer your questions as precisely as possible.

1. confirmed. reason: if <taglib-location> doesnot begin with "/" than "/WEB-INF/" prefix is presumed.

2. Option A is correct.
reason: when a uri used in <%@taglib %> directive is not defined web.xml (or in some other tld within jar)than following applies.
a. if uri is absolute (i.e has protocol, hostname) than some exception is thrown.
b. if the uri is root relative (begning with / )than the tld must be present at corresponding path in that webapplication's context (or docroot folder)
c. else the 'path specified by the uri' is assumed to be relative to the current page being accessed, and hence the tld file must be present 'there'.

here opction c applies. Hence, "A) /mytaglib2.tld" is correct.

3. yes, you can do this as long as you have a "META-INF/taglib.tld" present in the jar file containing your tag decleration.
reason: whenever one specifies a jar file as uri (in either taglib directive or web.xml) than that jarfile must contain a "/META-INF/taglib.tld" file, which when absent throws an error complaining "taglib.tld not found".


I am very sure of my answers, and I would appreciate if any one can correct my mistakes, if any.
[ April 22, 2006: Message edited by: Jigar Gosar ]
anybody please, do i need to fully understand the methods for exam

Request.
getContextPath
getServletPath
getPathInfo

thanks.
i just wanted to know whether anyone has been asked questions on these methods.

Request.
getContextPath
getServletPath
getPathInfo

i have some simple idea about these methods, but i dont have a clear understanding. i just wanted to know, whether i should invest more time learning them.

thanks.
I have following method in my class, I was wondering how could i write a unit test for a method that does file io, and uses java io classes such as FileReader, and LineNumberReader. I did some googling on "junit java io" "junit testing LineNumberReader" but didnot find anything useful.

Any help is appreciated.


[ March 09, 2006: Message edited by: Jigar Gosar ]
19 years ago
i dont mind working with JEditorPane/JTextPane, but note[ad style wordwrap is excatly what i dont want.

i just want to achieve Editplus/JEdit style indented word wrap. so any help in this regard will be apreciated.
19 years ago
I want to create a simple text editor, with Editplus/JEdit style word wrap. The word wrap in JTextArea does not indent properly for lines begining with tabs.
example:
--------------------------------------------------
JTextArea word wrap:


--------------------------------------------------
Editplus/JEdit style word wrap:


--------------------------------------------------
i hope i have made my self clear. below is the code i use to achieve wordwrap in JTextArea.

Can any one tell me how can i achieve Editplus/JEdit style word wrap with JTextArea.

Any help is appreciated.

regards,
jigar


[ December 09, 2005: Message edited by: Jigar Gosar ]
19 years ago
Congrats dude



tell me dishant what do your parents do are they into software too?
19 years ago


A non-static member classes' members can never be accessed without an instance of the enclosed non-static inner class.



why not??? if we were allowed to declare static variables we couls just use standard java syntax Outer.Inner.someStaticMethos();


So marking a variable or a method static inside a non-static innerclass would never be used unless there is an instance of the innerclass.


dosent seem like correct conclusion
???
19 years ago
question is simple why?

Why cant True Inner Class have static member variable?

i hope answer is as simple.

thanks, plz feel free to reply with ur own opinion. ;-)
19 years ago
is there a way to capture all keystrokes, in an java app, even though the app is not under keyboard focus???

actually i want to write an java application which runs in background and should pop on screen when i press a key combo such as alt-shift-p so something like that, can it be done with java.

also i m planning to write a java app, that would launch my fav apps at press of a keystroke, even if that app dosenot have keyboard focus.

i m not in position to write native code in c/c++,
and it would be ok if the solution is windows specific.

please help
20 years ago
i share a smilar conscern, somebody please reply