Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

MAC Address and System.out.format  RSS feed

 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have this code and work fine but... it show the values in the console and I need to show it in a jsp page. Or at least to store the value in a variable for storing it in the database.
Someone know how I can do it?
I tried eliminating "System" but it not work. I tried with "out.print" but it give error because it accept String variables only and my variable in a byte.




[English only please.]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is console code. What relationship does it have to a JSP? Web applications don't use main() methods.

Do you already have a web application up and running?
 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


This is my real code. I put a fragment of it in my jsp page but I need to show the "mac" variable in the page with the correct format. I do not use the Main class, I just to put it as example because is more short.

 
Paul Clapham
Sheriff
Posts: 22374
42
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use a Formatter object (java.util.Formatter) to do the same thing you would do with System.out.

(You didn't ask, but the idea of formatting the server's MAC address and including it in the output of a JSP seems to me like a strange thing to do. Is that really what you want?)
 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:You can use a Formatter object (java.util.Formatter) to do the same thing you would do with System.out.

(You didn't ask, but the idea of formatting the server's MAC address and including it in the output of a JSP seems to me like a strange thing to do. Is that really what you want?)


Thank you Paul I will try it tomorrow.
I want to do is to save the mac address information in the database. I doing that for auditory requirements. I will not show it in the screen really only when We need to do a query.

I will read more about formatter and tomorrow I will give you news.

Muchas Gracias
 
jhon masco
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
The Formatter object do the work!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!