Package com.jk.web.util
Class JKWebUtil
java.lang.Object
com.jk.web.util.JKWebUtil
This class is a utility class for web-related operations and common tasks.
- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic StringencodePassword(String password) This method encodes a password using a hashing mechanism.protected static StringThis method replaces occurrences of with a space character in the provided XHTML.static StringgetContextPath(jakarta.servlet.http.HttpServletRequest req) This method retrieves the context path of the HttpServletRequest.static booleanisDebug()This method checks if the application is in debug mode.static voidThis main method used for testing and demonstrating string manipulation.static booleanmatchPasswords(String rawPassword, String encodedPassword) This method compares a raw password with an encoded password to check for a match.static voidtoPDF(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String xhtml) This method is yet to be implemented (TBI). 
- 
Constructor Details
- 
JKWebUtil
public JKWebUtil() 
 - 
 - 
Method Details
- 
fixHtml
This method replaces occurrences of with a space character in the provided XHTML.Also adjusts stylesheet references to use the context path.
- Parameters:
 request- Specifies the HttpServletRequest object.xhtml- Specifies the input XHTML content to be processed.- Returns:
 - the processed XHTML content.
 
 - 
getContextPath
This method retrieves the context path of the HttpServletRequest.- Parameters:
 req- Specifies the HttpServletRequest object.- Returns:
 - the context path of the request.
 
 - 
main
This main method used for testing and demonstrating string manipulation.- Parameters:
 args- the command-line arguments.
 - 
toPDF
public static void toPDF(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, String xhtml) throws Exception This method is yet to be implemented (TBI).- Parameters:
 request- Specifies the parameter that is yet to be implemented (TBI).response- Specifies the parameter that is yet to be implemented (TBI).xhtml- Specifies the parameter that is yet to be implemented (TBI).- Throws:
 Exception- Specifies the exception that is yet to be implemented (TBI).
 - 
isDebug
public static boolean isDebug()This method checks if the application is in debug mode.- Returns:
 - false.
 
 - 
encodePassword
This method encodes a password using a hashing mechanism.- Parameters:
 password- Specifies the plain text password to be encoded.- Returns:
 - the encoded password.
 
 - 
matchPasswords
This method compares a raw password with an encoded password to check for a match.- Parameters:
 rawPassword- Specifies the plain text password to be compared.encodedPassword- Specifies the encoded password to be compared.- Returns:
 - true, if the passwords match, false otherwise.
 
 
 -