• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
  • paul wheaton
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Rob Spoor
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:

Importing packages in jsps

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
im kind of new to jsps, although i have done a lot of java programming before.
Basically, whenever i try to run a jsp which requires an import ( <% import java.io.* %> ),
it wont, and displays the compilation errors where it says 'no match for toString (for example)
I tried a couple of the examples that came with the book, and they wont work either, unless they dont require any imports.
The only thing i cant think of is that it needs to be actually on line when i run them (which i cant be, as I have no internet connection) OR, the classpaths are set up incorrectly.
If you can confirm that either of these suggestions might be the cause, or if its a completely different reason, id be grateful!!
Thanks,
Hannah
 
author
Posts: 1436
6
Python TypeScript Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sounds like a classpath problem. JSP should run just fine from http://localhost:yourpage
Just to be sure, the correct import syntax should be:
<% page import="java.util.Vector" %>
Or simply
<% import java.util.*; %>
NOTE the semicolon.
 
This is my favorite tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic