|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
photoblog with jsp
I would like to create a photoblog in which you could click on a forward or back button and it changes the photo being displayed, so is it possible to have variables for the image tags so that every time I click on the forward button it increments a variable by one....the <img> tag source is labeled by a variable therefore when the variable is incremented it will change the picture. dont know much about jsp so I am not sure if jsp works like that, could some one jsut give me a hint on the code for this, or a better way of going about it
|
|
#2
|
||||
|
||||
|
Your next/back things would be separate than the action <img> tag that displays the image.
I assume your using a database? The table I presume will have the image file location (src), and an id and perhaps a title... As a general page flow, you would receive a variable from the request [I'd recommend using the query string, GET, to pass the variables]... query the database to get the row that corresponds with the ID [from the query string]... display the image and display next/previous links. The HREF on the next/previous links would pass ID+1 and ID-1 respectively... I hope maybe this gets you thinking without me having to do the entire thing for you. In case I didn't properly understand your question, please feel free to clarify and ask further questions. |
|
#3
|
|||
|
|||
|
now thats what I call a hint! database...hadnt thought of that, but good I will try it. perfect cowman, I may post back in a couple days if I cant figure somthing out
|
|
#4
|
||||
|
||||
|
There are other ways as well: such as interacting with the filesystem...
Personally I'd stick with the database idea. |
|
#5
|
|||
|
|||
|
omg!!!! I cant get the JDBC connector to work!!! its frustrating as hell because I have no idea how to install it correctly and thus i have no idea what is right and wrong! and yes I tried following several help files, but they are either over my head or they just dont apply. i am using apache2.0.49, mysql 4, and resin 3.0.8, hopefully you have some experience with resin and could offer some help
so far I copyed the connector (mysql-connector-java-3.0.16-ga-bin.jar) found on the mysql site into the resin/lib folder, I am pretty sure thats where it goes because I installed javamail there... but I am unsure as to what to configure now, if i try and use jsp to access the db the output is a 500 servlet not found error so I was thinking that there was somthing missing from web.xml so i inserted <database jndi-name="jdbc/basic"> <driver type="com.mysql.jdbc.Driver"> <path>WEB-INF/db</path> </driver> </database> but that gave me other errors pertaining to the web.xml file, what do you think the problem is, have I missed something, am I trying to install it all wrong, should I try configure web.xml to see the jsp or somthing similar to what is down for servlets? do you think the code I am using to access the db is wrong if so I will post that too... |
|
#6
|
|||
|
|||
|
Photoblog with jsp
Hi,
I have created my photoblog with javascript, and it exactly does what you said. You can check it at http://personales.ya.com/sbfoto/home.html. It's in Spanish, but there not too much to understand, just images. When you click on the pic or the nav links (<< >>) a js function reads the info of the next picture (source, date and caption), and shows it on the main page. For the image database I first used XML, but this was not supported by Netscape nor Firefox. I finally stored the data on a js array, stored on an independent file (images.js). Optional ideas on how to implement the image data base would be wellcome (I can't use server-side applications, that's why I decided to use jsp). (Sorry for the imperfect English) |
|
#7
|
||||
|
||||
|
Sewage, your problems with JDBC are dated 10th of december.
If you still have those problems, let us know. I could give you some code on how to connect to a database with JDBC. |
|
#8
|
||||
|
||||
|
this is out of scope of sewage's original question
sbegueria,
I was going to ask why you decided to use Javascript to do this, but your last sentence clears that up. This is something often done with ASP, JSP, PHP, and CGI... I'm amazed at how you've accomplished it with Javascript. So, to update your photoblog, you add new variables to your imageArray? |
![]() |
| Viewing: Dev Articles Community Forums > Programming > Java Development > photoblog with jsp |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|