mysha ahamed

+ Follow
since Aug 03, 2005
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by mysha ahamed


I have taken date to write scjp 1.5. Searching thru this forum i learnt tht

SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) (Certification Press Study Guides) (Paperback)
by Katherine Sierra, Bert Bates

is a good book.I want to purchse K&B from amazon..I was going thru the table of contents link to see if all the topics are covered,but when i click on the link it takes me to (cx-310-035) book..Can any one pls provide me a link to verify the contents of the book before i proceed to purchase..Iam using this link

And one this book (K&B)is the best choice for SCJP 1.5? or there are any other good books ?

I want to write SCJA...My dbt is if i pass SCJA, then for writing SCWCD is it still required tht I need to pass SCJP?wont SCJA be enough?

I want to write SCJA...My dbt is if i pass SCJA, then for writing SCWCD is it still required tht I need to pass SCJP?wont SCJA be enough?

14 years ago
u shuld associate the two classes using <one-to-many > or<many-to-many> in hbm file
Did u solve this problem...I also want to join on specific keys,instead hibernate joins on only primary keys..
I need help...I have a problem like I have 2 unrelated tables...
I associated them using <one -to many>..The main issue is I need to join them on Keys which r not primary or foreign keys...
The tables r not related and there r no common keys..

I specified in hbm file:
<many-to-one property-ref="mykey"/>

Though I specified the key on which to do join using
" property-ref", Hibernate is joining on primary keys of the associated class..How to tell hibernate to do join on my specific keys..
There r no fields commonn to both tables...
Any idea how to do this wuld be grt help..
I took tests in n from javaranch mock exam list..
Mock exam in HFSJ is good...Just study HFSJ atleast twice..thts the basic requirement to pass thru the exam..

All the best
took exam last weekend n passed with 91%..Feeling happy n relaxed now..
Thnx to HFSJ authors for a grt book n to this website for providing useful info..

All the best to evryone who is appearing for the exam..


Iam not able to understand the real meaning of getResource() n getResourceAsStream()methods in ServletContext.

In the api its given ServletContext.getResource()):

The resource content is returned directly, so be aware that requesting a .jsp page returns the JSP source code. Use a RequestDispatcher instead to include results of an execution.
This method allows the servlet container to make a resource available to servlets from any source. Resources can be located on a local or remote file system, in a database, or in a .war file.

In HFSJ its given tht these methods may not be used to access resources in jar files instead v shuld use classloader's getResource() n getResourceAsStream()methods .

But in the api spec its given :Resources can be located in a .war file.

Can anyone pls expalin me the main purpose of these methods n distiction b/w classloaders methods..
I have a dbt in
1.include directive and
2.<jsp:inlcde> .
i read tht for 1. it is included at translation time n 2. is included at request time(run time)....
But both r compiled n executed at request time..So where does the basic difference for o/p comes in to picture...
Its given tht after the main jsp in which the file is included is translated n then if any changes r made to the included files,
with <jsp:inlcde> the changes r reflected but with include directive the changes r not reflected..I tried but the changes r reflected in both cases...
So whts the diff b/w the two with rgd to o/p apart frm performance issues..
Anyone pls expain..
I am learning EL n have some basic dbts..

List list=new ArrayList();

Map tmap=new TreeMap();
tmap.put(new Integer(1) ,"map1");
tmap.put(new Integer(2),"map2");


request.setAttribute("va",new Integer(1));

list : ${li[va]}<br> //line 1
map : ${tma[va]}<br> //line 2

My dbout is, in line 1 the attribute "va" shuld be evaluated to a primitive value (index of list) n in line 2 the same attribute "va" shuld be evaluated to an Integr object (treemaps expect comparable objects as keys)..So I dont understand how these attributes to object mappings (attribute "va"->Integer Object (1)) are evaluated in EL .
Can anyone pls clear my dbt..
I have dbt in action tags..I have an html whose parameter values iam setting in jave bean in a servlet code.Iam retrieving the bean values again
in a jsp..
<form action="PersonServleturi" method="post">
<b>Enter ur name : <input type="text" name="name" /><br>
<b>Enter ur city : <input type="text" name="city" /><br>
<input type="submit" />
public class PersonServlet extends HttpServlet
public void service(HttpServletRequest req,HttpServletResponse res)
String nameVal =req.getParameter("name");
String cityVal =req.getParameter("city");
PersonBean per=new PersonBean();
req.setAttribute("myper",per); //line1
RequestDispatcher rd=req.getRequestDispatcher("myUseBean.jsp");


<%@page import="java.util.*,myuseBean.*" %>

<jsp:useBean id="myper" class="myuseBean.PersonBean" scope="session"/> <b>Ur name is: :
<jsp:getProperty name="myper" property="name"/>
<br>Ur city is :
<jsp:getProperty name="myper" property="city"/>
In line 1 above iam storing the attribute "myper" in request scope..
In line 2 iam trying to retrive the value of same bean object "myper" from a session scope..I thought <jsp:getProperty >on this object shuld return null.But its returning the values of the object tht I stored in line 1..why is it so?Can anyone pls explain this?

Just for info Iam using tomcat-5.0.30
Iam trying to disbale scripting with


1.Iam not having any translation time err if i use scripting elements in my jsp?.
2.for pageEncoding i read tht if v give different pageEncodings in
<jsp-property-group> and
in my jsp page <%@ page pageEncoding %> ,
It will give error ,But iam not having any error..
Can any one pls explain ..
Thnx for ur reply.The url tht i refreshed or pressed enter is the below one.This url is for the first servlet which comes after submitting form..


When i refresh ,the same color is getting displayed.I have put some debug
system.out.println(),which r displayed in tomcat console..when i refresh,
the debug stmt from DemoServlet1 & DemoServlet2 r dispalyed.So,
when refreshed DemoServlet1.doPost()->DemoServlet2.doPost(). r invoked in this order.
I dont know why the doPost() is invoked n why the same color is dispalyed..