Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8274587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T07:46:14+00:00 2026-06-08T07:46:14+00:00

I am coding a simple gae webapp that should send me an email from

  • 0

I am coding a simple gae webapp that should send me an email from a form:

I have coded that gae code:

index.html:

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8">
  <title>A form</title>
 </head>
 <body>
 <form action="/feedback" method="post">

  <!-- Simple text field -->
 <label for="name">Name </label>
 <input type="text" name="name"/>
 <br/>

  <!-- Email -->
 <label for="email">Email </label>
 <input type="email" name="email"/>
 <br/>


  <!-- Textarea -->
 <label for="description">Description </label>
 <textarea  name="description" cols="50" rows="5">Type your comment here</textarea>
 <br/>


<input type="submit" name="submit" value="Send Request" action="/feedback"/>
 </form>
 </body>
</html>

web.xml

<servlet>
    <servlet-name>FeedbackServlet</servlet-name>
    <servlet-class>at.wunderapps.servlets.FeedbackServlet</servlet-class>
</servlet>
<servlet-mapping>
    <servlet-name>FeedbackServlet</servlet-name>
    <url-pattern>/feedback</url-pattern>
</servlet-mapping>
<welcome-file-list>
    <welcome-file>index.html</welcome-file>
</welcome-file-list>

servlet:

import java.io.IOException;
import java.util.Properties;

import javax.mail.Message;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@SuppressWarnings("serial")
public class FeedbackServlet extends HttpServlet {

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp)
            throws ServletException, IOException {
        String name = req.getParameter("name");
        String description = req.getParameter("description");
        String email = req.getParameter("email");
        Properties props = new Properties();
        Session session = Session.getDefaultInstance(props, null);

        String msgBody = name  + description + email + " :EMAIL";

        try {
            Message msg = new MimeMessage(session);
            msg.setFrom(new InternetAddress("apps@gmail.com",
                    "Es FUNKTIONIERT!!!"));
            msg.addRecipient(Message.RecipientType.TO, new InternetAddress("my.mail@mail.com", "Your name"));
            msg.setSubject("Bestellung");
            msg.setText(msgBody);
            Transport.send(msg);

        } catch (Exception e) {
            resp.setContentType("text/plain");
            resp.getWriter().println("Something went wrong. Please try again.");
            throw new RuntimeException(e);
        }

        resp.setContentType("text/plain");
        resp.getWriter().println(
                "Thanks you for your feedback. An Email has been send out.");
    }
}

When I am doing localhost i get:

HTTP ERROR: 503

Problem accessing /. Reason:

    SERVICE_UNAVAILABLE

and the exceptions I get are:

java.lang.ClassNotFoundException: at.wunderapps.servlets

CRITICAL: javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: at.wunderapps.servlets

20.07.2012 13:13:46 com.google.apphosting.utils.jetty.JettyLogger warn WARNUNG: failed FeedbackServlet: java.lang.NullPointerException
20.07.2012 13:13:46 com.google.apphosting.utils.jetty.JettyLogger warn WARNUNG: Failed startup of context
com.google.appengine.tools.development.DevAppEngineWebAppContext@495c998a{/,C:\Users\Desktop\mailservice\war}
java.lang.NullPointerException

I guess the problem could be that the inde.html does not find my servlet. But why, cause the web.xml seems to be alright? Can you please help me?

PS.: I am running it on windows 7.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T07:46:16+00:00Added an answer on June 8, 2026 at 7:46 am
    <servlet-class>at.wunderapps.servlets.FeedbackServlet</servlet-class>  
    

    If that is the fully qualified name of your servlet, then the first line of the FeedbackServlet.java file should be

    package at.wunderapps.servlets;   
    

    and the FeedbackServlet.class file should be at

    <yourWebAppRootFolder>/WEB-INF/classes/at/wunderapps/servlets/FeedbackServlet.class   
    

    Or if you are using Eclipse for your IDE, then just place your code in

    <yourWebAppRootFolder>/src/at/wunderapps/servlets/FeedbackServlet.java
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coding a simple little class with a single method send an email. My
I have a simple form that passes to an ASPX page to watch a
I'm currently coding a simple search script in PHP that requires three variables from
Here's my problem: I have a form in index.html, it will have a text
I'm coding out a simple contact form, and the following code is giving me
I'm coding a simple roguelike game in C++ using SDL library, and I have
I'm coding a simple SDL program with VC10. The problem that I am having
I have a web app on GAE written in Go that performs some calculations
While coding a simple function to remove a particular character from a string, I
I had a frustrating problem recently that boiled down to a very simple coding

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.