Code Monkey home page Code Monkey logo

spring-boot-legacy-weblogic's Introduction

Spring Boot support for legacy WebLogic

An example of a spring boot application that can be deployed to a legacy WebLogic server (11g and below) which uses servlet 2.5 api

Dependencies

  • spring-boot-starter-parent: Using version 1.1.12 for Java SE 6 compatibility 1.1.12.RELEASE
  • servlet-api: Using version 2.5 supported by legacy WebLogic servers 11g and below
  • spring-boot-legacy: Using version 1.0.4 support for legacy (Servlet 2.5) apps in Spring Boot [https://github.com/dsyer/spring-boot-legacy]

Running the Application

You do not run this application by executing the main method in SpringBootWebLogicLegacyApplication.java. Please read these instructions to launch this application

To run the application:

Execute the following commands

cd ~/spring-boot-legacy-weblogic

mvn spring-boot:run

Building the WAR

Use the standard Maven Lifecycle "package" goal to create the WAR.

Note the following commands will fail due to the spring-boot-starter-tomcat dependency being given the scope of provided.

mvn spring-boot:repackage

Accessing the Service

Running locally

http://localhost:8080/spring-boot-legacy-app

Running from WebLogic

http://{webLogicServerAddress}:{port}/spring-boot-legacy-app

If you see "Hello World!" then everything is working correctly

spring-boot-legacy-weblogic's People

Contributors

bamiidowu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spring-boot-legacy-weblogic's Issues

please add this Example of ServletRequest , ServletResponse in this project

package com.boostrdev.weblogic.legacy;
import java.io.PrintWriter;
import java.util.Enumeration;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.xml.ws.Response;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Encryption {

//@RequestMapping("/api/encryption")
@RequestMapping(value = "/api/encryption")
public void GetEncryptedData(ServletRequest req,ServletResponse res) 
{
   /* String EncryptedText;
    
    EncryptedText = AESCycle.encrypt(data.getData());
    
    return new Message("Successfull","Data has been Encrypted successfull",EncryptedText);
    */
 
  //  return "Get GetencryptedData 003";
     res.setContentType("text/html");  
    try{
        PrintWriter out=res.getWriter();  
        String Data =  req.getParameter("Data") ;
        out.print("{ \"data\": \""+Data+"\"}");
    }
    catch (Exception ex)
    {
        
    }
    
}

@RequestMapping("/api/decryption")
public String GetDecryptedData() 
{
   /* String DecryptedText;
    
    DecryptedText = AESCycle.decrypt(data.getData());
    
    return new Message("Successfull","Data has been decrypted successfull",DecryptedText);
    */
   
    return "Get GetDecryptedData 003";
}

/*
Method with Path Variables
@RequestMapping("/api/encryption/{Data}")
public Message GetEncryptedData(@PathVariable String Data)
{
    return new Message("Successfull","Data has been encrypted successfull.",Data);
}

Method With Query Param
@RequestMapping("/api/encryption")
public Message GetEncryptedData(@RequestParam String Data) 
{
    return new Message("Successfull","Data has been encrypted successfull.",Data);
}
*/

}

can't mapping request

http://....:7001/spring-boot-legacy-weblogic/
is ok;
return Hello World!;

but other request can't mapping

@RequestMapping("/1")
@responsebody
public String ok1() {
return "ok";
}

http://....:7001/spring-boot-legacy-weblogic/1

Error 404--Not Found

From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:

10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.