• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can receive post data from power meter( acts as in built http server) to my jsp (tomcat server)

 
krishan gopal gupta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have power meter. that provide some data as a post data.
powermeter manual given following information .
-------------------------------------------------------------------------------------------
WattsUp.Net makes a TCP connection to a host (assumed
HTTP server) at default port 80, and uses HTTP POST
to send a parameter list in standard URL encoding,
as shown in the following example.
**EXAMPLE POST FORMAT**
POST /remote/netlog.php HTTP/1.0
Host: meters.wattsup.net
User-Agent: WattsUp.NET
Content-Length: 59
Content-Type: application/x-www-form-urlencoded
id=1&w=0&v=1199&a=381&wh=0&pcy=0&frq=599&va=458&rnc=0&sr=20
-----------------------------------------------------------------------------------------------
I am not getting How can i get that post information and display on JSP page.
How i can sure that http server on power meter is working .
IP address is assign to power meter.


 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a servlet to receive the post. Once the data is gathered, it can be displayed on a JSP forwarded to by the servlet.
 
krishan gopal gupta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank.but my problem is that it is not specify any attribute. so i could not do like

request.getattribute("xyz") in servlet.

is any way that i could connect to power meter through IP address and get post information ?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your description is confusing. Does the meter perform the post to a server, or does the meter serve as a server that you can send requests to? Big difference.
 
krishan gopal gupta
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its manual says meter perform the post to a server.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64990
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How does it know what URL to use?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic