pedro abs

Ranch Hand
+ Follow
since Mar 25, 2010
Merit badge: grant badges
For More
São Paulo - Brazil
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 pedro abs

Thanks and sorry for my distraction !
12 years ago
JSP
Tks, and for HTML? How can I display HTML sintax in my JSP page?
12 years ago
JSP
Hello,

I want to display Expression Language Sintax ${.....} in a JSP page. How could I accomplish this?

I want to know the same for html content? How can I display HTML Syntax in a JSP Page without the browser render it?

Thanks !!
12 years ago
JSP
Ok, thank you very much !!! I put ServletContex.log("...") in the init() method and I can see it !
12 years ago
How can I verify the ocurrence of <load-on-startup> Servlet?
Which log "<tomcat installation>/log" I have to search for verify that some servlet configured with <load-on-startup>1</load-on-startup> has been loaded?
12 years ago

Bear Bibeault wrote:See the entry in the JSP FAQ on file uploading.



Sorry, I didn't get... where?
12 years ago
oK,

Why I have <input type="file">? How can I use it? Could you give-me some example of code?

Tks again !
12 years ago
Dear Sir;

I don't want to try to reinvent the wheel. I Just want to understand the concept.

1) Why that approach exposed in the first post doesn't work?

2) What is the functionality of the HttpServletRequest.getInputStream? It's useful for what?

3) Maybe I have to submit the form with a method="PUT" ???
12 years ago
Hi there

I have an HTML page



and a servlet:



I get the return of 44 bytes from the line in the servlet in the console of TOMCAT when I select an image from the <input type="file"> in HTML page.

LINE 14 -- System.out.println(request.getContentLength());

Why I can't persist this content as a file.

I do not want to use the apache project FileUpload because I want to learn how to do this in that way.
http://commons.apache.org/fileupload/using.html

Could someone give me an example?

Tks !
12 years ago
Hello, I expect to see a compilation error in this code but it works:




why it works if in documentation it doesn´t have a constructor as: Long(Object o) ???

http://download.oracle.com/javase/6/docs/api/java/lang/Long.html
What is the purpose or advantage to use synchronized blocks in constructors if it happens only once (when the object is built) ?




Output:
ABC
XYZ
ABC
XYZ

or

ABC
ABC
XYZ
XYZ

Ankit Garg wrote:In your case the class is actually useless but an abstract class with a private constructor can have uses. What if you add a factory method to the class which returns instances of the class?? Then the class would be useful. Since the compiler cannot check whether its possible to instantiate a class or not (i.e. look for factory methods), so the code is allowed as it doesn't break any rules...



Ok, I agree BUT ... even in a factory method I can't instantiate the class because ... remember .... it's abstract ! And I can't do:

new Clown();

And I can't extend it because it's constructor is private .... so ...... I can't do nothing with this "clown" code !
Ok my friends. Thank you everybody ! I just asked because it didn't make sense for me !!! Some things in the exam doesn't make sense to but we have to know when it's ok or not ...

thank you again \!!!