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 %>
</label>
</strong>
</td>
<td valign="top" class="auto-style1">
<p style="margin-left: 0px">
</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 %>
</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.