Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

integrating servlet application into a website

 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have finished my servlet application, and now all that remains is to link it with my friends website, because we developed them independently of each other. How do i integrate the two?
Thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adewale,
It's just an HTML link, right? Or are you trying to integrate the two more tightly?
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne that's the problem, i'm not sure how to link the two. I don't know whether i should bring my friends HTML pages into my own platform(tomcat) or if a simple HTML link would work.
How do you think i can integrate the two?
 
Rajesh Agarwal
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your friends application also a servlet based application... or just a static html site.

If it is servlet based, then you can build the war file again, including his files.
 
Ola Daniel
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yu donot necesarily need to rebuild your web archive to include his pages. A simple HTML link will do the trick of shooting you from one web context to the other. On the other hand if you intend to share some variables like user names, database names, connections etc... then its another matter entirely and you will need another approach...

State your problem clearly let us know exactly what yu are thinking and what the challenge is...
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My friends website is simply made up of static HTML pages and his resources .I'm not sure whether to copy all his files into my WAR and then build.It's basically an online database system i wrote using jbuilder.
Users are meant to be able to access my servlet application from my webmasters site, via a link, but since this is a servlet application and not static HTML pages, im not sure if a simple hyperlink would do the trick,since there's a server(tomcat) involved and tomcat has to start to run the application....so is there any special way of linking so that everything runs seamlessly, or do i just use hyperlinks?
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all, this is just to let you guys know that i just tried a hyperlink from my webmasters page to the index page of my servlet. The index page of my servlet showed, but after logging in, and pressing submit, the following happened:
1. i got a page not found error
2. in the address bar, the address there started from c:\ and had no reference to tomcat or any port 8080//localhost.

I hope this will give you all an idea of what i'm up against
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Adewale,
Since your friend's page is on the Internet, you can use a URL that begins with "http://". That way it will be obvious you want a web page and not a local file.
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jeanne, its not on the internet, it's on a local system.Both of them must be uploaded together. i have compiled the servlet into a WAR file, it's just to establish a link so that when i click on a button in the webmasters page, it launches my servlet.
Thats all.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am assuming your server can host servlets/JSP. i.e. Do you have tomcat or another similar container up and running? What is the URL associated with the submit button in your form?
 
Paul Bourdeaux
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and tomcat has to start to run the application...

I am a little confused... But it is almost lunch time, and I am occasionally prone to simple confusion this time of day. Are you saying that you want some type of link that will actually start the tomcat server and then link to your application?

If tomcat is already running, you should be able to link to it just fine with hyperlonks from the static HTML pages that your colleague has created. If tomcat is not yet running, you will get the 404 file not found error.
 
Adewale Adebusoye
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My tomcat is running, but anytime i type http://localhost:8080/notapWebModule/loginservlet.html in IE where notapWebModule
is a WAR file containing everything pertaining to my application under the webapps directory , i get a connection failed error. I can't even view it in a browser, much less link to it.
Funnily i dont have this problem in jbuilder.
And yes, is it possible to have a link from a static HTML page to a servlet such that it actually starts the server and loads my application, or must tomcat be running in the background for a hyperlink to work?
Thankx.
 
Eddy Lee Sin Ti
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you need to integrate functionalities developed by 2 independent developers (Am i correct?)

If the functinalities should be logically together, you better merge the artifacts into one war file. No point separating stuffs that should be go together.

Would it be possible if you post the actual stack trace or error message because i'm not sure of what you mentioned by "connection failed error"?

And yes, is it possible to have a link from a static HTML page to a servlet such that it actually starts the server and loads my application, or must tomcat be running in the background for a hyperlink to work?


This is a very confusing question. If you have a hyperlink that point to a servlet, and you expected the servlet to actually response to your request, then the servlet container (web container) of course need to be started and listen to a particular port. So, ya, you need the tomcat be running for the hyperlink to work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic