How do display/generate webpage content with info from an array in a .java file?

  • Java
  • Thread starter KataKoniK
  • Start date
  • #1
168
0
Does anyone know how I would go about displaying/generating webpage content with info from an array in a .java file?

Suppose you click on cars.com, once you do, the webpage will display the contents (say car names) of an array from a .java file. How do I do this?

Thanks.
 

Answers and Replies

  • #2
-Job-
Science Advisor
1,146
2
Since the .java file isn't compiled you have a couple of options. If you must read the "car names" from an array in a java file (instead of from an XML file or database, or any data file) then you can use ASP or PHP to read the contents of the .java file, locate the array, parse the contents and write them to a web page.

Alternatively you could compile the .java file into a .class file, then write a JSP application (running under an Apache Tomcat server for example) that imports the appropriate namespace and reads the array entries directly.
 

Related Threads on How do display/generate webpage content with info from an array in a .java file?

  • Last Post
Replies
11
Views
6K
Replies
4
Views
10K
  • Last Post
Replies
1
Views
3K
  • Last Post
Replies
9
Views
6K
Replies
2
Views
1K
  • Last Post
Replies
18
Views
16K
  • Last Post
Replies
6
Views
2K
Replies
3
Views
21K
Replies
13
Views
1K
  • Last Post
Replies
1
Views
4K
Top