Having trouble getting my AttachmentServlet.java and FilterServelt.java to compile

the following is the code (for which the error applies) then the error for each.

AttachmentServlet.java

HttpSession session = request.getSession();
ServletOutputStream out = response.getOutputStream();
int msgNum = Integer.parseInt(request.getParameter("message"));
int partNum = Integer.parseInt(request.getParameter("part"));
MailUserBean mailuser = (MailUserBean)session.getAttribute("mailuser");

cannot find symbol
symbol : method getAttribute(java.lang.String)
location: interface javax.servlet.http.HttpSession

inconvertible types
found : javax.servlet.http.HttpSession.getAttribute
required: demo.MailUserBean


FilterServlet.java

HttpSession session = request.getSession();
MailUserBean mailuser = (MailUserBean)session.getAttribute("mailuser");
String servletPath = request.getServletPath();
servletPath = servletPath.concat(".jsp");

cannot find symbol
symbol : method getAttribute(java.lang.String)
location: interface javax.servlet.http.HttpSession

inconvertible types
found : javax.servlet.http.HttpSession.getAttribute
required: demo.MailUserBean

Recommended Answers

All 6 Replies

there is no such thing as javax.servlet.http.HttpSession.getAttribute()

I think that you are using different version of MailUserBean.

According to me - try this :

HttpSession session = request.getSession();

MailUserBean nameBean =
      (MailUserBean)session.getAttribute("nameBean");

    if (nameBean == null) {
      ...Your steps //String firstName = request.getParameter("firstName");
      //String lastName = request.getParameter("lastName");
      //nameBean = new MailUserBean(firstName, lastName);
      session.setAttribute("nameBean", nameBean);
    }

Do let me know, if it works. If it does not do send the complete code.

Thanks

--------------------------------------------------------------------------------

Okay got past the last problem, but now it is showing the following error, but I'm not sure where exactly it wants me to add the -extension

[WARNING] Ignoring SOAP port "LicenseServiceSoap12": it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.
line 248 of file:/C:/softwaresource/unchanged/GTDev/GlobalTraderUtils/xml-resources/web-service-references/LicenseService.asmx/wsdl/software.globaltradertech.com/LicenseService.asmx.wsdl

Any ideas.

--------------------------------------------------------------------------------

Okay got past the last problem, but now it is showing the following error, but I'm not sure where exactly it wants me to add the -extension

[WARNING] Ignoring SOAP port "LicenseServiceSoap12": it uses non-standard SOAP 1.2 binding.
You must specify the "-extension" option to use this binding.
line 248 of file:/C:/softwaresource/unchanged/GTDev/GlobalTraderUtils/xml-resources/web-service-references/LicenseService.asmx/wsdl/software.globaltradertech.com/LicenseService.asmx.wsdl

Any ideas.

Hi,
the missing -extension switch in J2SE project is a known bug in NB5.5.1 which will be fixed soon in a hotfix update.

Yes, good call, 5.5 compiled it fine.

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.