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 9152011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:56:25+00:00 2026-06-17T11:56:25+00:00

By running the applet from a jsp page the mapping gets changed down the

  • 0

By running the applet from a jsp page the mapping gets changed down the line due to spring security.
I have created Maven project using Spring MVC.
Here is my Jsp page

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<HTML>
<HEAD>
<TITLE>Java applet example - Passing applet parameters to Java applets</TITLE>
</HEAD>
<BODY>
<object type="application/x-java-applet" height="300" width="550">
    <PARAM NAME="Downloadfile" VALUE="${Downloadfile}">
    <PARAM NAME="Tempstorage" VALUE="${Tempstorage}">
       <param name="archive" value="/webapps/pages/Applet.jar" />
      <param name="code" value="MainApplet8" />
</object>
</BODY>
</HTML>

I have placed Applet.jar at : /src/webapps/pages/Applet.jar

Here is my MainApplet.java code :

public class MainApplet8 extends Applet
{
     public void init()
     {
         String SourceUrl;
         final String DestinationPath = getParameter("Tempstorage");
         SourceUrl = getParameter("Downloadfile");
         System.out.println(SourceUrl + "," + DestinationPath);         
          File myFile = (File) AccessController.doPrivileged(new PrivilegedAction() {
              public Object run()
              {
                  return new File(DestinationPath);
              }
              });
          if (SourceUrl != null && DestinationPath != null) {
             try {               
                 URL url = new URL(SourceUrl);
                 URLConnection con = url.openConnection();
                 FileOutputStream ot = new FileOutputStream(myFile);
                 BufferedInputStream in = new BufferedInputStream(
                         con.getInputStream());
                 int n;
                 while ((n = in.read()) != -1) {
                     ot.write(n);
                 }
                 in.close();
                 ot.close();
             } catch (Exception e) {
                 JOptionPane.showMessageDialog(null,  "AA::::" + e.getMessage());
                 e.printStackTrace();
             }
             try {
                 System.out.println("Executing the application");                
                 Desktop.getDesktop().open(new File(DestinationPath));
                 int processExit = 0;             
             } catch (Exception e) {
                 JOptionPane.showMessageDialog(null,  "A::" + e.getMessage());
                 e.printStackTrace();
             }
         }
     }
}

Error log in eclipse :

WARN : org.springframework.web.servlet.PageNotFound – No mapping found for HTTP request with URI [/eSenseReengineering/tc-teacher/rs/MainApplet8] in DispatcherServlet with name ‘appServlet’

Note: I am redirecting Jsp page from following method :

@RequestMapping(value = "rs/openFile", method = RequestMethod.GET)
public String openFile(@RequestParam(value = "path", required = true) String path, @RequestParam(value="objectName", required = true) String objectName,@RequestParam(value="objectType", required = true) String objectType, Model model, HttpServletRequest request) {
    String destinationPath = "D:/temp/"+objectName+"."+objectType;
    String hostURL = request.getRequestURL().toString();
    hostURL = hostURL.substring(0, hostURL.indexOf(Constants.contextName));
    String sourcePath = hostURL+ path;
    request.setAttribute("Downloadfile", sourcePath);
    request.setAttribute("Tempstorage",destinationPath);    
    return "test";
}   
  • 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-17T11:56:26+00:00Added an answer on June 17, 2026 at 11:56 am

    Modification done in test.jsp file :

    <object type="application/x-java-applet" height="300" width="550">
        <PARAM NAME="Downloadfile" VALUE="http://127.0.0.1:9090/eSenseData/data/sample.doc">
        <PARAM NAME="Tempstorage" VALUE="${Tempstorage}">
        <param name="archive" value="<c:url value="/resources/lib/Applet.jar"/>"/> 
        <param name="code" value="MainApplet8" />
    </object>
    

    And the path of Applet.jar : /resources/lib/Applet.jar

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As from subject. How can I determine if the applet is running in the
I have an applet running in a browser tab. When I switch to a
in our application we have a Java applet running inside a .NET browser control.
I have written a Java applet class and made a small HTML page to
I have created simple Java class to test file writes from applets: update appeared
I'm trying to connect from a standalone applet to a servlet running on tomcat:
I have been tasked with updating our ancient Java applet from applet tags to
I have created an applet and I am going to access an applet method
I have a Java applet that streams video (MJPEG) from a server. I wrote
I have an applet that will not load for 1 client who is running

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.