Click to See Complete Forum and Search --> : Passing file name from listbox to java program


orla
04-08-2005, 10:38 AM
Hi

Imagine below is a listbox on a jsp, and lingfield etc are html files that contain tables with the different race cards.

Today's Races:

Lingfield
Southwell
Naas
Curragh


This is what i am trying to do i have a jsp which contains a list box with names of html files.what i want is, when the user selects a filename this string is passed to a java file which parses the file and returns the information relevant. How do i pass this value "lingfield" to my java program as at the minute i have it hardcoded in.

public void open () {
boolean getRunners = false;
boolean recordRaceDetails = false ;
boolean isHorse=true;
boolean isPrevOdds=false;

try {
getRaceTimes();

int counter = 0;

in = new BufferedReader(new FileReader("X:\\LingField.html"));

buntine
04-08-2005, 12:19 PM
You can place it in the queryString. You will need to submit the page to the server via a submit button or a peice of JavaScript code.

<form action="yourJSP.jsp" method="get">
... Your Listbox ...
<input type="submit" value="Done" />
</form>

Provided your listbox is a valid HTML form control, it should send its selected value to the server via the QeryString.

Regards.