Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Determine complete calling URL  RSS feed

 
A Farroll
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am maintaining a servlet program built on Java and running on Tomcat 7 with Windows operating system. The servlet application has no actual servlet class. A third party web front end calls the web service end points in the servlet application but a problem has developed in one of the web service requests. To assist me finding the problem it would be useful to determine the complete URL - including query string - when the relevant web service request is made.

Can I do using the message context or do I have to create a servlet class?

Thanks in advance

AF
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the 3rd party web front-end only a java script front end or what is it?

One way to intercept requests and responses would be by using a filter configured in your web.xml.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A Farroll wrote:I am maintaining a servlet program built on Java and running on Tomcat 7 with Windows operating system. The servlet application has no actual servlet class.

I'm confused: how can you have a servlet program with no servlets?
 
A Farroll
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:
A Farroll wrote:I am maintaining a servlet program built on Java and running on Tomcat 7 with Windows operating system. The servlet application has no actual servlet class.

I'm confused: how can you have a servlet program with no servlets?


Hi Bear,

Forgive me as I am no expert in Java. What I mean is the application was built to handle web service requests and from what I can tell has no class which has "extends HttpServlet", for example public class classname extends HttpServlet. From my investigation if I have a servlet class like this I can use the "doGet" method. But I am at present of the understanding that to use the doGet method I need to know the URL which is what I am trying to find out in the first place.
 
A Farroll
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Joe Harry wrote:Is the 3rd party web front-end only a java script front end or what is it?

One way to intercept requests and responses would be by using a filter configured in your web.xml.


Using wappalyser it says it is 50% sure it is built on ASP.NET

I will try and find out how to set up a filter configured in the web.xml. Never done that before

Thanks Joe
 
Tim Holloway
Bartender
Posts: 18709
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a good look at the WEB-INF/web.xml file. I'm virtually certain that at least one servlet has been mapped.

If the app is based on a web services framework such as Apache CXF, there won't be source code for this servlet in the project - you'd have to look at the source code for CXF itself to see that.

But the upside is that CXF has extensive logging capabilities that will print the URL patterns and its attempts to match them to service handlers within the webapp.

I'm using CXF as an example, but most frameworks of similar quality also have diagnostic logging abilities.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!