arul murug

Greenhorn
+ Follow
since Aug 08, 2002
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 arul murug

Thanks Sue..good luck in your next(JSTL) book too..
Thanks
Arul
15 years ago
Hi Sue
I want to know whether your book covers
struts custom tags.
I heard it is good idea to jump on to JSTL instead of using struts tags in JSP pages.
your comments please..
Thanks
15 years ago
Welcome Sue!
15 years ago
Any practical j2ee application will contain several jsp pages.
Data for each JSP has to processed.(either accept and store or retrieve and display)
In this scenario we can�t put the onus of data retrieval and processing on the servlet, which act primarily as a controller in MVC.
Servlet should be thin and delegate most of the task to helper classes.Which does the processing and populate the Value beans and forward to a JSP.
This is the reason we need to additionally add View helpers and Value beans.
I hope this url will give more details.
View Helper
15 years ago
JSP
JSP
Hi Sakthi
In Existing JSP pages, I try(not always) to extract whenever I come across java code into a bean or custom tag.
New pages can be designed with out them.
In your case, I think custom Tag is a suitable candidate to replace the logic of printing values from vector and formatting inside a HTML table.
15 years ago
JSP

q1:how does config.getInitParameter()know which file to read?
q2:how does config.getInitParameter() know which tag to read in file web.xml?


To answer your questions Web container reads the web.xml file for the application and creates the servletconfig object when it loads your web application.From servletconfig you get these parameters using getInitParameter().
15 years ago
Link for JSP1.2 specification
JSP 1.2 Specification
15 years ago
JSP
According to JSP specification, �flush� attribute in <jsp:include> is a optional attribute with �false� as default if don�t specify it. I am not sure in what context �Core Servlets and JavaServer Pages by Marty Hall says:� says.
You don't need to give the flush attribute,but I don't know why you are invalid include exception.
15 years ago
JSP
Hi
umm..I am not sure whether response will be comitted when you add "flush=true".I think it shouldn't.
May be you can try removing "flush=true".

Arul
15 years ago
JSP
JSP
In early days of JSP, people wrote the data retrieval, storage and formatting logics in the JSP page using scriplets and expressions.
The cluttered logic in the JSP page reduced the Modularity, Reusability and readability of the application.

Then the later versions of JSP brought the concept of including Java beans thru Usebean and Taglibs, which help us in removing these cluttered logic from the JSP pages.
In a broader sense,
Java Beans can be used to extract data retrieval and storage logic from the JSP.
Taglib can be used to extract the logic for Formatting the output.(For example formatting a HTML table from a resultset etc..)
Hope this helps..
15 years ago
JSP
You can use the same way as
getServletContext().getInitParameter("paramName") after all JSPs are converted to servlets.
or more aptly you can use
application.getInitParameter( "parameterName" );
15 years ago
JSP
Hi
You can�t include the output of a servlet using static include.
Try using dynamic include like this
<jsp:include page="servlet/....">
15 years ago
JSP
I don't think there is direct way to assign the variable as java script executes at client side and jsp code(as a servlet) at server side.
However u can assign the java script variable to a hidden form field and pass to server where the jsp can get it using request.getParameter().
15 years ago
JSP
This article may help in designing better control flow for your webapp.talks about Synchronizer Token pattern.
web page
15 years ago
JSP
To throw some extra light.
Both Static (<%@ include file="filePath"%> ) and dynamic<jsp:include page="pageURI"/> include are there for code reusability.
Static Include includes pages at translation time and dynamic Include includes pages at run time.
Dynamic Include is lot more flexible than the Static at some extra performance cost, as the pages are included at runtime.
For example when you are using Container/Component model like one Page acts as container and other pages act as components. The Dynamic includes gives lot flexibility to make run time decision like what are the components(pages) to include and the ones to omit.
This is not possible when we use Static include as all the pages are included at the translation phase and compiled as one unit.
15 years ago
JSP