Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed jsp compilation errors #7

Closed
wants to merge 1 commit into from

Conversation

kateyang1998
Copy link
Collaborator

@kateyang1998 kateyang1998 commented Nov 4, 2024

  • Added jspc dependency to compile the jsp files
  • Fixed jsp compilation errors
  • Excluded all jspf files for now, excluded 1 deprecated jsp file and 2 jsp files containing HTML taglib errors to avoid error detections when compiling. (Will look into these files again)

Summary by Sourcery

Fix JSP compilation errors by updating HTML taglib references and correcting script and link imports. Refactor JSP files to use Struts HTML tags for form elements and inputs. Add jspc-maven-plugin to the build configuration to compile JSP files, excluding certain files with known issues.

Bug Fixes:

  • Fix JSP compilation errors by updating HTML taglib references and correcting script and link imports.

Enhancements:

  • Refactor JSP files to use Struts HTML tags for form elements and inputs, improving maintainability and consistency.

Build:

  • Add jspc-maven-plugin to the build configuration to compile JSP files, excluding certain files with known issues.

@kateyang1998 kateyang1998 requested a review from yingbull November 4, 2024 19:32
Copy link

sourcery-ai bot commented Nov 4, 2024

Reviewer's Guide by Sourcery

This PR addresses JSP compilation errors by adding the jspc-maven-plugin for JSP compilation, updating JSP syntax to be compliant with modern standards, and excluding problematic JSP files. The changes primarily involve replacing deprecated HTML/JSP tags and fixing import statements.

Class diagram for updated JSP imports and usage

classDiagram
    class BillingCodeData {
        +updateCodeByName(String, String, String, String, String, String)
        +addBillingCode(String, String, String)
        +getBillingCodeAttr(String) : List<String>
        +deletePrivateCode(String) : boolean
    }
    class JdbcBillingCodeImpl {
        +updateCodeByName(String, String, String, String, String, String)
        +addBillingCode(String, String, String)
        +getBillingCodeAttr(String) : List<String>
        +deletePrivateCode(String) : boolean
    }
    BillingCodeData <|-- JdbcBillingCodeImpl

    class Logger {
        +error(String)
    }
    class LogManager {
        +getLogger(String) : Logger
    }
    Logger <|-- LogManager

    class DemographicDao {
    }
    class DemographicDaoImpl {
    }
    DemographicDao <|-- DemographicDaoImpl

    class BillingreferralDao {
    }
    BillingreferralDao <|-- BillingreferralDao

    class CtlDocClassDao {
    }
    CtlDocClassDao <|-- CtlDocClassDao

    class MeasurementManager {
        +getFlowsheetDsHTML() : List<String>
        +getPropertyValue(String) : String
    }
    MeasurementManager <|-- MeasurementManager
Loading

File-Level Changes

Change Details Files
Added JSP compilation support through Maven plugins
  • Added jspc-maven-plugin configuration to compile JSP files
  • Added configuration to exclude problematic JSPF files and JSPs with HTML taglib errors
  • Updated maven-war-plugin configuration to handle web resources properly
  • Commented out jetty-maven-plugin temporarily
pom.xml
Updated JSP syntax and tag usage to modern standards
  • Replaced deprecated xhtml="true" locale="true" attributes
  • Updated html:html tags to standard html tags
  • Replaced JSP expression-based resource paths with html:rewrite tags
  • Updated form handling to use Struts html form tags
src/main/webapp/PMmodule/GenericIntake/Edit.jsp
src/main/webapp/PMmodule/GenericIntake/Print.jsp
src/main/webapp/PMmodule/GenericIntake/PrintPreview.jsp
src/main/webapp/PMmodule/IntakeCReport.jsp
src/main/webapp/PMmodule/StreetHealthIntakeReport.jsp
src/main/webapp/hospitalReportManager/upload.jsp
src/main/webapp/olis/log.jsp
Fixed Java import statements and class references
  • Corrected import paths for GstControlAction and JdbcBillingCodeImpl
  • Updated DAO class references to use correct class names
  • Fixed type casting for database queries
  • Added missing imports for required classes
src/main/webapp/billing/CA/BC/billingBCEditPrivateCode.jsp
src/main/webapp/billing/CA/BC/billingAddReferralDoc.jsp
src/main/webapp/billing/CA/BC/billingBC.jsp
src/main/webapp/documentManager/addedithtmldocument.jsp
src/main/webapp/eyeform/encounterHeader.jsp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @kateyang1998 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Consider creating tickets to track fixing the HTML taglib errors in the excluded JSP files (PMmodule/Admin/Bed/Bed.jsp and PMmodule/Admin/AgencyEdit/bed.jsp) rather than excluding them from compilation indefinitely.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link

sweep-ai bot commented Nov 4, 2024

Hey @kateyang1998, here are examples of how you can ask me to improve this pull request:

@Sweep Fix the CI errors.
@Sweep Add unit tests for the jspc-maven-plugin configuration to verify that JSP compilation works correctly and catches compilation errors. Tests should verify:
- JSP files compile successfully
- Excluded files are properly skipped
- HTML taglib errors are caught
- Script and link imports work correctly

📖 For more information on how to use Sweep, please read our documentation.

@kateyang1998 kateyang1998 force-pushed the jsp-compilation-error-fix branch from 63fdd71 to bad098c Compare November 4, 2024 20:26
@@ -441,11 +440,9 @@
<td>
<label>HC Type</label>
<br/>
<select name="client.hcType">
<c:forEach var="province" items="${GenericIntakeConstants.getProvinces()}">
<option value="${province.value}">${province.label}</option>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These were causing errors?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really. I used a command to replace the HTML:HTML tag, and don't know why this file was messed up. I will revert this one.

@@ -245,16 +245,16 @@
}

</script>
<script type="text/javascript" src="<%= request.getContextPath() %>/dojoAjax/dojo.js"></script>
<script type="text/javascript" src="<%= request.getContextPath() %>/js/AlphaTextBox.js"></script>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This -

- Added jspc dependency to compile the jsp files
- Fixed jsp compilation errors
@kateyang1998 kateyang1998 force-pushed the jsp-compilation-error-fix branch from bad098c to e259a2d Compare November 5, 2024 17:38
@kateyang1998 kateyang1998 deleted the jsp-compilation-error-fix branch November 19, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants