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 July 19th, 2005, 03:16 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
java and jsp..please help .

my application is a web based library and i'm new to this field.
i created html files and jsp files and java files corresponding to the system .i want to know how should i test it using tomcat.my database is mysql .

Reply With Quote
  #2  
Old July 19th, 2005, 07:56 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
I would install tomcat on my local machine and copy your files to tomcat's webapps directory.

You can download tomcat here.
Here's an article on installing tomcat on windows.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #3  
Old July 19th, 2005, 11:05 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
Smile

thanks a lot .the article helped me a lot.

for my application i have created html pages as interfaces , and jsp(actually a very few yet) and java beans.

i created my application folder libraryapp under webapps and created 3 subfolders called conf,WEBINF and src. and it doesnt show my page.
is that correct?

Reply With Quote
  #4  
Old July 20th, 2005, 11:37 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
Under which folder are you placing the HTML and JSP files?

Reply With Quote
  #5  
Old July 20th, 2005, 12:17 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
under webapps i created 3 folders,WEB-INF,src and conf.
i placed html and jsp in src folder. and web.xml in WEB-INF.

Reply With Quote
  #6  
Old July 20th, 2005, 12:24 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
You might want to create a single folder for your project.

TOMCAT_HOME/webapps/library_project/

try sticking your files in there.

Reply With Quote
  #7  
Old July 20th, 2005, 12:38 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
what is that main.conf file in conf folder? .i use intellij idea asthe ide.
how to deploy and do the war file?

Reply With Quote
  #8  
Old July 24th, 2005, 12:14 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
html and java

my application is a web based library system.
and i have to implement search facility of books.
i want to know how to get the resultset of a search to a web page's table(html table)
i.e, when search is done through excecuteQuery method of stmt object, how to send the result set to a table to show the output.i mean how to get the resultset object looped in to a table.
thanks in advance

Reply With Quote
  #9  
Old July 24th, 2005, 04:25 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: 15
This is a part of my JSP where I show the details of every found film in a list.


Code:
<DIV id=scroll1 style="BORDER:2px; OVERFLOW: auto; position: absolute; width: 700px; height: 250px; visibility: visible; left: 157px; top: 317px;">
  
  <table width="600" border="0" align="center" id="lijst">
  
	<% 
	for (Iterator i = filmLijst.iterator(); i.hasNext(); )
 		{ 
		Film film = (Film) i.next(); 
		%>

  		<tr>
  		  <td width="80"><input name="detail" type="submit" id="detail" value="<%=film.getFilmnummer()%>"></td>
      	  <td width="274"><%=film.getTitel()%> </td>
	  	  <td width="113"><%=film.getJaaruitgave()%></td>
	  	  <td width="115"><%=film.getGenre()%></td>
		</tr>
      <% } %> 
  </table>
  
</DIV>


In the declaration of my JSP, I've put :
Code:
<%@ page import = "java.util.Iterator" %>
<%@ page import = "org.gertcuppens.cluif.Film" %>
<jsp:useBean id="filmLijst" class="java.util.ArrayList" scope="session"/>


You need iterator to go through the ArrayList called filmLijst. Each of these objects you find has to be cast to an object of the class Film.

Where did I make this filmLijst ?
that was in the filmDao (DAO stands for Data Access Object, a java class which contains the SQL instructions)

Code:
public ArrayList zoekFilmOpLetter(String _letter)
		throws Melding
	{
		ArrayList filmLijst = new ArrayList(); 
		Connection con = null; 
		PreparedStatement ps = null;
		ResultSet rs = null; 
		try {
			StringBuffer zoekString = new StringBuffer();
			zoekString.append("select * from film ");
			zoekString.append("where titel like '" + _letter + "%'"); 
			System.out.println("zoekstring heeft de waarde " + zoekString); 
			con = getDatabaseConnection();
			ps = con.prepareStatement(zoekString.toString());
			rs = ps.executeQuery();
			
			if (rs == null)
				{
				ps.close();
				con.close();
				System.out.println("geen film gevonden"); 
				}
			else	
			    {
				while (rs.next() )
						{
						Film film = new Film (rs, "lijst");
						System.out.println("gevonden film is " + film.getTitel()); 
						filmLijst.add(film);
					
						} /* while rs.next() */ 
				rs.close();
				ps.close();
				con.close(); 
				} /* else : rs != null */
		
			} catch (SQLException sqlEx)
				{
				Melding melding = new Melding(sqlEx); 
				throw melding; 
				}
			   catch (Melding melding)
			   {
			   	throw melding; 
			   }
			   
		return filmLijst;
	}


