Java Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgrammingJava Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 9th, 2004, 12:44 PM
sewage sewage is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 50 sewage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 35 sec
Reputation Power: 14
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

Reply With Quote
  #2  
Old December 9th, 2004, 02:11 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
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.

Reply With Quote
  #3  
Old December 9th, 2004, 02:46 PM
sewage sewage is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 50 sewage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 35 sec
Reputation Power: 14
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

Reply With Quote
  #4  
Old December 10th, 2004, 09:15 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
There are other ways as well: such as interacting with the filesystem...
Personally I'd stick with the database idea.

Reply With Quote
  #5  
Old December 10th, 2004, 02:47 PM
sewage sewage is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 50 sewage User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 22 m 35 sec
Reputation Power: 14
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...

Reply With Quote
  #6  
Old February 4th, 2005, 11:25 AM
sbegueria sbegueria is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 1 sbegueria User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 30 sec
Reputation Power: 0
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)

Reply With Quote
  #7  
Old February 20th, 2005, 04:02 AM
gertcuppens's Avatar
gertcuppens gertcuppens is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 118 gertcuppens User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 28 m 17 sec
Reputation Power: 14
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.

Reply With Quote
  #8  
Old February 21st, 2005, 09:31 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,886 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 19 m 35 sec
Reputation Power: 18
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?

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > photoblog with jsp


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap