Elton Hughes

Ranch Hand
+ Follow
since Jun 19, 2003
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Elton Hughes

Hello All,

Yes, I am the proud owner of a new IPhone. I stood inline for 4 hours, starting at 3:20 pm on June 29th. It would not have been to bad, but it was a cool and very windy day in Milpitas.

I am very happy with my purchase. It does a few quirks though. Most headphones do not work with it. The headphone jack is recessed. At present, few headphones work with it. It does have bluetooth, but bluetooth only works with bluetooth headphones.

All in all though, it is very slick. The screen is easy to see. It is much easier use the keypad that my old cellphone. And the contacts setup and use is very easy. Web and email works fine. The ATT Edge network can be a bit slow, but it is OK. Wifi connecting is easy and is usually faster, if you can get it.

As for developing programs for it, maybe when I retire in 2 years. My day job just won't give me enough time to do it properly.

Elton
16 years ago
Hello All,

As one of those who will be waiting in line tomorrow, arriving before 6, I will give you my review if I am able to get one.



Allen
16 years ago
I have been away from coding Java for a while. I recently needed to create a small program that updates a database. Here it is:



I hope Kathy Sierra and Bert Bates don't see that code, everything is in the main method. (I learned Java from Head First Java. ) In short, it is ugly.

The good thing is it works. But it is not reusable. If there is an easy way of extending it and changing just the query string, that would be great. But I am rusty at my Java and need some advice.

Thanks,

Elton
Hi Bear,

Thank you for pointing that out. As someone who is learning from a book, I can only assume the authors had a good reason for mixing things up. The book I am learning from earned 8 horseshoes.

What should the taglib lines be?

Thanks,

Elton
17 years ago
JSP
Hello All,

I am trying to learn about JSP and I am doing the exercises in the book "Beginning JSP2" from Apress. Until the last exercise, things were going well.

Here is what I am using:
Mac OS X 10.4.6
Tomcat 5.0.28
MySQL 5.0.16
MySQL ConnectorJ 3.1.13

Here is the latest script:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jstl/sql_rt" %>

<sql:setDataSource var="datasource"
driver="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost/publish"
user="publishuser" password="XXXXXXXXXX"/>

<sql:query var="books" dataSource="${datasource}">
SELECT id, title, price FROM book
</sql:query>

<html>
<head>
<title>JSP gateway to the Publish Database</title>
</head>

<body>
<table border="1">
<tr>
<td>id</td>
<td>title</td>
<td>price</td>
</tr>

<c:forEach items="${books.rows}" var="row">

<tr>
<td><c:out value="${row.id}" /></td>
<td><c:out value="${row.title}" /></td>
<td><c:out value="${row.price}" /></td>
</tr>

</c:forEach>

</table>
</body>
</html>

Unfortunately, I am getting this error message and I do not understand what it is saying. The message is:

javax.servlet.ServletException: org/aspectj/lang/Signature
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
org.apache.jsp.bookList_jsp._jspService(bookList_jsp.java:80)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:242)
org.apache.taglibs.standard.tag.common.sql.DataSourceWrapper.setDriverClassName(DataSourceWrapper.java:46)
org.apache.taglibs.standard.tag.common.sql.SetDataSourceTagSupport.doStartTag(SetDataSourceTagSupport.java:102)
org.apache.jsp.bookList_jsp._jspx_meth_sql_setDataSource_0(bookList_jsp.java:100)
org.apache.jsp.bookList_jsp._jspService(bookList_jsp.java:64)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

It looks like a class is missing. But the instructions only called for the mysql connector jar to go into the WEB-INF/lib directory, so I am at a loss as to what to do next.

Thank you for your time.

Elton
17 years ago
JSP
Hello Stefan,

Thank you!

LOL, I think I was looking at it too long. Sometimes the silliest of errors are the hardest to see with a tired set of eyes.

Thanks!

17 years ago
JSP
Hello All,