The DAO is created and then used in the servlet.

Code:
private String behandelAlfabet (HttpServletRequest _request)
{
	Logger gcoLogger = Logger.getLogger("gco.log");		
	String radioLetter = _request.getParameter("radioLetter"); 	
	System.out.println("gcoController -- radioLetter is " + radioLetter); 	
	gcoLogger.debug("gcoController -- radioLetter is " + radioLetter);    
	if (_request.getParameter("selecteren") != null)
	{
		System.out.println("button is selecteren"); 
		gcoLogger.debug("button is selecteren"); 
		return SELECTIE_PAGINA; 
	}
	else if (_request.getParameter("zoeken") != null)
	{

		System.out.println("button is zoeken"); 
		gcoLogger.debug("button is zoeken"); 
		HttpSession sessie = _request.getSession(true);
		// if (sessie == null) sessie = _request.getSession(true); 
		FilmDao filmDao = new FilmDao();
		ArrayList filmLijst = new ArrayList(); 
		try {
			filmLijst = filmDao.zoekFilmOpLetter(radioLetter); 
		    Melding melding = new Melding("selectie op films beginnend met " + radioLetter); 
		    _request.setAttribute("melding",melding);
			} catch (Melding melding)
				{
			    // Melding melding = new Melding(exc);
			    //HttpSession sessie = _request.getSession(false); 
				/* plaats de melding in request; als je melding
				 * in sessie plaatst, blijft de foutmelding terugkomen
				 * ook al is ze niet meer van toepassing  
				 */
			    _request.setAttribute("melding", melding); 
			    System.out.println("gcoController -- melding klaargezet in behandelLetter() "); 	
			    System.out.println("melding boodschap is " + melding.getBoodschap());
			    System.out.println("melding SQL is" + melding.getSQLMelding());
				}
			sessie.setAttribute("filmLijst", filmLijst);
			return FILMLIJST_PAGINA; 
		}	/* selecteren geklikt */ 
	else 
		{
		System.out.println("behandelalfabet : onvoorzien geval"); 
		gcoLogger.debug("behandelalfabet : onvoorzien geval "); 
		return ALFABET_PAGINA;  
		}
} /* behandelAlfabet () */


Mind the line

Code:
sessie.setAttribute("filmLijst", filmLijst);


With this I put the Arraylist called filmLijst inside the session. And with this, the JSP can retrieve the found values and show them. All you have to do, is provide the next line in the JSP.
Code:
<jsp:useBean id="filmLijst" class="java.util.ArrayList" scope="session"/>

Reply With Quote
  #10  
Old July 28th, 2005, 12:23 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
hi,
thank you so much. your note is really good i learnt a lot from it.

Reply With Quote
  #11  
Old August 2nd, 2005, 12:55 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
jsp/java and tomcat

hi,
how to integrate jsp pages and java files and html files created in to a web based application.
i mean making the war file.

Reply With Quote
  #12  
Old August 20th, 2005, 02:01 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: 15
making a war file

I have never made a war file myself; the server I deploy my web apps, does not support this.
But I managed to find the following information with google :

Quote:
A war file is simply a jar file with a specific directory structure. Looked at another way, a jar/war file is simply a zip file with a different extension. You can manipulate jars/wars with a program that handles zip files, like winzip. No need to use the cumbersome jar command line tool.

