<%@ page import="java.util.ArrayList" %> <%@ page import="com.mit.ocw.common.OcwSiteInfo" %> <%@ page import="com.mit.ocw.common.OcwLogger" %> <%@ page import="com.mit.ocw.notifier.OcwNotifier" %> <%@ page import="java.io.File" %> <%@ page import="javax.mail.internet.InternetAddress" %> <%@ page import="javax.mail.internet.AddressException" %>
MIT OpenCourseWare
  • OCW home
  • Course List
  • about OCW
  • Help
  • Feedback
  • Support MIT OCW


<% // Form elements with positions of the mouse cursor on the form submission button //----------final String SUBMIT_X = "feedbacksubmission.x"; //----------final String SUBMIT_Y = "feedbacksubmission.y"; // Name of the form submission button final String SUBMIT_NAME = "feedbacksubmission"; final String SUBMIT_VALUE = "Send Feedback"; final String CLEAR_FORM_NAME = "clearform"; final String CLEAR_FORM_VALUE = "Clear Form"; // HTTP header with the URL from where the user navigated to the feedback page final String REFERER = "Referer"; // Type of request expected for form submission final String POST_REQUEST = "POST"; // Address to which user input is sent final String TO_ADDRESS = "ocw@MIT.EDU"; // Address from which user input is shown as orignating from final String SOURCE_ADDRESS = "ocw@MIT.EDU"; // Form fields to be filled in by the user final String DESCRIPTION = "description"; final String DESCRIPTION_ID = "desc"; final String FROM_ADDRESS = "fromemail"; final String INQUIRY_TYPE = "inquiry"; final String INQUIRY_TYPE_ID = "nature"; final String FIRST_NAME = "firstname"; final String LAST_NAME = "lastname"; final String EDUCATIONAL_ROLE = "educationalRole"; final String GEOGRAPHIC_REGION = "geographicRegion"; final String GEOGRAPHIC_REGION_ID = "geo"; // URL to which the form will be posted final String ACTION_URL = "/OcwWeb/jsp/feedback.jsp"; %> <% // Indicates if the Form field values are sent via POST by the user boolean feedbackSubmitted = false; // Position of the mouse cursor on the Form submission button //------------String submitXValue = request.getParameter(SUBMIT_X); //------------String submitYValue = request.getParameter(SUBMIT_Y); // URL from which the user navigated to the feedback page String referer = null; // List of errors in the Form submitted by the user ArrayList errorList = null; // Form field values String description = ""; String fromAddress = ""; String firstName = ""; String lastName = ""; String inquiryType = ""; String educationalRole = ""; String geographicRegion = ""; // Request method - GET or POST String requestMethod = request.getMethod(); String selected_value = ""; //{"A","B","C","D","E","F","G","H","I","J","K","L","M","M","O","P","Q","R","S","T","U","V","W","X","Y","Z"}; String[] array_countries = {"United States", "United Kingdom", "Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua and Barbuda", "Argentina", "Armenia", "Australia", "Austria", "Azerbaijan", "Bahamas, The", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Brazil", "Brunei", "Bulgaria", "Burkina Faso", "Burma", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Central African Republic", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo (Brazzaville)", "Congo (Kinshasa)", "Cook Islands", "Costa Rica", "Côte d'Ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equitorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia, The", "Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Holy See", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, North", "Korea, South", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia, The Former Yugoslavia Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico", "Micronesia, Federal States of", "Moldova", "Monaco", "Mongolia", "Morocco", "Mozambique", "Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway", "Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland", "Portugal", "Qatar", "Romania", "Russia", "Rwanda", "Saint Kitts and Nevis", "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "Spain", "Sri Lanka", "Sudan", "Suriname", "Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Vietnam", "Yemen", "Yugoslavia", "Zambia", "Zimbabwe"}; String country = ""; // Accept only submissions made via post (i.e., from the feedback page itself) if (requestMethod.equals(POST_REQUEST)) { feedbackSubmitted = true; referer = request.getParameter(REFERER); } else { referer = request.getHeader(REFERER); if (referer == null || referer.equals(ACTION_URL)) { referer = "/OcwWeb/index.htm"; } } %> <% if (feedbackSubmitted) { // Get the values input by the user description = request.getParameter(DESCRIPTION); fromAddress = request.getParameter(FROM_ADDRESS); firstName = request.getParameter(FIRST_NAME); lastName = request.getParameter(LAST_NAME); inquiryType = request.getParameter(INQUIRY_TYPE); educationalRole = request.getParameter(EDUCATIONAL_ROLE); geographicRegion = request.getParameter(GEOGRAPHIC_REGION); // Subject of the e-mail that will be sent String subject = inquiryType; if (firstName == null){ firstName = ""; } if (lastName == null){ lastName = ""; } // Ensure that description and e-mail address of the user // have been specified if (description == null || description.trim().equals("")){ if (errorList == null){ errorList = new ArrayList(); } errorList.add("The Description field is blank."); } if (educationalRole.equals("") || educationalRole.equals("No Selection")){ if (errorList == null) { errorList = new ArrayList(); } errorList.add("The Educational Role field is blank."); } if (inquiryType.equals("") || inquiryType.equals("No Selection") ){ if (errorList == null) { errorList = new ArrayList(); } errorList.add("The Nature of Inquiry field is blank."); } if (fromAddress == null || fromAddress.trim().equals("")){ fromAddress = ""; if (errorList == null){ errorList = new ArrayList(); } errorList.add("The Email Address field is blank."); } else{ int atIndex = 0; int dotIndex = 0; // Ensure that the e-mail address is of the correct format. The following // check is performed. // 1. There is exactly one '@' character in the address and that is neither // the first nor the last character // 2. There is at least one '.' character in the address after the '@' character // and that is not the last character if (((atIndex = fromAddress.indexOf("@")) < 1) || ((dotIndex = fromAddress.indexOf(".", atIndex)) == -1) || (atIndex != fromAddress.lastIndexOf("@")) || (fromAddress.lastIndexOf(".") == fromAddress.length())) { if (errorList == null){ errorList = new ArrayList(); } errorList.add("The format of the e-mail address is invalid."); } } // The following statements determine the course to which the URL from which // the user navigated from belongs to //String absPath = OcwSiteInfo.getAbsolutePath(referer); boolean sent = false; String course = ""; if (referer != null) { course = referer.replace('/', File.separatorChar); } // The following statements construct the message to be sent StringBuffer message = new StringBuffer(256); if (!course.equals("")) { message.append("Refering URL: " + course); message.append("\n\n"); } message.append("Name: ").append(firstName).append(" ").append(lastName); message.append("\n\nE-mail: ").append(fromAddress); message.append("\n\nNature of Inquiry: ").append(inquiryType); message.append("\n\nEducational Role: ").append(educationalRole); message.append("\n\nGeographic Region: ").append(geographicRegion); message.append("\n\nDescription:\n").append(description).append("\n"); String toAddresses[] = new String[1]; toAddresses[0] = TO_ADDRESS; String fromAddresses[] = new String [1]; fromAddresses[0] = fromAddress; String softReplyMessage = "Thank you for your correspondence about MIT OCW. We're glad you find the course materials useful. If your message requires a response, we will contact you within 48 hours. Please do not reply to this system-generated response.\n\nWith virtually all Institute courses available, MIT OCW is an unprecedented educational resource. MIT OCW has also been joined by dozens of institutions worldwide sharing courseware through the OCW Consortium (http://ocwconsortium.org). \n\nThank you for joining us on our educational journey. \n\nSincerely, \nThe MIT OpenCourseWare Team\n\n__________________________ Support MIT OCW __________________________ \n\nOCW depends in part on visitor donations to support our ongoing publication.\nYour donation of $25, $50 or more will keep OCW available and up-to-date.\nMake a donation at: http://ocw.mit.edu/OcwWeb/Global/AboutOCW/ocwdonor.htm \n\n_________________________ OCW News and Feeds ________________________ \n\nSign up for the OCW newsletter and RSS feeds at the links below. \nNewsletter: http://mailman.mit.edu/mailman/listinfo/ocw-mail \nRSS feeds: http://ocw.mit.edu/OcwWeb/Global/OCWHelp/rssfeeds.htm"; String softReplySubject = "Thank you for your OCW feedback"; // Send the message only if no error is encountered and the information // is complete if (errorList == null) { try { OcwNotifier.sendMessage(SOURCE_ADDRESS, toAddresses, null, null, subject, message.toString()); sent = true; try { OcwNotifier.sendMessage(SOURCE_ADDRESS,fromAddresses,null,null,softReplySubject,softReplyMessage); } catch (Throwable e) { // } } catch (Throwable e) { // } } %> <% if (errorList == null) {%>

