Rob Singley

Greenhorn
+ Follow
since Sep 20, 2004
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 Rob Singley

Thank you sooo much...

That was it!....I hardcoded a value for format and it worked!!

Now I just have to trace the code to see why it isn't getting a value...

I really appreciate your help....

Rob
14 years ago
Thanks again for the help...

The section in mail1.jsp.java is:



Line 99 is:

multipart.addBodyPart(messageBodyPart);
14 years ago
BTW....I'm a bit new to coding in Java....So once I actually get this code working I'll work on cleaning it up...

Rob
14 years ago
Thanks for the response....

If I remove the public class sendDatMail{ line I get a null pointer exception. I pasted snippets from each section of the tomcat output below.


exception

org.apache.jasper.JasperException
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:254)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)

root cause

java.lang.NullPointerException
at org.apache.jsp.mail1_jsp.sendDatMail(mail1_jsp.java:99)
at org.apache.jsp.mail1_jsp._jspService(mail1_jsp.java:218)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
14 years ago
Hi,

I am trying to use the javamail program (with a few modifications). I am getting a cannot resolve symbol for the senDatMail method that I am using.
I'm not a proficent java programmer so I'm not sure why i am getting the error but my troubleshooting has lead me to the sendDatMail(args); line in my code that is causing the error.

I have spent many hours trying to get this code to work so any help would be greatly appreciated.

14 years ago
I switched the code to sendDatMail(args); and still get the illegal address error....

I'm fairly new to jsp coding so it may be a bit ambitious of me to try and create a javabean helper class...

Could illegal address possibly mean that my "to" value is not being passed correctly and therefore the address is in fact not valid....

Thanks..

Rob
14 years ago
Hi Suresh,

Were you ever able to resolve this issue? I am receiving the exact error when trying to send an email. I think that the sendDatmail method in the below code is causing the error for me....I can't seem to find what would be causing the issue...maybe another set of eyes on my code would help....

Thanks,

Rob



14 years ago
I'm assuming that the illegal address is the email address that is being used....Is that correct?
I will look into trying to catch the exception.....

Thanks.....
14 years ago
JSP
Hi,

I just want to know possible causes for tomcat throwing an HTTP Status 500 -"illegal address" error...I have done some searches on the net but haven't been able to find information on possible causes for this error...

I have an application that I have created to send out emails....I know the email address that I am using is correct....

Any help is appreciated....

Thanks
14 years ago
JSP
Well...I tried a few ways to get a while loop to work within this section of the code and had no luck....

There are three main structures that are available on this page. They are:

choices.getString(1) - This retrieves data from a TYPE field in my database. There are many different values for TYPE within the database, the section I am working with anything with a value of consulting in this field.

choices.getString(2) - This retrieves data from a NAME field.

choices.getString(3) - This retrieves data from a QUOTE field.

The page is suppose to function in that when it is loaded Consulting appears as a heading with an arrow beside it. When the arrow is clicked the values for the NAME field are displayed below Consulting as links. When you click on one of the links the value of the QUOTE field is populated into a text box.
This is all functioning, except for how the links are actually getting displayed.


I use the document.write to display the arrow to do the drop down toggle. So when you click on it the list of links is displayed.
The out.print was used when I was trying a few different things to get the While loop to work. I have removed it and included my updated code below.

14 years ago
JSP
I think that I figured out what is causing the problem...but I'm not sure of the proper way to code the fix....

Right now my jsp is displaying:

Consulitng
Item 1

Consulting
Item2

When I want it to display

Consulting
Item 1
Item 2

As I understand things the while will loop until the condition no longer exists, so right now I have two entries in my database therefore it is running through all of my code(including the Javascript) twice.

What I need it to do is to execute this line ( <li><a href="emailer.jsp?viaName=<%=URLEncoder.encode(choices.getString(3))%>"> <%=choices.getString(2)%></a></li> until all of the entries are displayed....

But I don't think I can add a while statement within another while statement.....

I am a beginner so this is a bit of a learning curve for me....

Any help is appreciated....
14 years ago
JSP
No I never see a compilation error...but it could very well be a jsp syntax error...I tried to construct my while loop from things I have read on the net....I thought it should have been fairly simple to do since I was already getting values returned....
I just wanted to have my code display all the values from the database not just one....

Thanks...
14 years ago
JSP
The browser itself never recovers...no error messages and the status bar stays at about half way...

If I take out the below section:

<ul type="square" id="consulList">
<%

while (choices.getString(1).equals("consulting"))
%>
{
out.print("<li><a href="emailer.jsp?viaName=<%=URLEncoder.encode(choices.getString(3))%>"> <%=choices.getString(2)%></a></li>");
}
%>
</ul>

and put in:
<ul type="square" id="consulList">
<li><a href="emailer.jsp?viaName=<%=URLEncoder.encode(choices.getString(3))%>"> <%=choices.getString(2)%></a></li>
</ul>

It does load the page correctly and bring me back one column value from my database. It just won't create a list with all of my values. This is why I tried to put the while loop in....
I'm a bit inexperienced at jsp so I may be going down the wrong track trying to get this list to display....
14 years ago
JSP
Sorry about that....

The browser never comes back when I try and load the page...just a blank page....
14 years ago
JSP
I am trying to create a list that drops down on the page when a link is clicked.
So the page displays:

Items

then when clicked items creates a drop down list of links that looks like:

Items
Item 1
Item 2
Item 3
Item 4

The item values are coming from a field in an Oracle database.
This is the code that I am using that isn't working. Is there something wrong with the while loop?

<%
while(choices.next())
{
if (choices.getString(1).equals("consulting"))
{
%>

<ul id="collapsibleList">

<script type="text/javascript">
document.write('<img id="emailImage1" src="down.png" width="15" height="8" alt="Open list" onKlick="togglecon(\'emailImage1\',\'consulList\');"> Consulting');

</script>



<ul type="square" id="consulList">
<%

while (choices.getString(1).equals("consulting"))
%>
{
out.print("<li><a href="emailer.jsp?viaName=<%=URLEncoder.encode(choices.getString(3))%>"> <%=choices.getString(2)%></a></li>");
}
%>
</ul>

</ul>
<script type="text/javascript">
document.getElementById('collapsibleList').style.listStyle="none"; // remove list markers
document.getElementById('consulList').style.display="none"; // collapse list
// this function toggles the status of a list
function togglecon(image,list){
var listElementStyle=document.getElementById(list).style;
if (listElementStyle.display=="none"){
listElementStyle.display="block";
document.getElementById(image).src="up.png";
document.getElementById(image).alt="Close list";
}else{
listElementStyle.display="none";
document.getElementById(image).src="down.png";
document.getElementById(image).alt="Open list";
}
}
</script>
14 years ago
JSP