1

I deployed my java web application in AWS and while trying to access i am getting the bellow mentioned error. I am not using xml file because the jsp will call ths servlet class.

enter image description here

My index.jsp code:

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<meta name=”viewport” content=”width=device-width,height=device-height initial-scale=1.0″/>
<link rel="stylesheet" href="style.css">
<form autocomplete='off' class='form' action="scrap" method="post">
    <div class='control'>
        <h1>
            Please fill details
        </h1>
    </div>
    <div class='control block-cube block-input'>
        <input name='Product link' placeholder='Product link' type='text'>
        <div class='bg-top'>
            <div class='bg-inner'></div>
        </div>
        <div class='bg-right'>
            <div class='bg-inner'></div>
        </div>
        <div class='bg'>
            <div class='bg-inner'></div>
        </div>
    </div>
    <div class='control block-cube block-input'>
        <input name='Email address' placeholder='Email address' type='text'>
        <div class='bg-top'>
            <div class='bg-inner'></div>
        </div>
        <div class='bg-right'>
            <div class='bg-inner'></div>
        </div>
        <div class='bg'>
            <div class='bg-inner'></div>
        </div>
    </div>
    <button class='btn block-cube block-cube-hover' type='sumbit'>
        <div class='bg-top'>
            <div class='bg-inner'></div>
        </div>
        <div class='bg-right'>
            <div class='bg-inner'></div>
        </div>
        <div class='bg'>
            <div class='bg-inner'></div>
        </div>
        <div class='text'>
            Save
        </div>
    </button>
    <div class='credits'>
    </div>
</form>
</html>

my servlet code

@WebServlet(name="/scrap",urlPatterns={"/scrap"})

public class scrap extends HttpServlet {
    static String start="start";

    public void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        String link = request.getParameter("Product link");
        String email = request.getParameter("Email address");

        //response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        if(start.contentEquals("start"))
        {
            start="notsatrt";
            Thread newthread = new Thread(new test());
            newthread.start();
        }
        database testing=new database(link,email);
        testing.verification();
        testing.run();
        request.setAttribute("verifyemail",email);
        request.getRequestDispatcher("/before.jsp").forward(request,response);
        out.close();
    }

    public void destroy() {
        // do nothing.
    }

}
Calos
  • 1,783
  • 19
  • 28
Raguram
  • 13
  • 4

1 Answers1

0

java.lang.UnsupportedClassVersionError causes due to higher JDK during compile time and lower JDK during runtime

How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version

SHRIDHAR K
  • 40
  • 1
  • 4