reset password
Author Message
Vanquish39
Posts: 134
Posted 23:51 Apr 20, 2011 |

My JSP shows in EclipseEE and once I update to cs3 server it doesn't show.  Only the radio buttons show without the text.  Never had this problem with servlets.  Any idea?  I hope time doesn't run out.

Vanquish39
Posts: 134
Posted 00:06 Apr 21, 2011 |

time ran out :-/

rbogle
Posts: 8
Posted 00:08 Apr 21, 2011 |

stupid time

rbogle
Posts: 8
Posted 00:11 Apr 21, 2011 |

and by that i mean, time is stupid for running out, it shouldn't do such silly things....

Vanquish39
Posts: 134
Posted 02:43 Apr 21, 2011 |

-_-.....

abajpai
Posts: 52
Posted 11:43 Apr 21, 2011 |

just for discussion, how are u read the file? is it in a servlet or bean?

in case ur issue is with the file path of the text file:

to deploy the jsp on the server and get it to work, im guessing we'd need servlets because i dont know how else you'd get the relative path of the text file's location. Refer to http://csns.calstatela.edu/forum/viewTopic.html?topicId=4198948 for how to get the file path using a servlet. but this lab involved no servlets, jsut beans. so you'd have to use the absoute path to get the file, which means it probably wont work on the server.

Last edited by abajpai at 11:45 Apr 21, 2011.
Vanquish39
Posts: 134
Posted 17:03 Apr 22, 2011 |

Sorry didn't see your message.  I found out the problem.  It was servlet-oriented.

Vanquish39
Posts: 134
Posted 21:59 Apr 24, 2011 |

Hmm, problem still didn't go away.


This is what I'm doing.  In the jsp there is a bean called "test" which is of type "TestBean"


I call the classe's initialize() method from inside the jsp.  This method initializes the arraylist with all TestEntrys.  I run it to show all the entries and it works.  It shows 10 questions with their choices.  The file is located on G:/CS320/Lab1/DrivingTest.txt

I instantiate a file like so File file = new File("G:/CS320/Lab1/DrivingTest.txt").  It reads all the lines and correctly inputs all the questions.  When I transfer all the files to the server, the questions don't show.


On the server, my path, G:/CS320/... doesn't seem to exist.  I was wondering if there is a path that my computer and the server will recognize. 

Thanks

mbuisin
Posts: 16
Posted 07:56 Apr 25, 2011 |

Try it with an absolute path. You can use the pwd command to get the path to the text file, and type that in your code.

abajpai
Posts: 52
Posted 09:15 Apr 25, 2011 |

i don't think there is a way to get the path of the file dynamically on the server using beans. for that you probably have to use a servlet with JSP (MVC). but if if you do find a way with beans, please do post it on here

Last edited by abajpai at 09:16 Apr 25, 2011.
mbuisin
Posts: 16
Posted 09:47 Apr 25, 2011 |

What I meant was to use the pwd command from the UNIX shell and find out what the absolute path is and then hardcode it in the bean constructor.

But abajpai is right. I don't think there's a way to get the file path dynamically unless the bean constructor queries a database of absolute paths and then have a set/getProperty change/access the query cursor (which is effectively some sort of URL mapping).