David Westbrook

Greenhorn
+ Follow
since Dec 18, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by David Westbrook

I have it working perfectly. I will post more details when I get the time. Check back in a couple of days if you're interested.
[ January 02, 2009: Message edited by: David Westbrook ]
15 years ago
@Ulf and Kristofer, that is pretty much what I ended up doing. Thank you for the help!
15 years ago
hey,

i prefer working on my java programs over windows command line, and i would like to add an external jar file so i can start writing some servlets. i've googled, but haven't found any walkthrough for something like this (which surprised me) - anyone happen to know good way to do this?

regards and thanks in advance.
[ January 02, 2009: Message edited by: David Westbrook ]
15 years ago
hey all,

I have an xml document containing data in html page, and I would like to send that to a servlet.

I'm thinking I can do it one of two ways.

ONE:



I have seen supposedly working examples of this, but they were IE specific, and I'm looking for something that complies w/w3c.

and then on servlet I do something like:




I have a feeling that I need to alter the setRequestHeader, so any suggestions would be helpful.

The other way I think would be possible would be to turn the xml doc into a string and send it like this:



and then do something on servlet like:




problem w/this is xmldoc doesn't have toString().

Any help (thoughts, comments, examples, good references) would be appreciated.
15 years ago
I didn't really fix this per say. I made a new dynamic web project on eclipse and used the defaults from there and ran it and it worked. I do think that I could have used package manager to fix it like Bear suggested (thnx) but right now I need to move on. If I have time to revisit this later I will, but for now I have a project deadline to meet, so I'm going to keep moving.
15 years ago
Ok, so I'm trying to figure out all of this servlet stuff. Here is what I did:

First, using one of the WORKING examples from apache tomcat 6, I took this:



copied it and changed the class name to blabla, so now the line that said:



says this:



and yes, I did name the file blabla.java and i didn't get compiler err.

I compiled the program and moved the blabla.class file to the same folder that the HelloWorldExample.class file was located. I then added the following lines of code to the web.xml file located in the webapps/examples/WEB-INF folder:



When I go to the URL

http://localhost:8080/examples/servlets/servlet/HelloWorldExample

it works fine, but when I go to

http://localhost:8080/examples/servlets/servlet/blabla

I get the message:

HTTP method GET is not supported by this URL

And the description:

The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL).

I have read up, and it seems this is a common error which usually occurs because people don't override the super class doGet method provided by the HttpServlet class, but if you look at my code, I obviously do that.

So to recap, I copied WORKING HelloWorldExample servlet and renamed HelloWorldExample to blabla in the java file. I then compiled it and moved blabla.class to the same location as HelloWorldExample.class. I then added to web.xml to configure url mapping.

Was there something else that I missed? Is there something obvious that my frustration is blinding me from? Thanks in advance for the help.
15 years ago
depends, is java your first language?

if so you might want to pick up text book or go through a detailed tutorial and at least go up through Object Oriented Programming and take your time. Learning basic programming and Object Oriented concepts (encapsulation, inheritance, etc) is the foundation to pretty much every type of programming language you will ever learn, so taking the time with it if you've never done it before is pretty important.

if you have done programming before and feel comfortable w/OOP, then I'd probably take the most complex program you have written before and rewrite it in java, and try and take full advantage of stuff that is already there for you (like the Math/String/Data Structs/Generics) and get used to using that a little bit, and from there explore some online APIs (Google has something called google web tools compiler, which can turn java code into web apps, but one step at a time).

as far as tools go, Eclipse is probably most popular, and Netbeans is second. Both of them are pretty good programs. There are others too like JBuilder. Or if you want to go old school, you can just download JDK/JRE, write your code on simple text editor and compile at the command line.
15 years ago
i just learned about this stuff a couple days ago, so don't take what i'm saying as golden, but it might be something you haven't thought of.

do you remember setting any port numbers when installing your webserver? did you just install w/defaults?

try http://localhost:8080/

i know when i installed apache, it sets up port 8080 to take stuff in.

explanation (again, keep in mind i just learned this stuff so it might not be completely accurate):

