Durgaprasad

Greenhorn
+ Follow
since Oct 02, 2006
Merit badge: grant badges
For More
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 Durgaprasad

Runtime.exec() method is used to run the process( exe files).
For example call Runtime.exec("notepad") and see the results.

Even i dont know how to pass arguments to the servlet
16 years ago
the sequesnce is

firstly, service(ServletRequest,ServletRespone) will be called which in turn calls service(HttpServletRequest,HttpServletResponse) which based on the type of the method(Get,Post etc..) will call the appropriate doXXX() method
16 years ago
when you first make a request to the protected resource, the container will not be knowing whether it is protected or not. Once it comes to know that the requested resource is protected (by looking at the DD), it will send the response asking for the username and password. So if you type the url directly that means you are requesting for that page itself, which will not be served by the container at any cost
16 years ago
There is something called dynamic dispatcher in the JVM.
In computer science, dynamic dispatch is the process of mapping a message to a specific sequence of code (method) at runtime. This is done to support the cases where the appropriate method cannot be determined at compile-time (i.e. statically). Dynamic dispatch is only used for code invocation and not for other binding processes (such as for global variables) and the name is normally only used to describe a language feature where a runtime decision is required to determine which code to invoke.

Further java uses pointers to adopt dynamic dispatcher.
Each instance will have pointer to the methods and JVM maintains a table to map the objects and the methods
16 years ago
you can use the folowing code in the jsp

if(request.getParameterValues()!=null){
for(int i=0;i<request.getParameterValues().length;i++){
<input type=checkbox name="somename" if(request.getParameterValues()!=null)checked>

}
}

syntax and indentatins are not correct.
Hope uu can managae
16 years ago
HOpe the following code will help you

//parser.parse(new File(filename), handler);
DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
builderFactory.setValidating(true);
DocumentBuilder builder =builderFactory.newDocumentBuilder();

builder.setErrorHandler(new MyErrorHandler());
Document document = builder.parse(new File("books.xml"));
In your servlet you can either call getServletOutputStream() or getWriter() method on the response object. You cant call both.
Since your jsp is also a servlet, and getWriter() will be automatically called by the container to provide you out implicit valriable. So you cant call getServletOutputStrem() in JSP. And using your out variable you cant send any binary data. So you cant process images in your JSP
16 years ago
Yeah it will be better if you instantiate it in the context listener.
Another better solution is you need not have to instantiate the class. You can have static method which serves you the connection Object. Further you can go for singleton pattern if you want to have only one connection
16 years ago
Hi all,
I cleared SCWCD with 86%. This was after i scored 91% in SCJP.
I just want to know is this good marks? can anyone just tell me wen will sun update the certification progress and do they give me logo for this also?
thanks in advance
16 years ago
I assume you are using HttpRequest, HttpResponse in your service method.

use the following code


to create a new cookie and store it in the client machine.

the life time of the cookie on the server machine depends on the age you set



I hope this will help you

scjp 91
scwcd perparing
Isdx preparing
16 years ago







[BPSouther: added line breaks to quote]
[ October 03, 2006: Message edited by: Ben Souther ]
16 years ago
Yu cannot.

what you can dois use logical names for your jsp inside the report folder. Yu can do this using "jspfile" child tag in the servlet tag. Use the mactching url-pattern to restrict the access
16 years ago
First thing is you cannot post.
The easier way is to set a hidden variable before forwarding.

In the forwarded page's doget method check for that variable value. If it is set then call the dpPost method.

May be a silly answer but definetly not a stupid one


SCJP 91
SCWCD perparing
ISDX perparing
16 years ago
Cookies are stored as strings in the client machine
You can use getMasAge method is Cookie class to set the time for cookies to be persistance on the client machine. If you set it for -1 cookies will disappear immidetaly when the browser shuts down. Domain is something which is declared by the rfc. each cookie will come under some domain. Its a kind of logical grouping. I dont think any developer should worry much abt this.

SCJP 91
SCWCD perparing
ISDX perparing
16 years ago
use the method System.currentTimeMillis() to get the current time.

you can use a while loop to keep an eye on the time elapsed. And use a flag

say

boolean flag = flase;
while(System.currentTimeMillis()!=23612376){

//perform something
// if successful
flag = true

}

if(!flag)
throw ServletException

Hop this solves your problem

SCJP 91
SCWCD preparing
ISDX perparing
16 years ago