If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Communicating with desktop application via HTTP POST

Hello, I am trying to communicate back to desktop application that is sending a number of parameters to a web page I've created via HTTP POST and having difficulty determining how exactly one responds back, not to another web page but in what strikes me as somewhat of a "broadcast to the world" method.

The platform for my pages is Tomcat 5.5.17 within an OpenCMS 6 environment.

On this page, I am expecting some parameters via HTTP POST to be sent to a URL I've created.

At a minimum, I am trying to parse these post values and return information to the application, which the Network Monitor/Nettrace logs show me as my local machine's IP address.

I've never done this before and have only a basic exposure to JSP but do have some ASP methods to reference for ideas.

Anyway, when I send values to this page via HTTP POST I do not see any activity in the Network Monitor trace. I believe it is because I am confused about what response methods to use in JSP.

The application is sending me five parameters. I am supposed to parse and match these and send back three in return.

The other problem I am seeing is that when you access the page with no HTTP POST parameters, I get an internal server error. The OpenCMS error details are as follows:

Code:

java.lang.NullPointerException
at org.apache.jsp.WEB_002dINF.jsp.offline.sites.go.index_html_jsp._jspService(index_html_jsp.java:112)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at org.opencms.flex.CmsFlexRequestDispatcher.includeExternal(CmsFlexRequestDispatcher.java:194)
at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:170)
at org.opencms.loader.CmsJspLoader.service(CmsJspLoader.java:433)
at org.opencms.flex.CmsFlexRequestDispatcher.includeInternalWithCache(CmsFlexRequestDispatcher.java:423)
at org.opencms.flex.CmsFlexRequestDispatcher.include(CmsFlexRequestDispatcher.java:174)
at org.opencms.loader.CmsJspLoader.dispatchJsp(CmsJspLoader.java:467)
at org.opencms.loader.CmsJspLoader.load(CmsJspLoader.java:412)
at org.opencms.loader.CmsResourceManager.loadResource(CmsResourceManager.java:719)
at org.opencms.main.OpenCmsCore.showResource(OpenCmsCore.java:1332)
at org.opencms.main.OpenCmsServlet.doGet(OpenCmsServlet.java:151)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)

I would prefer not to see any error here but I'm not sure what I'm doing or "not doing" here that is creating this error.

Can anyone speak to the issue at all? If anything about the previous post was unclear or leaves anything to the imagination please let me know and I will attempt to clarify.

At the most basic level, I need clarification on what the accepted method for broadcasting back HTTP POST parameters to a desktop application, in this case .EXE installer performing a "check for updates" that is itself an HTTP POST to my web page.

You have a desktop app with a check for updates button. You want to send data to your web server and perform some sort of business logic then return a result back to the application.

I would recommend a web service approach for this sort of thing. From what I can tell you have a JSP sitting out there using JSTL to do your business logic and you are trying to have the application read the response of that page. You will probably want to use a web service for this sort of thing as you have a lot more control over the the process. If you develop using eclipse it will do most of the heavy lifting for you.