We welcome your feedback!

With 1550 courses available online, MIT is fulfilling the promise of MIT OpenCourseWare. Feedback from visitors helps to understand how to improve the MIT OCW Web site as we move to the publication of the course materials used in virtually all of MIT's graduate and undergraduate courses.

Find out how to use OCW or get help, go to: OCW Help

To report problems, ask questions, or provide feedback, email: ocw@mit.edu

To report intellectual property concerns, go to: OCW Legal Notices

Thanks for taking the time to let us know!

Return to referring page

<%}%> <%}%> <% // Display the form if the request is not of type POST or // the information posted had errors or was incomplete or // the form was refreshed if ( (errorList != null) || (!feedbackSubmitted) ) {%>


We welcome your feedback!

With 1550 courses available online, MIT is fulfilling the promise of MIT OpenCourseWare. Feedback from visitors helps us to understand how to improve the MIT OCW Web site as we move to the publication of the course materials used in virtually all of MIT's graduate and undergraduate courses.

  1. MIT OCW is not a distance-learning, or a degree- or certificate-granting initiative. There is no registration process required for users to view course materials. MIT OCW is available on the Web, free of charge, to any user anywhere in the world.
  2. MIT OCW does not offer the opportunity for direct contact with MIT faculty. Inquiries related to specific course materials will be forwarded to the MIT faculty member associated with that course for their consideration. However, due to the tremendous volume of email inquiries received, it is unlikely he or she will answer all emails.
  3. MIT aims to publish course materials from virtually all of its subjects by the year 2008. If you do not find the course materials you are looking for, please check back with us periodically as we add new courses, including 125 more in Spring 2007. You are encouraged to register for our email newsletter, The MIT OpenCourseWare Update, to receive monthly updates on new course offerings.

Also, before sending us your inquiry, we ask that you check if your question can be answered by our MIT OCW Frequently Asked Questions. We will try to answer your question as soon as possible.

Fill out the feedback form below (* indicates required fields):

<% if (errorList != null) { // Display all the errors that were encountered for (int i = 0; i < errorList.size(); i++){%>


<% } %> <%}%>