Skip to main content
11-Garnet
December 9, 2019
Solved

How to add a custom servlet to the WIndchill tomcat

  • December 9, 2019
  • 1 reply
  • 3642 views

Hello,

we are trying to add a custom servlet to the Windchill tomcat but we are not able to do it. So, far we added a custom servlet that can be accessed through Windchill like. http://<servername>/Windchill/servlet/myservlet/mybean But this is not we are trying to do we would like to access the servlet like http://<servername>/myservlet/mybean.

We did everything like on the regular tomcat (edit web.xml, deployed servlet under webapps) but still the servlet was not found.

Does any body has idea how to do it or can point us to the right direction?

 

Thanks, best regards!

Best answer by Arpit-Singh

This  is way beyond the support scope for PTC, but I may be able to provide some direction.

 

What you essentially want to do is to redirect to the servlet directly from the webserver context, so you may need a ajp-worker mapping in the HttpServer configuration.

 

Windchill AJP Configuration is in file > app-Windchill-AJP.conf so you may need a mapping like 

JkMount /myservlet ajpWorker

 

1 reply

15-Moonstone
December 10, 2019

This  is way beyond the support scope for PTC, but I may be able to provide some direction.

 

What you essentially want to do is to redirect to the servlet directly from the webserver context, so you may need a ajp-worker mapping in the HttpServer configuration.

 

Windchill AJP Configuration is in file > app-Windchill-AJP.conf so you may need a mapping like 

JkMount /myservlet ajpWorker

 

nbojcetic11-GarnetAuthor
11-Garnet
December 12, 2019

Hi Arpit-Singh,

thank you for your response. I put my servlet under the tomcat folder in the folder webapps (name servletTestApp/myservlet) in the myservlet folder there are WEB-INF folder and class files. Then I changed app-Windchill-AJP.conf by adding a line JkMount /servletTestApp/myservlet ajpWorker.

I am just checking am I doing ok or not. After restarting Apache server the servlet should be accessible by

http://<servername>/servletTestApp/myservlet

 

Sorry for the trouble. We are trying to enable our student workers to be able to download certain pdf documents from the WIndchill without usage of Windchill interface (company policy). Student will input given part number to the web page that will search the Windchill (actually running a servlet that will obtain the document using qualified user credentials)  and return particular pdf (download).

 

Best regards!

14-Alexandrite
December 13, 2019

Hi, nbojcetic.

 

You can also put any JSP file into the Windchill\codebase\infoengine\jsp folder and run it without any additional setup.

 

There you can create a simple interface and use rest services to fetch any data, including the pdf of drawings available to the currently logged-in user.

 

Here I made a tool that checks part usages across multiple databases and gives the user an option to download drawing PDF.

Custom Where Used.png

 

Kind regards,

Dmitry.