0

I am currently working on a project that implies passing a aspx.net project to jsp.

The issue that I have been working on all day is as follows:

I create the following methods in a java file named DefaultMethods:

package model;

import com.merlin.MXL;

public class DefaultMethods {

    public DefaultMethods() {
        super();
    }

    public String versionNumber(){
             try{
                MXL mxl = new MXL();
                return mxl.merlinVersion();
            }
            catch (Exception ex){
               return "Contact MerlinXL";
            }
        }

     public String serverName(){
            try{
                MXL mxl = new MXL();
                return mxl.serverName();
            }
            catch (Exception ex){
               return "Contact MerlinXL";
            }
        }

}

Where MXL is the webservice specifically created for this application.

So then I go to the jsp page and import the java class and call the methods in <% %> tags:

<%@ page import="model.DefaultMethods"%>
<%@ page language="java" contentType="text/html; charset=iso-8859-1" pageEncoding="ISO-8859-1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>MerlinXL</title>
    <link href="web/css/merlinxl.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="/favicon.ico" />
    <style type="text/css">

Now go a series of css styles, tables, etc. And then I call the methods here:

<tr>
            <td valign="top"  class="style2">
                <strong>
                    <%
                        DefaultMethods defaultMethods = new DefaultMethods();
                        String theNumber = defaultMethods.versionNumber();
                    %>
                    <label ID="labVersion" style="font-weight: 700; font-size: small; text-align: center"/>
                         Version <%= theNumber %>&nbsp;&nbsp; 
                    </label>
                </strong>
            </td>
            <td valign="top"  class="auto-style1">
                <p style="margin-left: 0px">
                    &nbsp;
                </p>
            </td>
            <td valign="top" class="style3">
                <strong>
                    <%
                        DefaultMethods defaultMethods2 = new DefaultMethods();
                        String theServer = defaultMethods2.serverName();

                    %>
                    <label ID="labServer" style="font-weight: 700; font-size: small; text-align: center"/>
                         Server Name  <%= theServer %> &nbsp;&nbsp;
                    </label>
                </strong>
            </td>
          </tr>

Now, the funny thing is that the imports work fine, gives no mistakes on the client side when loading the page on the server, what's more, when I press Ctrl + Space in the IDE (JDeveloper) on the instance of DefaultMethods it autompletes giving me all the methods I have declared in the class as options. But when it loads on the server, it keeps giving me error coming up as method not found

I know I'm not coding in the best practice yet, I wanted to start a simple one to see if it worked and then go in with MVC.

Yes, I have googled, and yes, I have looked up the solutions in here, but I seem to have everything in order with my code and I'm out of ideas or just can't see the tree from the woods.

Steven
  • 1,236
  • 1
  • 13
  • 37
  • 1
    Post the complete error you get. What is the server you are using? – pahan Jul 14 '16 at 22:01
  • Please use a servlet to put your object in scope for JSP to handle. here is a sample example: http://stackoverflow.com/questions/5003142/show-jdbc-resultset-in-html-in-jsp-page-using-mvc-and-dao-pattern – Madhu V Rao Jul 15 '16 at 01:33
  • Which method was not found? – nitind Jul 15 '16 at 02:42

1 Answers1

0

Well, needless to answer the comments, as the code worked beautifully after I opened the project up this morning.

There has to be some kind of bug in JDeveloper when creating new packages and files, odd thing is I restarted the web service to make sure that the new folders would integrate, but by the looks of it JDeveloper needs, at the very least, to be restarted in order to integrate new folders/files.

Definitely this IDE is a great let down from Oracle.

Thank you all for your comments.

Steven
  • 1,236
  • 1
  • 13
  • 37