John Davis

Ranch Hand
+ Follow
since Nov 02, 2000
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 John Davis

thank you for that response - J Kevin Robbins,

I thought I did understand Resource Test - The output I posted (content of static.index.html file) was copied from the Resource Test servlet response body section of Resource Test: Here it is again.

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Welcome Page! Servlet to process XML</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.
</head>
<body>
<div>yeo! what's happening dude?</div>
</body>
</html>


This certainly is not what I wanted to see returned from the server.

However I will look into FireBug right after I try to find my System.out.println log.">
4 years ago
Please don't ask again. I replied in my last post: "I will deploy a logging version and test shortly" - I'll post again when I get System.out.println results;
4 years ago
Bear,

Right, the servlet code doesn't prove that the servlet has been run. I included the servlet code to show what method contained what in response to the question. I specified that I tested with HTTP Resource Test Firefox plugin with results that verified that that Tomcat ran the servlet - The servers response header = :
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept-Ranges: bytes
Etag: W/"490-1401380814000"
Last-Modified: Thu, 29 May 2014 16:26:54 GMT
Content-Type: text/html
Content-Length: 490
Date: Fri, 30 May 2014 14:16:09 GMT

The server's response message body = :

<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Welcome Page! Servlet to process XML</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div>yeo! what's happening dude?</div>
</body>
</html>


I don't know if this officially constitutes proof that the servlet ran, but I don't see how else the Resource Test could know about Apache-Coyote/1.1 unless it ran the servlet.

I will deploy a logging version and test shortly.

4 years ago
Yes, the code runs: I'm testing with HTTP Resource test plugin in Firefox - I specify POST, and paste in my message body and submit. The plugin prints the server response (which identifies Apache Tomcat among other objects) and shows the message body. As you know, the message body does not contain the response - but the static content of an index.html file.
The code for the servlet follows:

4 years ago
I submitted a technical question in the Servlets forum, and but they wouldn't publish it. I don't know why yet. They requested that I check my "PMs" and then make adjustments - however, they neglected to explain what a PM is?

"
4 years ago
I developed a simple servlet using Netbeans IDE - and deployed it to a standalone Tomcat running as Windows service. I'm testing an HTTP POST request using the HTTP Resource Test Firefox plugin. Response processing in the servlet looks like this:

When I do the POST (of some XML) I want to see the output from the Servlet's response processing out.println statements via response.getWriter. Instead, an index.html (from the Netbeans project's WEB-INF folder) is displayed? How do I fix this so I get see the response that I am writing out via response.getWriter.
4 years ago
I read the style guide but did not find any text which could help me to format EXISTING CODE with braces on the same line yielding code with braces on a new line properly indented and aligned. CTRL + SHIFT + F does nothing for me currently.
I configured a custom template for formatting braces where new line was selected for all items. I clicked the apply button. I have existing code with braces which are on the same line. When I try CTRL + SHIFT + F nothing happens, I do not get a new line for the braces. I am running Eclipse 3.3.2. How can I get existing code formatted (with respect to new line for braces and braces aligned and indented correctly?
I have the following information:
IntervalStartDate: '2008-09-18'
IntervalStartTime: '17.48.33'
IntervalEndDate: '2008-09-19'
IntervalEndTime: '18.18.33'

I would like to compute duration of interval in seconds.

Can anyone suggest an easy way to do this (an open source object library?)?
9 years ago
#1. I haven't used MyEclipse for a while because it didn't have support (tutorials, wizards, etc) for Spring and Hibernate. This was some time ago. Has MyEclipse evolved to offer this functionality?

#2. In all likelihood my subscription for MyEclipse has expired. I never did receive any renewal communications with MyEclipse. Does MyEclipse email current subscribers with a renewal offer when their subscription is about to expire?

[Edit to provide meaningful topic]
[ July 30, 2007: Message edited by: David O'Meara ]
Dear Jai,

Thank you so much for your help. I finally got this program to work OK (without a store.connect().

11 years ago
I have modified the code per your suggestion (re: JGuru's JavaMail tutorial) and currently I am running with store.connect().

store.connect () is the instruction which is kicking the exception - authentication failure.

I think its odd that store.connect kicks an exception which I log and ignore and then my attempt to write email succeeds.

I think I'll remove the store.connect() code and try it that way. Maybe it will work with just the userID and pwd in the props.
11 years ago
Thanks for that information.

I'm writing a Java App to do this so I don't have (app server) logs to look at. I set the property you suggested (smtp auth true) and I started to get email written (instead of getting address rejected: access denied).
Whats odd is that I am still getting

javax.mail.AuthenticationFailedException
at javax.mail.Service.connect(Service.java:306)
at javax.mail.Service.connect(Service.java:156)
at javax.mail.Service.connect(Service.java:105)
at qflexAlert.emailESBsupp(qflexAlert.java:57)
at qflexAlert.main(qflexAlert.java:17)

but my email is still written out by the SMTP server. I don't understand this.
11 years ago
Thanks for the reply.

I looked at that documentation and coded up an attempt, but I'm getting an authentication error.

The "how to authenticate yourself" documentation is again tailored to connecting to pop3. My problem is that I need an authenticated connection to the SMTP server so that I can write email.
11 years ago
How does one connect to SMTP server to send email?
I'm getting "recipient address rejected: access denied" and I think its because I'm not specifying login ID and password.
When I look in the JavaMail api documentation I see information about how to connect for the purposes of getting pop3 or imap email
i.e.


I tried this code but it didn't work. For purposes of writing email how should I connect to the SMTP server with ID and password.
11 years ago