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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:52:04+00:00 2026-05-25T17:52:04+00:00

I had a requirement to create a small file utility class to run off

  • 0

I had a requirement to create a small file utility class to run off the command line from a windows desktop. The code got completed, however, after reviewing how to package it, it requires a custom framework from the main application in order to run. Don’t ask why as that would take a while to answer, just take this as a valid assumption.

In any event, now they want a jsp to call this class, but they still want it to be more of a separate utility, even though it’s part of the main codebase. They also want it to call the main method in the utility, which doesn’t sound like good design to me, but they didn’t want to change it to a servlet class.

The program just takes in some arguments and then it’s basically on one step operation on the files, then it finishes. Not really a jsp type request/response scenario, but I’m not the one writing the requirements.

From a design perspective, is there a better way to do this for a simple utility application?

Thanks,

James

  • 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-05-25T17:52:05+00:00Added an answer on May 25, 2026 at 5:52 pm

    If you really can’t change the design, you could either just import the class and invoke it (this works only if it’s in the webapp’s classpath).

    YourMainClass.main(new String[] {"some", "arguments"});
    

    Or spawn a process and execute it (this is really not recommended as the new process would allocate another bunch of memory which is as much as the server is currently using!).

    Runtime.getRuntime().exec("java -cp /path/to/root com.example.YourMainClass some arguments");
    

    Both ways can be done in a scriptlet (yuck), or preferably just in a Servlet.

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

Sidebar

Related Questions

I had a requirement where I need to clear off the select all checkbox
I had a requirement to create a query in SQL Server where the search condition
I want a small (< 30MB) standalone Windows executable (a single file) that creates
I had a requirement for Multithreaded Zip file reader for my ongoing project.When i
I had a requirement where in the text field the first character should be
Hii, I had a requirement of encode a string provided to a unreadable format
I am working on a database application in C#. I had a requirement to
We recently had a new requirement to use the phonon component of Qt, which
I worked on a project that had the following requirement: TableA is the parent
I had a pretty simple requirement in my Scheme program to execute more than

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.