Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Rajesh Vijaya

Ranch Hand
+ Follow
since Oct 18, 2005
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 Rajesh Vijaya

Hi David ,

I did check them and i did check the Spec too...could you please tell me what to specify in the Path .....i'm unable to fix it ....


Thanks

Rajesh
12 years ago
Hi ,

I want to call one servlet from another .I'm writing a simple web-application to accomplish the same.

My context root is Test.

I have the following files

Test/test.html

<html>
<body>

<form action=SS method=post>

<input type=submit value=go>

</form>

</body>

</html>

Test/WEB-INF/classes/Test

import javax.servlet.*;

import javax.servlet.http.*;

import java.io.*;

public class Test extends HttpServlet {

public void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException {

PrintWriter out = resp.getWriter();

out.println("I' m inside calling servlet");

// What should i specifiy in the path ???

getServletContext().getNamedDispatcher("Test2").include(req,resp);

}

}


Test/WEB-INF/classes/Test2


import javax.servlet.*;

import javax.servlet.http.*;

import java.io.*;

public class Test2 extends HttpServlet {

public void doPost(HttpServletRequest req,HttpServletResponse resp) throws ServletException,IOException {

PrintWriter out = resp.getWriter();

out.println(" I'm inside called servlet");



}

}


Thanks

Rajesh
[ February 11, 2006: Message edited by: Bear Bibeault ]
12 years ago
Hi All ,

I just cleared the SCBCD Exam with 82% .I'm pretty much happy about it.I had couple of questions on EJB-QL and many on Client View of the Beans and few quesstions on security .Overall jus reading Head First EJB was enough.Thanks to HFJ series authors.This would not have been possible without them.
30 days 2 exams SCWCD(72%) and SCBCD and a Florida Vacation.....

Once again thanks to HFJ series....This had been possible only with help of them .....

Rajesh
12 years ago
Head First Servlets and JSP by Kathy Sierra and Bert Bates is the 90% of the racnhers use !!!

BEst of Luck
ok its working fien now.....

I could not find out y though !! there were many applications running on my pc at the time i started my deploy tool ...that could be the reason....
Hi ppl ,


I'm following HFEJB !! ...i have j2sdkee1.3.1 installed and i have the correct PATH ,CLASSPATH , J2EE_HOME and JAVA_HOME Settings....

even j2ee server is starting

i see even the flash screen of deploy tool...and i waited for like half an hour...still the Deploy tool has not loaded....Did anyone come across the similar situation.... I searched this forum . but in vain....

Any help in this regard is greatly appreciated...
[ December 18, 2005: Message edited by: Rajesh Vijaya ]
Hi Kudret ,


compiler is not seeing ur class com.example.model.CoffeeExpert1 since u mite have not specified in your classpath.

you can include dynamically with the followiing commnd like this..

javac -classpath c:\programme\apache\tomcat\common\lib\servlet-api.jar;D:\headfirstservlet\coffeeV1\classes\com\example\model -d classes src\com\example\web\CoffeeSelect.java

hope this helpss
hey vishnu ,

i found this link ...in google...if this is of relevant to you ..

http://swforum.sun.com/jive/thread.jspa?threadID=46767&messageID=139800
12 years ago
my mock exam scores !!!

jiris online ...80%

anand chawla.....80%

HFSJ mock exam....55%...

i took the exam yesterday ....i took the exam in USA...I'm a graduate student in Computer Science...
12 years ago
hi all ,

I just cleard SCWCD today ...72% ...pretty much happy about ...i'm just concentrating on clearing the exam...after making out from the forums that score is not really important.....ne ways...

this is vat i did for the prep of exam ....

HFSJ
Specs
API

and the forums helped in knowing the things which are difficult...

best of luck for those taking it...

now i'm heading for SCBCD ....
12 years ago
u are rite karthik ....its thread-safe....

but if it is a static private instance variable then its not thread-safe even though it implements SingleThreadModel.
Hi ,



package projsp;



public class trying

{

private String name;

private int age;

public void setName(String n)

{

name=n;

}

public void setAge(int a)

{

age=a;

}



public int getAge()

{

return age;

}

public String getName()

{

return name;

}

}



The contents of test.jsp file are as follows:



<%@ page language="java" import="projsp.*" %>

<jsp:useBean id="test" class="projsp.trying" />



<html>

The Name is <getProperty name="test" property="name" />

The Age is < jsp:getProperty name="test" property="age" />

</html>



If a user types in http://servername:8080/test.jsp?name=Anand&age=22 the out put is
try this :

<% String [ ] myList = {"gadar","lagaan","DCH","ghayal"};
request.setAttribute("myList", myList);
%>


value of items attribute in c:forEach is an attribute set by the request object.

this shud work fien....
Servlet Spec
4.1


Path parameters that are part of a GET request (as defined by HTTP 1.1) are not exposed by these APIs. Theymust be parsed from the String values returned by the getRequestURI method or the getPathInfo method.


Could anyone explain above statement with an example ??


Thanks
Hi Ranchers...

This topic is really making ways.....Even i was not fully content with idea of score not being printed on certification.But going thru this forum had really given an insight into how the entrepreneurs think...
And the cognitive psychology view point of paul was really amazing...i thought that would clear all the doubts of the fellow ranchers.....if one really understands it ......it has answer to each and every question on this topic....I found it really fantastic....

but alas...they are still some ranchers...who dont seem to be contended with that....I can understand their predicament...since i hail from the same part of the world where they(majority sample.. not genralised) are from...where importance is given more to the percentage of points....so we have been programmed to think from childhood that only percentage matterss...and one uses his marks not to assess himself....just to show that he is better than others....so in that scenario..one definetely gets dissapointed when his/her percentage are not manifested...

Once gain the Pauls explanation was really great....