Win a copy of Securing DevOps this week in the Security forum!

Suresh KumarPandey

Ranch Hand
+ Follow
since Sep 08, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
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 Suresh KumarPandey





can anybody tell whether it is possible to add cause in this class. Right now getCause() is fetching null.
what is the exact difference between data abstraction and encapsulation.

According to me using encapsulation we provide the users which are using my class to access the variables through a public method there by hiding the implementation details and if i would need to change anything in my methods i can do it woithout breaking others code.

Data abstraction is used for loose coupling so that we can make reusable codes.
Hi guys,


can you please tell me what will be the best book for learning Spring.
4 years ago
Hello fellow ranchers,

Yesterday I passed the OCEJWCD ( JEE6) with 84% and I would like to share my experience with everyone here.

1. Firstly I would like to thank all fellow ranchers for helping and clearing out lots of my doubts.
2.It took me around 3 months to complete the exam because i was not working on the development project .I used to do small coding at home. I would like to give advice to everyone preparing for the exam that try to write small codes yourself to understand the concepts.

3. Books and reading material :
(i) I read the Head First Servlet and JSP thoroughly and completed all the exercises given.
(ii) Servelt3.0 specifications. This is very important ! Read it thoroughly ! Especially about servlet security and dynamic registration and section 2.3.3.3: Asynchronous Processing, chapter 8: Annotations and Pluggability, Section 13.4.1 @ServletSecurity annotation and methods of HtppServletRequest,Servlet Request,HttpServletResponse,Servlet Response and servlet context and request dispatcher given in the specification.

4. Practice Exams :
(i) Enthuware mock exams are really very good. If you want to learn and have clear concept , this the best mock exams to go through.Spending money on this is totally worth. i bought it after advice from a fellow rancher.
(ii) Piotr's Mock exams(exam.piotrnowicki.com/viewQuestion.xhtml) are also very good.

6.http://enrichjava.blogspot.in/2011/12/scwcd-questions-41-50.html.

Please go through 260 questions mentioned in this blog also .They are really nice.


5. The actual exam is not that much difficult , so if you are scoring about more than 80% in the mock exams , then you are good to go .

Once again thanks a lot and good luck for preparation everyone
4 years ago
will we consider < metadata-complete> as element attribute or element.

if we say it as element attribute then will <enabled> will be also called element attribute
4 years ago
Can anybody explain the meaning of this :


<filter-mapping>
<filter-name>Logging Filter</filter-name>
<url-pattern>/products/*</url-pattern>
</filter-mapping>


would result in the Logging Filter being invoked by client requests starting
/products/... but not underneath a request dispatcher call where the request
dispatcher has path commencing /products/.... The LoggingFilter would be
invoked both on the initial dispatch of the request and on resumed request.


4 years ago
hi I am just confused in one of the code given in servlet specification 3.0

1.REQUEST to /url/A
FORWARD to /url/B

getRequestDispatcher("/url/B").forward(request,response)) ;
AsyncContext ac =request.startAsync();
ac.dispatch() <- This dispatches the request to original url /url/A as the startAsync is called on the original request only and the first request was for /url/A.


2. REQUEST to /url/A
FORWARD to /url/B

getRequestDispatcher("/url/B").forward(request,response)) ;
AsyncContext ac =request.startAsync(;

ac.dispatch() <- This dispatches the request to /url/B . can anybody please explain whether this will be not called on the original request and how deos it work.


4 years ago
Suppose i am using useBean in one of the jsp to check for the user registration. suppose the url which is hit is simultaneously used by 4 users and suppose object type created i.e. ID is person .When the last user enters the details and submits the details a person has just submitted ,that is person id already created , then how the useBean will work in this scenario.
4 years ago
JSP
Change the Welcome.html like this
</head>
<body>
<form action="servlet" method="post">
User Name:<input type="text" name="uname">
<input type="submit" value="Submit">
</form>
</body>
</html>

Change the web.xml file

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

</welcome-file-list>

<servlet>

<servlet-name>Servlet</servlet-name>
<servlet-class>Servlet.java.Servlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Servlet</servlet-name>
<url-pattern>/servlet</url-pattern>
</servlet-mapping>


It will work







4 years ago
Can you please change the web.xml file like this


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

</welcome-file-list>

<servlet>

<servlet-name>FirstServlet</servlet-name>
<servlet-class>Servlet.FirstServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>FirstServlet</servlet-name>
<url-pattern>/FirstServlet</url-pattern>
</servlet-mapping>



The servlet name in servlet and servlet mapping should be the same.







4 years ago
I am quoting this from the Servlet 3.0 specification about asynchronous processing.

can anybody please explain the concepts

"The @WebServlet and @WebFilter annotations described in Chapter 8 have an
attribute - asyncSupported that is a boolean with a default value of false.
When asyncSupported is set to true the application can start asynchronous
processing in a separate thread by calling startAsync (see below), passing it a
reference to the request and response objects, and then exit from the container on the
original thread. This means that the response will traverse (in reverse order) the
same filters (or filter chain) that were traversed on the way in. The response isn't
committed till complete (see below) is called on the AsyncContext. The
application is responsible to handle concurrent access to the request and response
objects if the async task is executing before the container-initiated dispatch that
called startAsync has returned to the container."


4 years ago
From where to get the mock papers for the OCWCD exams apart from the kathy Sierra book for OCWCD for servlets and JSP
i have used braces with else but then also it is giving error
4 years ago
JSP
Why the else is giving error here
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> Simple Web Application </title>
</head>
<body>
<%!
boolean b=false;;
%>

<% if (b) { %>
<jsp:forward page="forward.jsp"></jsp:forward>
<% } %>
<%
else
%>
<jsp:include page="include.jsp"></jsp:include>


</body>
</html>
4 years ago
JSP



Why the foo method of class X is not throwing a a compile error because according to the override rule ,if the superclass method has not declared exception ,the subclass method can't declare a new exception
4 years ago