I and learning about JSP and Servlets. I am using the book "Beginning JSP 2" from Apress as my guide. The servlet container I am using is Tomcat 5.0.28. I have been following the examples in the book and things are going well. As an experiement I decided to modify an example in the book an access our MS SqlServer database. Unfortunately, I am getting the following error:

org.apache.jasper.JasperException: /Grant201Active.jsp(1,5) Invalid directive

Here is my program (with IP, user, and password x'd out):



Any thoughts?

Thank you for your time and patience.

Elton
17 years ago
JSP
Thanks Bear! That was going to be my next question asked over in the Tomcat forum.

Cheers!
18 years ago
JSP
Thank you Bear and Stefan for your input.

I think I will upgrade to Tomcat 5. It looks like 5.5.9 is the latest stable version. I have additional questions and will ask them in the appropriate forum.

Thanks once again.
18 years ago
JSP
Hello All,

I am learning JSP and I ran into a small problem. I have a very simple JSP file that contains this line:

2 + 2 is ${2 + 2}

When the line is evaluated by Tomcat, it listed the line as typed. I am using Tomcat 4.1.31. Could that be the problem? Or is it something else?

Thanks,

Elton
18 years ago
JSP
Hello Fellow Mac Users,

I came across an issue I wanted to share with all of you. I decided to look into Velocity as a part of my exploration of MVC, servlets, and JSP. I found a well reviewed book and started to work through the examples. I found that if a template had more than one line, only the last line would appear. I was using BBEdit as my editor for the template and on a hunch I switched from Mac line endings to Unix line endings. Now all of the lines fromthe template appear.

So, I am guessing there is an issue, maybe configuration parameter, that needs to be addressed.

Just thought I would share this with the group.

Elton
18 years ago
LOL

Thanks Bear.

Damn glasses. Can't see with them, can't see without them.
18 years ago
Hello Bear,

Thank you for the answer. It is what I thought. But that now leads me to a new question, I hope you do not mind.

I am beginning and exporation of Velocity. I have downloaded and installed in. According to the ant build, it installed successfully.

There are two jar files that came with Velocity. I have moved them to /Library/Java/Extentions. But when I compile this simple application I get an error. The application is:


The error message I get is:

-> javac HelloWorld.java
HelloWorld.java:5: cannot resolve symbol
symbol : class VelocityCotext
location: package velocity
import org.apache.velocity.VelocityCotext;
^
HelloWorld.java:19: cannot resolve symbol
symbol : class VelocityCotext
location: class HelloWorld
VelocityCotext context = new VelocityContext();
^
HelloWorld.java:19: cannot resolve symbol
symbol : class VelocityContext
location: class HelloWorld
VelocityCotext context = new VelocityContext();
^
HelloWorld.java:23: cannot resolve symbol
symbol : variable template
location: class HelloWorld
template.merge(context, writer);
^
4 errors



Seems to me like it is saying that it cannot find the jar files in that directory. Am I reading that right?

Thanks,

Elton
18 years ago
Hello All,

Based on a 9 horse shoe review, I bought Pro Jakarta Velocity. I have just started the book and I am having troubles with the first example program. It is the Velocity version of the famous "Hello World" program. The code is this:


It compiles, but when I run it I get the following message:
-> java org.novaworks.ch02.HelloWorld
Exception in thread "main" org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'src/templates/ch02/HelloWorld.vm'
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:458)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:341)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:831)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:813)
at org.apache.velocity.runtime.RuntimeSingleton.getTemplate(RuntimeSingleton.java:285)
at org.apache.velocity.app.Velocity.getTemplate(Velocity.java:469)
at org.novaworks.ch02.HelloWorld.main(Unknown Source)
->

It appears that the program is unable to find the template.

Unfortunately, I am at a loss as to how to solve the problem. Any insight and help would be greatly appreciated.

Thanks!

Elton
Hello All,

I am using Mac OS 10.3.8 and I am starting to learn about Velocity. I had some problems (actually I still do, but I want to work on them some more before turning to help), but the biggest one was solved when I moved a Velocity jar file into /Library/Java/Extentions.

So what does that directory actually do?

Thanks,

Elton
19 years ago