The directory structure of a war file is

Code:
/ <- root of your web app. Should be an index.html/index.jsp file
/WEB-INF <- case specific. Must be all caps
/WEB-INF/classes <- this is where you class files go
/WEB-INF/lib <- any jar files you have go in here
/WEB-INF/web.xml <- this is the required web deployment descriptor


These links might be useful :
configuring web apps
creating a war file

Reply With Quote
  #13  
Old September 7th, 2005, 01:09 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
hi,
when my application (web based library) is tested it doesnt write data to the database. i created database using mysql.
when data is entered through webpage it doesnt write to the db. why?

Reply With Quote
  #14  
Old September 8th, 2005, 02:45 PM
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: 15
try-catch block

Whenever you're executing SQL statements, you should be prepared for errors with a try catch block. Did you write this block ? Are there any SQLerrors you catch ?
ANd give us a piece of your code where you think it goes wrong.

Reply With Quote
  #15  
Old September 24th, 2005, 01:17 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
cannot connect to mysql DB

the code goes here of the coonection test..

Code:
class conTest {
    public static ConnectionPool pooler = new ConnectionPool();
    public static Connection con = null;

    public void init() {
        try {
            if (pooler.getDriver() == null) {
                pooler.setDriver("org.gjt.mm.mysql.Driver");
                pooler.setURL   ("jdbc:mysql://localhost/mygreatDB");
                pooler.setUsername("root");
                pooler.setPassword("password");
                pooler.setSize(5);
                pooler.initializePool();
            }

            con = pooler.getConnection();
        } catch (Exception e) {
            System.err.println(e.getMessage());
        }
    }
public static void main(String ar[]) {
        conTest ct = new conTest();
..............

and with this i cant connect with the DB..
what is wrong here ..please point it..

Reply With Quote
  #16  
Old September 26th, 2005, 08:53 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
What is the error you are getting?

in the future, try wrapping your code fragments in [code][/code] tags when pasting to the forum.

Reply With Quote
  #17  
Old September 27th, 2005, 11:21 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
cant connect to mysql

Do i have to install "org.gjt.mm.mysql.Driver" for this.
i installed mysql-essential-4.1.12a-win32 as the database driver.
but i specifically didnt install this org.gjt.mm.mysql.driver

Reply With Quote
  #18  
Old September 29th, 2005, 01:58 PM
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: 15
You refer to a driver but did not install this driver.
I bet you get a "cannot load class" error or something like that. You should install this driver and then try again.

Reply With Quote
  #19  
Old October 5th, 2005, 09:47 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
start tomcat in dos prompt

how to start tomcat in dos prompt.? tomcat is installed in C drive .

thanx in advance

Reply With Quote
  #20  
Old October 6th, 2005, 07:43 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
Depends on the path that you installed tomcat...
I believe it's here: tomcat_install_dir/bin/startup.bat

You may have installed it in C:\tomcat... C:\Program Files\tomcat... C:\apache\tomcat... [etc]

Reply With Quote
  #21  
Old October 8th, 2005, 04:43 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: 15
starting Tomcat from within eclipse

There are other ways to start Tomcat besides clicking on the bat-file. I have installed eclipse as my IDE and I've downloaded a plugin to be able to start Tomcat from within eclipse.

You might consider taking a look at eclipse as your IDE. It's one of the most popular development tools and it is free to download.

If you want more information on this, let me know.

Reply With Quote
  #22  
Old October 8th, 2005, 09:00 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
tomcat

yes..what is the plugin you use to start tomcat.

and i have some more questions about testing the application. when i add data through web page it doesnt write to db prperly..say if i add name, id, password then it writes to db , after adding ,such that password is null name in the field in the DB. but i wrote SQL properly and there are no errors apparently..(i use java/jsp tomcat and mysql)

thanks in advance..

Reply With Quote
  #23  
Old October 9th, 2005, 04:10 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: 15
Sysdeo 's plugin for starting Tomcat

I use the plugin of sysdeo, a french company. The plugin I installed can be found at http://www.sysdeo.com/eclipse/tomcatpluginfr

I just checked the page and since 15 september this plugin is no longer in beta, as it was when I downloaded it.

Mind you, the page is in french but don't let that discourage you. The extra menu you will get, is in english.
Should you have any problems with french, ask me.

In the screenshot shown in the attachment you should choose to download TomcatPluginv31.zip.

After downloading the zip file, you should unzip the content and place it in the plugin folder of eclipse.
If you startup eclipse, you should see the icons to start, restart and stop Tomcat. There is also a Tomcat menu. Look at the second screenshot in the attachments.

The parameters in eclipse referrring to Tomcat should be verified. Go to Window - preferences and change the parameters if necessary. Look at the third screenshot to get an idea what this is all about.
Attached Images
File Type: jpg Sysdeo02.jpg (47.7 KB, 511 views)
File Type: jpg eclipse01.jpg (49.6 KB, 452 views)
File Type: jpg eclipse02b.jpg (72.8 KB, 460 views)

Reply With Quote
  #24  
Old October 9th, 2005, 04:24 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: 15
try-catch block to catch your SQL errors

About your DB-problems : do you use a try catch when executing the SQL instructions. A try catch block is something like this :

Code:
try {
     /* put your SQL instructions here */ 

} catch (SQLException sqlEx )
	{
	Melding melding = new Melding(sqlEx);
	throw melding; 
	}

Reply With Quote
  #25  
Old October 11th, 2005, 09:52 PM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
thanks a lot..for eclipse plugin for tomcat..i downloaded it and configured.

DB problem:
i enclosed it in try-catch blocks,and when i run the application it doesnt add the entries in corresponding fields. and when i retrieve data from the db it gives errors too. what is the problem with this code..? if i'm wrong please clarify.


when adding data i get this errors:

Quote:
SQL Exception: java.sql.sqlException: General error:column count doesnt match value count at row1

Reply With Quote
  #26  
Old October 12th, 2005, 12:30 PM
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: 15
executeUpdate : one or two parameters ?

I always work with preparedStatements instead of statements. But I looked this class up with javadoc (java 5.0) and I see that executeUpdate always expects 2 parameters : the first is always the SQL instruction, the second can be different types but is always used to indicate which columns should be returned.
I would expect your compiler to give an error when the second parameter is missing, but it might be a good idea to check this.

Reply With Quote
  #27  
Old October 15th, 2005, 11:34 AM
harshika harshika is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 24 harshika User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 h 1 m 33 sec
Reputation Power: 0
jsp for DB table search

hi,
in my project i have to do a search to provide reports.
i wrote bean classes and method to select data using sql.
but dont know how to write jsp to activate bean to do the search in db through the method containing sql. how to do this selecting the report type according to user request.
this is the piece of code in html to select the report type.
Code:
    if (rptBean.getReportInfo()) { //error is here..

 

just dont know how to select the report type and show the out put.for these reports it has to search diferent tables in db. and different field names come ..so is there any method to select the report type in the if/else statement..?

thanks for the help.

Reply With Quote
  #28  
Old October 16th, 2005, 07:01 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: 15
MVC design pattern

First of all, I'd like to get your attention to the MVC design pattern. MVC stands for Model View Controller and is a way of dividing the work of your application.
In short : View is the collection of JSP's, Model is the collection of javabeans and controller is the servlet or servlets who control the flow of your application.

In other words, I advice you to take a look at your application. All your JSP's should do, is show the information they get from the javabeans. A part of the programming you do in your JSP's should move to a servlet.

Let's get back to your question.
The error you get, is quite normal.
By writing
Code:
if (rptBean.getReportInfo()) { //error is here..

you suggest that the method getReportInfo returns a boolean while in the javabean you declare that it returns a vector.

I haven't seen the rest of your code, but writing

Code:
if (rptBean.getReportInfo()) { 

could be the solution.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJava Development > java and jsp..please help .


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