Frederico Werly

Greenhorn
+ Follow
since Sep 14, 2004
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 Frederico Werly

OH my god !!! is true !!!

Thanks .. eheheheh .. LOL !!
18 years ago
I was studing about String and i cant understand why some characters have changed to Uppercase and other to LowCase.


Here the code :
----------------------------------------------------------------------------
public class StringsDemo {
public static void main(String[] args) {
String palindrome = "Dot saw I was Tod";
int len = palindrome.length();
StringBuilder dest = new StringBuilder(len);
for (int i = (len - 1); i >= 0; i--) {
dest.append(palindrome.charAt(i));
}
System.out.println(dest.toString());
}
}
----------------------------------------------------------------------------
The output from this program is:

doT saw I was toD
----------------------------------------------------------------------------

WHY NOT "Dot saw I was Tod" ?

Thanks,
Fred.
[ June 15, 2005: Message edited by: Frederico Werly ]
18 years ago
Hello friends,

I saw one answer at errata page : http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed

But i think that the JSP on this page will show "Name is: Fred" because there are no bean at page scope, so.. a new one will be created and his property will be set to "Fred" . im right ?

thanks.

This book was made for me... my nickname is Fred. hehehehe .

[ November 05, 2004: Message edited by: Frederico Werly ]
[ November 05, 2004: Message edited by: Frederico Werly ]
Ok !! i did understand ..

My doubt was that the HttpServlet dont has any abstract methods ... so i dont need to implement any .

Only the class is abstract... there are no abstract methods ..

Thanks a lot friends
Ok Colin .. thanks for reply .

but .. i know that this code above run without problem , i just want to understand how ou who implements the abstract methods from HttpServlets ?

If HttpServlet is an Abstract class ...so there are many abstract methods in this class right ? so when i inherited one class from HttpServlet i dont implements these methods ... who implements ? do the container changes in my code to refer to another class taht implements HttpServlet ?

i know that it run .. i want to understand how ...

Thanks a lot for replys
Ok, in the response and request interfaces i understand, there are objects that was implemented by container and im using the reference to this objects.

But , in HttpServlet abstract class , i inherited direct from this class .. so i need to implement many abstract methods .

Or the container changes my code to put another class that implemts HttpServlet ? if its true ... so i understand , because "MyServlet" is inherited a class that implements the Abstract class HttpServlet .

Thanks for answer.
Im confused,

If "HttpServlet" is an abstract class, why not my concrect sub-class "MyServlet" dont implement many abstract methods from "HttpServlet" ?

"MyServlet" just override doPost and create other method called myBizMethod();

I think that if im inherited an Abstract class, i must to implement many abstract methods from the super abstract class ... im right ?

Thanks
Ok .. RUN !

Thank you .. sorry .. i will pay atention next time :-(
Hello, i have a problem ..

--------------------------
HF: Example page 84 .

package com.example.web;

import com.example.model.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;

public class BeerSelect extends HttpServlet {
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException {

response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("Beer Selection Advice<br>");
String c = request.getParameter("color");

BeerExpert be = new BeerExpert();
List result = be.getBrands(c);
Iterator it = result.iterator();
While(it.hasNext()) {
out.print("<br>try: "+ it.next());
}

}
}

The ERROR :
src/com/example/web/BeerSelect.java:21: ';' expected
While(it.hasNext()) {
^
1 error
-----------------------------------------------------
What is wrong with my code ?
Thanks for answer ...
but the question is : Converts a response object to an HTTP response .
i think that is the container ... after this the web server send the http response to client ..

im confused ..


Task :
Converts a response object to an HTTP response.
Answer :
Web server - gets the response from the conainer.

I Think :
Container - like is showed on page 43 - "...container converts the response object into an HTTP response" .

What is the right answer ? i know that the Web Server gets the response from the container , but it was not answered right ?

Thanks a lot

What is the best Exam Simulator for SCWCD ?
Whizlabs is pricier than JWebPlus v4...

is a good idea to do a Exam Simulator before the real exam ? or just the exam in HF Servlet & JSP is ok ?

Thanks ...
Ok,

Thanks for answer.
Im like too much this book, in Brasil we dont have nothing similar, congratulatios...

Hello,

I started to read my HF today and it�s my first question :

Where can i find the "Sharpen your pencil" awnsers ?


thanks
ohh thanks ..

I have got this book http://www.amazon.com/exec/obidos/tg/detail/-/0072226846/ref=cm_bg_f_1/104-2656706-5783948?v=glance&s=books

I used this book to pass in SCJP, is this book as good to SCJD as to SCJP ?
can i use this book to SCJD or it is not recomended ?

Thanks for replys...