whenever you see http://something you are automatically going to port 80 of that machine. so if you go http://yourServerIP/ it will boomerang a message out, which will come back into your port 80. If your ip is hosting server, then it takes incoming port 80 and sends it to whatever port you specified when installing your webserver. I hope that helps at least to point you in right direction.
15 years ago
so, i guess the prob is not w/setting up my ports b/c my isp is going to block me no matter what i do (don't get comcast if you can help it)

i set up exact same apache install on my buddies server and it works fine for accessing outside of local network. so i guess you need to make sure it is even possible for you to host given your isp's restrictions.

thnx for help though, i def learned a lot even though i didn't achieve the desired result.
15 years ago
i'm able to see my web server going here in web browser:

http://localhost:8080/

but when i try to access outside of my network:

http://myIPaddress:8080/

connection just times out.

I set up port forwarding on my router like this (NOTE: I set up TCP and UDP individually b/c when I try BOTH, I get Port Overlap error ):

Name: Apache1
External: 8080
Internal: 8080
Protocol: TCP
IP: A static IP that I created
Enabled: YES

Name: Apache2
External: 8080
Internal: 8080
Protocol: UDP
IP: A static IP that I created
Enabled: YES

I installed Apache Tomcat 6 w/defaults. Do I need to change Apache config? Is it possible my ISP is blocking port?
15 years ago
i'm able to see my web server going here in web browser:

http://localhost:8080/

but when i try to access outside of my network:

http://myIPaddress:8080/

connection just times out.

I set up port forwarding on my router like this (NOTE: I set up TCP and UDP individually b/c when I try BOTH, I get Port Overlap error ):

Name: Apache1
External: 8080
Internal: 8080
Protocol: TCP
IP: A static IP that I created
Enabled: YES

Name: Apache2
External: 8080
Internal: 8080
Protocol: UDP
IP: A static IP that I created
Enabled: YES

I installed Apache Tomcat 6 w/defaults. Do I need to change Apache config? Is it possible my ISP is blocking port?
15 years ago
Ok, that gave me a lot of info, but I'm still having problems.

I set up static ip, and tried to set up port forwarding from this walkthrough:

http://portforward.com/english/routers/port_forwarding/Linksys/WRT350N/Apache.htm

It said I had to forward 80 to 80 and 443 to 443, but that didn't work so instead I just tried one row. I set the external port to 80 and the internal to 8080 and I put in the static IP I created. But I get the following message:

"Port overlap occurred! Please change your entry!"

I change the protocol from UDP to TCP and that doesn't give me error, but I am going to be using youtube api for my web app and possibly streaming video, so I'm pretty sure I am going to need UDP protocol as well. Any suggestions?

So this is my setting so far:

App name: Apache
External Port: 80
Internal Port: 8080
Protocol: TCP(Leaving this as both gives me "Port overlap occured!" error)
IP address : I just change this to the static IP I set up
Enabled: YES

Any resource or configuration suggestions would be appreciated.
15 years ago
Ok, so I installed apache tomcat 6 on windows vista.

I have it working, and the home page with links to examples and management page shows up when I go to link:

http://localhost:8080/

So I'm pretty sure I have it working the way it is supposed to. According to the config window, the service is started. So, as far as I can tell I should be hosting.

But, how do I access this over the internet? Do I have to register a dns or something?

This is what I have been trying...

http://myIPaddress:8080/

and I get typical link broken/can't display webpage error

I have also tried

http://myIPaddress/

but this just brings me to my router config page.

Do I need to configure my router? Register a DNS? I've spent the better part of a few hours searching for this info, and you would think that there would be tons of walkthroughs/trouble shooting pages on this, but I have yet to find any. Please help me out with some advice or at least point me to some useful resources.

Regards and thanks in advance.

[ December 18, 2008: Message edited by: david noneofurbus ]
[ December 18, 2008: Message edited by: david noneofurbus ]
15 years ago
had same problem.

vista tried to copy superuser idea linux, and as a result, this annoying thing happens with some programs.

solution (and this should work for anything) - go to the icon you are trying to open, and instead of double clicking it, right click, and then left click on "Run as adminstrator"
15 years ago