Abhishek Mahanty

Greenhorn
+ Follow
since Jan 26, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Abhishek Mahanty

Is there any book I can refer for the exam preparation?
Something along the lines of Head First or other certification books.

thanks,
Abhi.
Good explanation on Pg 85 of HFEJB

Abhi.
[ July 26, 2006: Message edited by: Abhishek Mahanty ]
The request will be handled by the TestServlet
(Assuming that the name of your web app is "wcd1").

Had you not mapped the url-pattern "/jstl/*" to the TestServlet, then the container would have despatched the request to a resource mapped under your web.xml file's <welcome-file-list>. So index.html will be displayed if you had the following in your web.xml.

<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>

NOTE:
The welcome file gets executed only when a mapped resource for a request uri is not found.
I think the JSTL specification is really helpful and provides all the info you would need.

http://www.jcp.org/aboutJava/communityprocess/final/jsr052/

Abhi.

Originally posted by Mike lothar:
Is it legal to embed scriptlets inside Custom tag body, i mean to say setting <body-content> tag in taglib to JSP.

Thank you
Mike



Hi,
Check this out

https://coderanch.com/t/168570/java-Web-Component-SCWCD/certification/JSP-valid-value-body-content

Abhi.

Originally posted by sudhakar:
Hi,
... I am able to see the result of Scripting elements. But it should not happen. We must see scripting code without prcessing. Right!!!



Hi, if you disable scripting in web.xml i.e.

<scripting-invalid>true</scripting-invalid>

Then you should get a Translation Error if the jsp engine encounters any scripting element in your JSP page. So you don't get to see any "scripting code without processing". (Refer JSP 2.0 specs Table JSP.3-3)

BUT the EL ignored setting behaves differently i.e. if we have

<el-ignored>true</el-ignored>

Then we get to see the EL expressions in their unevaluated form (NO Translation Error in this case).

Abhi.
Hi,
The key points of difference between a web server (WS ) and application server (AS) are :

1. WS can cater only static resources (for dynamic content generation it delegates requests to auxillary aplications viz. CGI, Servlets etc.)
2. WS handles only HTTP requests. While AS can cater to requests through various other protocols.
3. WS mainly deals with sending HTML as response while AS primarily exposes business logic to various client applications.
4. WS expicilty deals with handling of HTTP requests and sending HTTP response. AS can provide lots of other ancillary services viz. connectio-pooling, transaction handlineg etc.
5. A typical AS usually is composed of a WS, an EJB Container and a Web container.

I think thats pretty much all I can offer.

Abhi.

Originally posted by Eshu San:
Hi

Are u sure the attribute default value is true in the <%@ attribute ..%> directive of tag file.If that's so then we are forced to provide runtime expressions for the attribute value.I really doubt this.

Can anyone clarify us...



Yup I am positive about the the default value being true (refre to Table JSP.8-3 of JSP 2.0 specs).

Moreover a value true for rtexprvale doesn't mean that you "must" provide runtime expressions only. Basically it means that the attribute "can" accept run time expressions. So a static literal is valid as well.
Hi,
I would suggest that you go for SCWCD 1.4 for the simple reason that its very much up-to-date with the current Servlets and JSP specifications (2.4 and 2.0 respectively). The SCBCD exam covers the EJB 2.0 spec which is kind of old (given that technology changes at a blink-and-you-miss speed). EJB 3.0 is under the draft phase and hopefully it'll get released soon.

Cheers,
Abhi.
20 years ago
Hi,
Well flush() explicitly commits a response while there are scenarios where the response gets committed implicitly. e.g.

response.sendRedirect()
response.sendError()

I think there are others too .. may be someone else will add in.

Abhi.
I found the following in JSP 2.0 specs which sheds some light on the class loading mechanism. Just wanted to share with all.

JSP.7.3.7 Translation-Time Class Loader
----------------------------------------------
The set of classes available at translation time is the same as that available at runtime:
* the classes in the underlying Java platform,
* those in the JSP container, and
* those in the class files in WEB-INF/classes,
* in the JAR files in WEB-INF/lib, and, indirectly those indicated through the use of the class-path attribute in the METAINF/MANIFEST file of these JAR files.
20 years ago
Hi,

The sub-element <rtexprvalue> specifies whether the attribute�s value may be dynamically calculated at runtime.

By default the value is
* false for custom tags
* true when used as an attribute of the Tag File "<@attribute ..>" directive

When rtexprvalue is false
--------------------------
The attribute can accept only string literals (which are not evaluated).
These String literals are then converted to the appropriate types as expected by the attribute. e.g. if attribute expects an integer, a literal "20" gets implicitly converted to an integer 20 when assigned to the attribute.

When rtexprvalue is true
--------------------------
The attribute can accept values as
- String literal
- a scriptlet expression,
- an EL Expression or
- by using <jsp:attribute name="attribute_name">value</jsp:attribute> tag.

When passing value as a scriptlet expression, the implicit conversion does not takes place, therefore the expression should evaluate to the type as expected by the attribute.

In your example
<test:myTag attr1=<%=someClass.someMethod()%>
Since you are passing a runtime expression in the form of a scriptlet expression, you should put this in the TLD instead
<rtexpevalue>true</rtexprvalue>
and make sure that the return type of someMethod() is a String. (Otherwise provide the <type></type> element with the attribute's datatype)


Abhi.
[ November 19, 2004: Message edited by: Abhishek Mahanty ]

Originally posted by Eshu San:
Hi

In a SimpleTagSupport class the getJspBody returns JspFragment object.JspFragment is an object that wraps the body of the tag that invoked it and sent to the setJspBody() method during the invocation of the tag.so when getJspBody is called ,JspFragment object which wraps the body of the tag is returned.
In the book HFS it's mentioned that JspFragment must not contain "SCRIPTING ELEMENTS".My doubt is that there is a value called "JSP" for the
body-content element in the tld.As we know JSP means it can have scripting also.Does this mean that "JSP" is not a valid value for the body-content element whose parent element <tag>'s implementation class should not extend SimpleTagSupport coz the concept of JspFragment is applicable only to SimpleTags and not classic tags.

can anyone pls explain me



Hi,
In JSP 2.0, we can have 2 types of custom tags
1. Classic Tags (Tags implementing Tag, IterationTag or BodyTag interface directly or indirectly)
2. Simple Tags (Tags implementing SimpleTag interface or Tags based on Tag Files)

In former's case <body-content> can have the following values - empty|tagdependent|JSP|Scriptless

But

for the later, valid values can be - empty|tagdependent|scriptless
("JSP" is not allowed since the tag's body is used to create JspFragment object which as you mentioned cannot have scripting elements)

I hope it answers your question.

Abhi.
[ November 19, 2004: Message edited by: Abhishek Mahanty ]

Originally posted by Joyce Lee:

Could you check if your CLASSPATH pointing to any old servlet.jar file? Also, go to C:\jdk1.XX\jre\lib\ext and remove the servlet.jar to other temporary location.

[ November 18, 2004: Message edited by: Joyce Lee ]



Hi Joyce,
Thanks for your prompt reply. I had some "examples" installed under the folder \jre\lib\ext\classes that were causing the problem. Thanks for pointing me in the right direction. I deleted the "examples" folder and now my applications get deployed properly.

Thanks again,
Abhi.
20 years ago